diff options
author | Tom Tromey <tom@tromey.com> | 2018-02-14 11:12:17 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-03-14 09:44:33 -0600 |
commit | b8c2339b2f46d4885b933b832fc5b37c7ca101a6 (patch) | |
tree | 58f253f8bc6c9571867c638dd71daff548ea5436 /gdb/testsuite/gdb.base/printcmds.exp | |
parent | 80ae639d3cc4f1e83f1ad48686f87417c06ca6dc (diff) | |
download | gdb-b8c2339b2f46d4885b933b832fc5b37c7ca101a6.zip gdb-b8c2339b2f46d4885b933b832fc5b37c7ca101a6.tar.gz gdb-b8c2339b2f46d4885b933b832fc5b37c7ca101a6.tar.bz2 |
Allow - in %p for printf
PR cli/19918 points out that a printf format like "%-5p" will cause a
gdb crash. The bug is problem is that printf_pointer doesn't take the
"-" flag into account.
gdb/ChangeLog
2018-03-14 Tom Tromey <tom@tromey.com>
PR cli/19918:
* printcmd.c (printf_pointer): Allow "-" in format.
gdb/testsuite/ChangeLog
2018-03-14 Tom Tromey <tom@tromey.com>
PR cli/19918:
* gdb.base/printcmds.exp (test_printf): Add printf test using '-'
flag.
Diffstat (limited to 'gdb/testsuite/gdb.base/printcmds.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/printcmds.exp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp index 9402d97..56cedb9 100644 --- a/gdb/testsuite/gdb.base/printcmds.exp +++ b/gdb/testsuite/gdb.base/printcmds.exp @@ -776,6 +776,10 @@ proc test_printf {} { "" \ "create hibob command" gdb_test "hibob" "hi bob zzz.*y" "run hibob command" + + # PR cli/19918. + gdb_test "printf \"%-16dq\\n\", 0" "0 q" + gdb_test "printf \"%-16pq\\n\", 0" "\\(nil\\) q" } #Test printing DFP values with printf |