+2013-08-13 Andrew Burgess <aburgess@broadcom.com>
+
+ * common/format.c (parse_format_string): Don't allow '#' flag for
+ pointer arguments in format string.
+
2013-08-13 Pierre Muller <muller@sourceware.org>
* src/gdb/utils.c (init_page_info): Only call tgetnum function
this_argclass = ptr_arg;
if (lcount || seen_h || seen_big_l)
bad = 1;
- if (seen_prec || seen_zero || seen_space || seen_plus)
+ if (seen_prec)
+ bad = 1;
+ if (seen_hash || seen_zero || seen_space || seen_plus)
bad = 1;
break;
+2013-08-13 Andrew Burgess <aburgess@broadcom.com>
+
+ * gdb.base/printcmds.exp (test_printf): Add test for printf of
+ pointer with various flags.
+
2013-08-13 Tom Tromey <tromey@redhat.com>
* lib/cache.exp: New file.
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