This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
generic/gdbtk-varobj.c: Adjust for varobj_list_children change
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: insight at sourceware dot org, gdb-patches at sourceware dot org
- Cc: Vladimir Prus <vladimir at codesourcery dot com>, "Maciej W. Rozycki" <macro at linux-mips dot org>
- Date: Wed, 30 Jan 2008 15:58:30 +0000 (GMT)
- Subject: generic/gdbtk-varobj.c: Adjust for varobj_list_children change
- Resent-subject: generic/gdbtk-varobj.c: Adjust for varobj_list_children change
Hello,
Following recent changes to varobj.c this is a fix to make Insight build
again.
I have regression tested it with the gdb.gdbtk/*.exp subset of the test
suite, using the mipsisa32-sde-elf target with the
mips-sim-sde32/-EB/-march=mips32r2/-mips16 board and it actually saw an
improvement compared to the state from before the change to varobj.c:
-# of expected passes 457
-# of unexpected failures 28
+# of expected passes 517
+# of unexpected failures 30
2008-01-30 Maciej W. Rozycki <macro@mips.com>
* generic/gdbtk-varobj.c (variable_children): Adjust
for varobj_list_children change.
OK to apply?
Maciej
gdb-varobj_list_children.diff
Index: binutils-quilt/src/gdb/gdbtk/generic/gdbtk-varobj.c
===================================================================
--- binutils-quilt.orig/src/gdb/gdbtk/generic/gdbtk-varobj.c 2007-04-30 13:24:36.000000000 +0100
+++ binutils-quilt/src/gdb/gdbtk/generic/gdbtk-varobj.c 2008-01-30 15:34:19.000000000 +0000
@@ -413,26 +413,24 @@
variable_children (Tcl_Interp *interp, struct varobj *var)
{
Tcl_Obj *list;
- struct varobj **childlist;
- struct varobj **vc;
+ VEC(varobj_p) *children;
+ struct varobj *child;
char *childname;
+ int ix;
list = Tcl_NewListObj (0, NULL);
- varobj_list_children (var, &childlist);
+ children = varobj_list_children (var);
- vc = childlist;
- while (*vc != NULL)
+ for (ix = 0; VEC_iterate (varobj_p, children, ix, child); ++ix)
{
- childname = varobj_get_objname (*vc);
+ childname = varobj_get_objname (child);
/* Add child to result list and install the Tcl command for it. */
Tcl_ListObjAppendElement (NULL, list,
Tcl_NewStringObj (childname, -1));
install_variable (interp, childname);
- vc++;
}
- xfree (childlist);
return list;
}