OSDN Git Service

* generic/gdbtk-varobj.c (variable_children): Adjust
authorMaciej W. Rozycki <macro@linux-mips.org>
Tue, 5 Feb 2008 14:07:06 +0000 (14:07 +0000)
committerMaciej W. Rozycki <macro@linux-mips.org>
Tue, 5 Feb 2008 14:07:06 +0000 (14:07 +0000)
for varobj_list_children change.

gdb/gdbtk/ChangeLog
gdb/gdbtk/generic/gdbtk-varobj.c

index f3edd38..7639cdf 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-05  Maciej W. Rozycki  <macro@mips.com>
+
+       * generic/gdbtk-varobj.c (variable_children): Adjust
+       for varobj_list_children change.
+
 2007-07-02  Markus Deuling  <deuling@de.ibm.com>
 
        * gdbtk/generic/gdbtk-stack.c (get_frame_name): Remove dead code
index e92177b..776c6bf 100644 (file)
@@ -1,5 +1,5 @@
 /* Variable user interface layer for GDB, the GNU debugger.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2008 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -413,26 +413,24 @@ static Tcl_Obj *
 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;
 }