diff options
author | Tom Tromey <tom@tromey.com> | 2017-07-11 06:40:40 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-08-14 10:14:05 -0600 |
commit | d6382fffde99214ce4aee99a208ddb703c647008 (patch) | |
tree | 91590151181ced3a46bf0dc6ea123036198bea30 /gdb/testsuite/gdb.dwarf2/var-access.exp | |
parent | f978cb06dbfbd93dbd52bd39d992f8644b0c639e (diff) | |
download | gdb-d6382fffde99214ce4aee99a208ddb703c647008.zip gdb-d6382fffde99214ce4aee99a208ddb703c647008.tar.gz gdb-d6382fffde99214ce4aee99a208ddb703c647008.tar.bz2 |
Fix two regressions in scalar printing
PR gdb/21675 points out a few regressions in scalar printing.
One type of regression is due to not carrying over the old handling of
floating point printing -- where a format like "/d" causes a floating
point number to first be cast to a signed integer. This patch restores
this behavior.
The other regression is a longstanding bug in print_octal_chars: one of
the constants was wrong. This patch fixes the constant and adds static
asserts to help catch this sort of error.
ChangeLog
2017-08-14 Tom Tromey <tom@tromey.com>
PR gdb/21675
* valprint.c (LOW_ZERO): Change value to 034.
(print_octal_chars): Add static_asserts for octal constants.
* printcmd.c (print_scalar_formatted): Add 'd' case.
testsuite/ChangeLog
2017-08-14 Tom Tromey <tom@tromey.com>
PR gdb/21675:
* gdb.base/printcmds.exp (test_radices): New function.
* gdb.dwarf2/var-access.exp: Use p/u, not p/d.
* gdb.base/sizeof.exp (check_valueof): Use p/d.
* lib/gdb.exp (get_integer_valueof): Use p/d.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/var-access.exp')
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/var-access.exp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/var-access.exp b/gdb/testsuite/gdb.dwarf2/var-access.exp index 8ebad6a..9180c88 100644 --- a/gdb/testsuite/gdb.dwarf2/var-access.exp +++ b/gdb/testsuite/gdb.dwarf2/var-access.exp @@ -282,16 +282,16 @@ gdb_test_no_output "set var \$[lindex $regname 0] = 81" \ "init reg for s2.a" gdb_test_no_output "set var \$[lindex $regname 1] = 28" \ "init reg for s2.c" -gdb_test "print/d s2" " = \\{a = 81, b = 4, c = 28, d = 5\\}" \ +gdb_test "print/u s2" " = \\{a = 81, b = 4, c = 28, d = 5\\}" \ "initialized s2 from mem and regs" gdb_test_no_output "set var s2.c += s2.a + s2.b - s2.d" -gdb_test "print/d s2" " = \\{a = 81, b = 4, c = 108, d = 5\\}" \ +gdb_test "print/u s2" " = \\{a = 81, b = 4, c = 108, d = 5\\}" \ "verify s2.c" -gdb_test "print/d \$[lindex $regname 1]" " = 108" \ +gdb_test "print/u \$[lindex $regname 1]" " = 108" \ "verify s2.c through reg" gdb_test_no_output "set var s2 = {191, 73, 231, 123}" \ "re-initialize s2" -gdb_test "print/d s2" " = \\{a = 191, b = 73, c = 231, d = 123\\}" \ +gdb_test "print/u s2" " = \\{a = 191, b = 73, c = 231, d = 123\\}" \ "verify re-initialized s2" # Unaligned bitfield access through byte-aligned pieces. |