aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-varobj.exp
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/testsuite/gdb.python/py-varobj.exp
parent78dfcce3174dbb9bd9d3a5898e57a9019dcc38d9 (diff)
downloadbinutils-d1369de649a9d19abae1012ef805aaa674314c0c.zip
binutils-d1369de649a9d19abae1012ef805aaa674314c0c.tar.gz
binutils-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/testsuite/gdb.python/py-varobj.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-varobj.exp12
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-varobj.exp b/gdb/testsuite/gdb.python/py-varobj.exp
index 0e09783..f1eb352 100644
--- a/gdb/testsuite/gdb.python/py-varobj.exp
+++ b/gdb/testsuite/gdb.python/py-varobj.exp
@@ -47,3 +47,15 @@ mi_gdb_test "-var-create tval * tval" \
mi_gdb_test "-var-list-children --all-values tval" \
".*value=.*flicker.*"
+
+mi_gdb_test "-var-create test_ptr * test_ptr" \
+ "\\^done.*"
+
+mi_gdb_test "-var-evaluate-expression test_ptr" \
+ "\\^done,value=\"map\""
+mi_gdb_test "-var-set-visualizer test_ptr None" \
+ "\\^done.*"
+# mi_gdb_test "-var-update test_ptr" ".*"
+mi_gdb_test "-var-evaluate-expression test_ptr" \
+ "\\^done,value=\"$hex.*\"" \
+ "evaluate without visualizer"