aboutsummaryrefslogtreecommitdiff
path: root/gdb/varobj.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-08-31 13:58:49 -0600
committerTom Tromey <tromey@adacore.com>2023-09-07 14:04:53 -0600
commitd1369de649a9d19abae1012ef805aaa674314c0c (patch)
tree4938931225e3f7155ca257c9fcbe74133d2e5e52 /gdb/varobj.c
parent78dfcce3174dbb9bd9d3a5898e57a9019dcc38d9 (diff)
downloadgdb-d1369de649a9d19abae1012ef805aaa674314c0c.zip
gdb-d1369de649a9d19abae1012ef805aaa674314c0c.tar.gz
gdb-d1369de649a9d19abae1012ef805aaa674314c0c.tar.bz2
Fix bug in -var-evaluate-expression
This bug points out that if one uses -var-set-visualizer with "None" -- to disable a pretty-printer for a varobj -- then -var-evaluate-expression will still use pretty-printing. This is a combination of bugs. First, setting the visualizer does not update the display text; and second, computing the display text should use "raw" when Python is available but no visualizer is desired. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=11738 Reviewed-by: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/varobj.c')
-rw-r--r--gdb/varobj.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 3ae8d72..a4fcbff 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -1393,6 +1393,9 @@ varobj_set_visualizer (struct varobj *var, const char *visualizer)
/* If there are any children now, wipe them. */
varobj_delete (var, 1 /* children only */);
var->num_children = -1;
+
+ /* Also be sure to reset the print value. */
+ varobj_set_display_format (var, var->format);
#else
error (_("Python support required"));
#endif
@@ -2212,6 +2215,12 @@ varobj_value_get_print_value (struct value *value,
return "{...}";
}
}
+ else
+ {
+ /* If we've made it here, we don't want a pretty-printer --
+ if we had one, it would already have been used. */
+ opts.raw = true;
+ }
}
#endif