aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-prettyprint.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python/py-prettyprint.exp')
-rw-r--r--gdb/testsuite/gdb.python/py-prettyprint.exp15
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp
index 3359082..82e7e65 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.exp
+++ b/gdb/testsuite/gdb.python/py-prettyprint.exp
@@ -109,7 +109,12 @@ proc run_lang_tests {exefile lang} {
gdb_test_no_output "set python print-stack full"
gdb_test "print hint_error" "Exception: hint failed\r\nhint_error_val"
- gdb_test "print c" " = container \"container\" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}"
+ gdb_test "print c" " = container \"container\" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}" \
+ "print c, pretty printing on, default display hint"
+
+ gdb_test_no_output "set variable c.is_map_p=1"
+ gdb_test "print c" " = container \"container\" with 2 elements = \{$nl \\\[23\\\] = 72$nl\}" \
+ "print c, pretty printing on, display hint is now map"
gdb_test "print nstype" " = {$nl *.0. = 7,$nl *.1. = 42$nl}"
@@ -117,6 +122,14 @@ proc run_lang_tests {exefile lang} {
gdb_test "print nstype" " = {.0. = 7, .1. = 42}" \
"print nstype on one line"
+ # Now we have pretty printing turned off, try printing 'c' again.
+ gdb_test "print c" " = container \"container\" with 2 elements = \{\\\[23\\\] = 72\}" \
+ "print c, pretty printing off, display hint is now map"
+
+ gdb_test_no_output "set variable c.is_map_p=0"
+ gdb_test "print c" " = container \"container\" with 2 elements = \{\\\[0\\\] = 23, \\\[1\\\] = 72\}" \
+ "print c, pretty printing off, default display hint"
+
# Check that GDB doesn't lose typedefs when looking for a printer.
gdb_test "print an_int" " = -1"
gdb_test "print (int) an_int" " = -1"