aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/printcmds.exp
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2013-08-13 16:05:23 +0000
committerAndrew Burgess <aburgess@broadcom.com>2013-08-13 16:05:23 +0000
commit5c30d39a69a4da5d011db4d52c15042561d53ce0 (patch)
tree63ff0114293b6e4f63159949effead1378668d0e /gdb/testsuite/gdb.base/printcmds.exp
parent17e1c970ef41149e5eb6b5f908301e6a86a7f528 (diff)
downloadgdb-5c30d39a69a4da5d011db4d52c15042561d53ce0.zip
gdb-5c30d39a69a4da5d011db4d52c15042561d53ce0.tar.gz
gdb-5c30d39a69a4da5d011db4d52c15042561d53ce0.tar.bz2
Handle '#' flag for printf of pointer types.
http://sourceware.org/ml/gdb-patches/2013-08/msg00340.html gdb/ChangeLog * common/format.c (parse_format_string): Don't allow '#' flag for pointer arguments in format string. gdb/testsuite/ChangeLog * gdb.base/printcmds.exp (test_printf): Add test for printf of pointer with various flags.
Diffstat (limited to 'gdb/testsuite/gdb.base/printcmds.exp')
-rw-r--r--gdb/testsuite/gdb.base/printcmds.exp6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 4f88382..60e4a7f 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -734,6 +734,12 @@ proc test_printf {} {
gdb_test "printf \"%.234\", 0" "Incomplete format specifier at end of format string"
gdb_test "printf \"%-\", 0" "Incomplete format specifier at end of format string"
gdb_test "printf \"%-23\", 0" "Incomplete format specifier at end of format string"
+
+ # Test for invalid printf flags on pointer types.
+ gdb_test "printf \"%#p\", 0" "Inappropriate modifiers to format specifier 'p' in printf"
+ gdb_test "printf \"% p\", 0" "Inappropriate modifiers to format specifier 'p' in printf"
+ gdb_test "printf \"%0p\", 0" "Inappropriate modifiers to format specifier 'p' in printf"
+ gdb_test "printf \"%+p\", 0" "Inappropriate modifiers to format specifier 'p' in printf"
}
#Test printing DFP values with printf