diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-07-25 10:16:08 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@broadcom.com> | 2013-07-25 10:16:08 +0000 |
commit | 6fbe845e0c00ca40e98aa23401e0b5490717a646 (patch) | |
tree | 6e6cd06893ba6d7525ea00f4922fdc741dc7af62 /gdb/printcmd.c | |
parent | db6a5d5f908a3139924421da1d80d8edf479646c (diff) | |
download | gdb-6fbe845e0c00ca40e98aa23401e0b5490717a646.zip gdb-6fbe845e0c00ca40e98aa23401e0b5490717a646.tar.gz gdb-6fbe845e0c00ca40e98aa23401e0b5490717a646.tar.bz2 |
Add new 'z' format for print command.
http://sourceware.org/ml/gdb-patches/2013-07/msg00235.html
gdb/ChangeLog
* NEWS: Mention new 'z' formatter.
* printcmd.c (print_scalar_formatted): Add new 'z' formatter.
(_initialize_printcmd): Mention 'z' formatter in help text of the
'x' command.
gdb/doc/ChangeLog
* gdb.texinfo (Output Formats): Mention the new 'z' formatter.
gdb/testsuite/ChangeLog
* gdb.base/printcmds.exp (test_print_int_arrays): Add tests for x,
z, o, and t output formats.
* gdb.base/display.exp: Use 'k' as an undefined format now that
'z' is defined.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 99d4dba..1cc248d7 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -533,6 +533,10 @@ print_scalar_formatted (const void *valaddr, struct type *type, } break; + case 'z': + print_hex_chars (stream, valaddr, len, byte_order); + break; + default: error (_("Undefined output format \"%c\"."), options->format); } @@ -2496,7 +2500,8 @@ Examine memory: x/FMT ADDRESS.\n\ ADDRESS is an expression for the memory address to examine.\n\ FMT is a repeat count followed by a format letter and a size letter.\n\ Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),\n\ - t(binary), f(float), a(address), i(instruction), c(char) and s(string).\n\ + t(binary), f(float), a(address), i(instruction), c(char), s(string)\n\ + and z(hex, zero padded on the left).\n\ Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).\n\ The specified number of objects of the specified size are printed\n\ according to the format.\n\n\ |