From: Tom Tromey Date: Fri, 11 Dec 2020 16:33:36 +0000 (-0700) Subject: Remove varobj_clear_saved_item X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=446d2c032d387a75020ecb41b5d89dd93158beb0;p=binutils-gdb.git Remove varobj_clear_saved_item One call to varobj_clear_saved_item is from the varobj destructor. This is no longer needed, so this patch removes the call; then inlines the function into the sole remaining caller. gdb/ChangeLog 2020-12-11 Tom Tromey * varobj.c (varobj_clear_saved_item): Remove. (update_dynamic_varobj_children): Update. (varobj::~varobj): Don't call varobj_clear_saved_item. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3b6569a3087..f61cfda48da 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-12-11 Tom Tromey + + * varobj.c (varobj_clear_saved_item): Remove. + (update_dynamic_varobj_children): Update. + (varobj::~varobj): Don't call varobj_clear_saved_item. + 2020-12-11 Tom Tromey * varobj.c (install_dynamic_child, varobj_clear_saved_item) diff --git a/gdb/varobj.c b/gdb/varobj.c index 4cbf0078459..941c38c1ceb 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -673,15 +673,6 @@ varobj_get_iterator (struct varobj *var) requested an iterator from a non-dynamic varobj")); } -/* Release and clear VAR's saved item, if any. */ - -static void -varobj_clear_saved_item (struct varobj_dynamic *var) -{ - if (var->saved_item != NULL) - var->saved_item.reset (nullptr); -} - static bool update_dynamic_varobj_children (struct varobj *var, std::vector *changed, @@ -700,8 +691,7 @@ update_dynamic_varobj_children (struct varobj *var, if (update_children || var->dynamic->child_iter == NULL) { var->dynamic->child_iter = varobj_get_iterator (var); - - varobj_clear_saved_item (var->dynamic); + var->dynamic->saved_item.reset (nullptr); i = 0; @@ -1864,8 +1854,6 @@ varobj::~varobj () } #endif - varobj_clear_saved_item (var->dynamic); - if (is_root_p (var)) delete var->root;