From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 09/11] Remove varobj_clear_saved_item
Date: Sat, 24 Oct 2020 15:08:54 -0600 [thread overview]
Message-ID: <20201024210856.12021-10-tom@tromey.com> (raw)
In-Reply-To: <20201024210856.12021-1-tom@tromey.com>
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-10-24 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.
---
gdb/ChangeLog | 6 ++++++
gdb/varobj.c | 14 +-------------
2 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/gdb/varobj.c b/gdb/varobj.c
index ad7a93f5bfa..8b02eb338b4 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;
--
2.17.2
next prev parent reply other threads:[~2020-10-24 21:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-24 21:08 [PATCH 00/11] Some varobj C++-ification and cleanup Tom Tromey
2020-10-24 21:08 ` [PATCH 01/11] Use htab_t in varobj Tom Tromey
2020-10-24 21:08 ` [PATCH 02/11] Change varobj.c:rootlist to a std::list Tom Tromey
2020-10-24 21:08 ` [PATCH 03/11] Change all_root_varobjs to take a function_view Tom Tromey
2020-10-24 21:08 ` [PATCH 04/11] C++-ify varobj iteration Tom Tromey
2020-10-24 21:08 ` [PATCH 05/11] Change varobj_iter::next to return unique_ptr Tom Tromey
2020-10-24 21:08 ` [PATCH 06/11] Change varobj_dynamic::saved_item to unique_ptr Tom Tromey
2020-10-24 21:08 ` [PATCH 07/11] Change varobj_dynamic::child_iter " Tom Tromey
2020-10-24 21:08 ` [PATCH 08/11] Change varobj_item::value to a value_ref_ptr Tom Tromey
2020-10-24 21:08 ` Tom Tromey [this message]
2020-10-24 21:08 ` [PATCH 10/11] Use gdbpy_ref in instantiate_pretty_printer Tom Tromey
2020-10-24 21:08 ` [PATCH 11/11] install_variable cannot fail Tom Tromey
2020-12-11 16:46 ` [PATCH 00/11] Some varobj C++-ification and cleanup Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201024210856.12021-10-tom@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).