diff options
author | Tom Tromey <tom@tromey.com> | 2017-05-22 03:55:58 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2017-06-12 15:04:56 -0600 |
commit | 30a254669b16b86166fed1f9a4c4f9cc55a07fdc (patch) | |
tree | aea05de61cdb0d22c97c6ae0487f992802a1feb3 /gdb/printcmd.c | |
parent | b3464d0316235899d9facf81896d7a427d5cd6d0 (diff) | |
download | gdb-30a254669b16b86166fed1f9a4c4f9cc55a07fdc.zip gdb-30a254669b16b86166fed1f9a4c4f9cc55a07fdc.tar.gz gdb-30a254669b16b86166fed1f9a4c4f9cc55a07fdc.tar.bz2 |
Don't always zero pad in print_*_chars
This changes print_octal_chars and print_decimal_chars to never zero
pad, and changes print_binary_chars and print_hex_chars to only
optionally zero-pad, based on a flag.
ChangeLog
2017-06-12 Tom Tromey <tom@tromey.com>
PR exp/16225:
* valprint.h (print_binary_chars, print_hex_chars): Update.
* valprint.c (val_print_type_code_int): Update.
(print_binary_chars): Add "zero_pad" argument.
(emit_octal_digit): New function.
(print_octal_chars): Don't zero-pad.
(print_decimal_chars): Likewise.
(print_hex_chars): Add "zero_pad" argument.
* sh64-tdep.c (sh64_do_fp_register): Update.
* regcache.c (regcache::dump): Update.
* printcmd.c (print_scalar_formatted): Update.
* infcmd.c (default_print_one_register_info): Update.
2017-06-12 Tom Tromey <tom@tromey.com>
PR exp/16225:
* gdb.reverse/i386-sse-reverse.exp: Update tests.
* gdb.arch/vsx-regs.exp: Update tests.
* gdb.arch/s390-vregs.exp (hex128): New proc.
Update test.
* gdb.arch/altivec-regs.exp: Update tests.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 02d6e1c..66395d5 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -377,10 +377,13 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, print_decimal_chars (stream, valaddr, len, byte_order); return; case 't': - print_binary_chars (stream, valaddr, len, byte_order); + print_binary_chars (stream, valaddr, len, byte_order, size > 0); return; case 'x': - print_hex_chars (stream, valaddr, len, byte_order); + print_hex_chars (stream, valaddr, len, byte_order, size > 0); + return; + case 'z': + print_hex_chars (stream, valaddr, len, byte_order, true); return; case 'c': print_char_chars (stream, type, valaddr, len, byte_order); @@ -439,10 +442,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, break; case 'o': - if (val_long) - print_longest (stream, 'o', 1, val_long); - else - fprintf_filtered (stream, "0"); + print_longest (stream, 'o', 1, val_long); break; case 'a': @@ -524,7 +524,7 @@ print_scalar_formatted (const gdb_byte *valaddr, struct type *type, break; case 'z': - print_hex_chars (stream, valaddr, len, byte_order); + print_hex_chars (stream, valaddr, len, byte_order, true); break; default: |