aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-05-26 10:40:32 -0600
committerTom Tromey <tromey@adacore.com>2022-06-06 12:50:34 -0600
commita80f2680dbf07c713e3d58bc0906b7ed52f911e2 (patch)
treea35514b4d13974a0d5508fb73ddaf2f7ceebe856 /gdb/varobj.c
parentc2ebdf6a7def7cc4fda0b965554d259177b2fe26 (diff)
downloadfsf-binutils-gdb-a80f2680dbf07c713e3d58bc0906b7ed52f911e2.zip
fsf-binutils-gdb-a80f2680dbf07c713e3d58bc0906b7ed52f911e2.tar.gz
fsf-binutils-gdb-a80f2680dbf07c713e3d58bc0906b7ed52f911e2.tar.bz2
Simplify varobj "change" logic
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.
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 741fdb6..1aca015 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;