From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Simplify varobj "change" logic
Date: Thu, 26 May 2022 10:49:06 -0600 [thread overview]
Message-ID: <20220526164906.1096660-1-tromey@adacore.com> (raw)
varobj used to store 'print_value' as a C string, where NULL was a
valid value, and so it had logic to handle this situation. However,
at some point this was changed to be a std::string, and so the code
can be simplified in this spot.
---
gdb/varobj.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 741fdb6a03b..1aca015a21a 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1344,11 +1344,8 @@ install_new_value (struct varobj *var, struct value *value, bool initial)
{
print_value = varobj_value_get_print_value (var->value.get (),
var->format, var);
- if ((var->print_value.empty () && !print_value.empty ())
- || (!var->print_value.empty () && print_value.empty ())
- || (!var->print_value.empty () && !print_value.empty ()
- && var->print_value != print_value))
- changed = true;
+ if (var->print_value != print_value)
+ changed = true;
}
var->print_value = print_value;
--
2.34.1
next reply other threads:[~2022-05-26 16:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 16:49 Tom Tromey [this message]
2022-06-06 18:44 ` 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=20220526164906.1096660-1-tromey@adacore.com \
--to=tromey@adacore.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).