aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-12-11 09:33:36 -0700
committerTom Tromey <tom@tromey.com>2020-12-11 09:33:41 -0700
commit446d2c032d387a75020ecb41b5d89dd93158beb0 (patch)
treefdf7362b4b5426779279a94250503ccedfc86bc9 /gdb/varobj.c
parent11106495078658246feda85cb7566c1a6aacb1e1 (diff)
downloadgdb-446d2c032d387a75020ecb41b5d89dd93158beb0.zip
gdb-446d2c032d387a75020ecb41b5d89dd93158beb0.tar.gz
gdb-446d2c032d387a75020ecb41b5d89dd93158beb0.tar.bz2
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 <tom@tromey.com> * varobj.c (varobj_clear_saved_item): Remove. (update_dynamic_varobj_children): Update. (varobj::~varobj): Don't call varobj_clear_saved_item.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 4cbf007..941c38c 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<varobj *> *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;