diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2016-02-07 09:45:02 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2016-02-07 09:45:02 -0500 |
commit | 30914ca8c030eedc4a7e1f1acc878211639cc1ca (patch) | |
tree | f795c5aab805e037b6aa53227f57d16407903961 /gdb/varobj.h | |
parent | b7a4e9d8e6a854d2344ab7963e531d6f19571d2e (diff) | |
download | gdb-30914ca8c030eedc4a7e1f1acc878211639cc1ca.zip gdb-30914ca8c030eedc4a7e1f1acc878211639cc1ca.tar.gz gdb-30914ca8c030eedc4a7e1f1acc878211639cc1ca.tar.bz2 |
varobj: Cleanup dead code
This patch removes some dead code.
I noticed that varobj_delete was always called with dellist == NULL, so
I started removing that parameter. That allows removing a good chunk of
the code in varobj_delete, making it almost trivial. We can also remove
the resultp parameters in that whole trail. In turn, this shows that
struct cpstack, cppush and cppop were only used fo that mechanism, so
they can be removed as well.
I also moved the function comment to the header file to comply with
today's guideline, even though the rest of the file does not respect it
(yet).
gdb/ChangeLog:
* varobj.h (varobj_delete): Remove dellist parameter, update and
move documentation here.
* varobj.c (struct cpstack, cppush, cppop): Remove.
(delete_variable): Remove resultp (first) parameter.
(delete_variable_1): Likewise.
(varobj_delete): Remove dellist parameter and unused code.
(update_dynamic_varobj_children): Adjust varobj_delete call.
(update_type_if_necessary): Likewise.
(varobj_set_visualizer): Likewise.
(varobj_update): Likewise.
(value_of_root): Likewise.
(varobj_invalidate_iter): Likewise.
* mi/mi-cmd-var.c (mi_cmd_var_delete): Likewise.
Diffstat (limited to 'gdb/varobj.h')
-rw-r--r-- | gdb/varobj.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/varobj.h b/gdb/varobj.h index 66399fd..f750482 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h @@ -246,8 +246,10 @@ extern char *varobj_get_objname (const struct varobj *var); extern char *varobj_get_expression (const struct varobj *var); -extern int varobj_delete (struct varobj *var, char ***dellist, - int only_children); +/* Delete a varobj and all its children if only_children == 0, otherwise delete + only the children. Return the number of deleted variables. */ + +extern int varobj_delete (struct varobj *var, int only_children); extern enum varobj_display_formats varobj_set_display_format ( struct varobj *var, |