aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-03-13 17:39:52 -0600
committerTom Tromey <tom@tromey.com>2020-03-13 18:03:39 -0600
commita1f6a07c3d1d3a34d36d4e49f0fd3c66554e41b2 (patch)
tree0903e61b62d8cfc09a77c4198f21672fa577d2d2 /gdb/testsuite
parent410cf315014145f169c146442e9c28163d9ae10a (diff)
downloadgdb-a1f6a07c3d1d3a34d36d4e49f0fd3c66554e41b2.zip
gdb-a1f6a07c3d1d3a34d36d4e49f0fd3c66554e41b2.tar.gz
gdb-a1f6a07c3d1d3a34d36d4e49f0fd3c66554e41b2.tar.bz2
Use common_val_print in c-valprint.c
This changes c_value_print to call common_val_print. This is more complicated than the usual sort of common_val_print change, due to the handling of RTTI. gdb/ChangeLog 2020-03-13 Tom Tromey <tom@tromey.com> * c-valprint.c (c_value_print): Use common_val_print. gdb/testsuite/ChangeLog 2020-03-13 Tom Tromey <tom@tromey.com> * gdb.base/printcmds.exp (test_print_strings): Add regression test. * gdb.base/printcmds.c (charptr): New typedef. (teststring2): New global.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.base/printcmds.c3
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp3
3 files changed, 13 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 500aa51..ec22de8 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2020-03-13 Tom Tromey <tom@tromey.com>
+
+ * gdb.base/printcmds.exp (test_print_strings): Add regression
+ test.
+ * gdb.base/printcmds.c (charptr): New typedef.
+ (teststring2): New global.
+
2020-03-13 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.base/break-interp.exp: Use the tail of the filename, not the
diff --git a/gdb/testsuite/gdb.base/printcmds.c b/gdb/testsuite/gdb.base/printcmds.c
index ed1e26b..04b766f 100644
--- a/gdb/testsuite/gdb.base/printcmds.c
+++ b/gdb/testsuite/gdb.base/printcmds.c
@@ -72,6 +72,9 @@ int int4dim[1][2][3][2] = {{{{0,1},{2,3},{4,5}},{{6,7},{8,9},{10,11}}}};
char *teststring = (char*)"teststring contents";
+typedef char *charptr;
+charptr teststring2 = "more contents";
+
/* Test printing of a struct containing character arrays. */
struct some_arrays {
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index c87a151..2c8baad 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -519,6 +519,9 @@ proc test_print_strings {} {
gdb_test "p teststring" \
" = (.unsigned char .. )?\"teststring contents\"" "p teststring with elements set to 20"
+ gdb_test "print teststring2" \
+ " = (charptr) \"more contents\""
+
gdb_test_no_output "set print elements 8"
# Set the target-charset to ASCII, because the output varies from