Skip to content

Commit

Permalink
Upgrade submodule, update code accordingly.
Browse files Browse the repository at this point in the history
The gdb procedure varobj_delete() has dropped the "returned variable list"
feature, thus we can no longer use it to remove our tcl alias variables.
A new procedure variable_delete_tcl() is thus implemented to perform this
task before removing the gdb variable.

* gdbtk/generic/gdbtk_varobj.c: new procedure variable_delete_tcl().
  (variable_delete): remove tcl alias variable using variable_delete_tcl().
  • Loading branch information
Patrick Monnerat committed Feb 8, 2016
1 parent 94579e1 commit 2474975
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion binutils-gdb
Submodule binutils-gdb updated from b605bb to 1d4f3c
42 changes: 27 additions & 15 deletions gdbtk/generic/gdbtk-varobj.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Variable user interface layer for GDB, the GNU debugger.
Copyright (C) 1999-2015 Free Software Foundation, Inc.
Copyright (C) 1999-2016 Free Software Foundation, Inc.
This file is part of GDB.
Expand Down Expand Up @@ -400,26 +400,38 @@ variable_create (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
return TCL_ERROR;
}

/* Delete the variable object VAR and its children */
/* If only_children_p, Delete only the children associated with the object. */
/* Delete tcl representation of variable. */
static void
variable_delete (Tcl_Interp *interp, struct varobj *var,
int only_children_p)
variable_delete_tcl (Tcl_Interp *interp, struct varobj *var,
int only_children_p)
{
char **dellist;
char **vc;

varobj_delete (var, &dellist, only_children_p);
int i;

vc = dellist;
while (*vc != NULL)
/* Delete children. */
for (i = 0; i < VEC_length (varobj_p, var->children); i++)
{
uninstall_variable (interp, *vc);
xfree (*vc);
vc++;
varobj_p child = VEC_index (varobj_p, var->children, i);

if (!child)
continue;
variable_delete_tcl (interp, child, 0);
}

xfree (dellist);
if (only_children_p || !var->obj_name)
return;

/* Delete tcl variable now. */
uninstall_variable (interp, var->obj_name);
}

/* Delete the variable object VAR and its children */
/* If only_children_p, Delete only the children associated with the object. */
static void
variable_delete (Tcl_Interp *interp, struct varobj *var,
int only_children_p)
{
variable_delete_tcl (interp, var, only_children_p);
varobj_delete (var, only_children_p);
}

/* Return a list of all the children of VAR, creating them if necessary. */
Expand Down

0 comments on commit 2474975

Please sign in to comment.