summaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authoraburgess <aburgess>2013-07-25 10:16:07 +0000
committeraburgess <aburgess>2013-07-25 10:16:07 +0000
commit7dd06bddcb8b628be4e3c6443a7e419fd59c5a0e (patch)
tree64c03aeacd352255a75f1c399eebc4150d0b85fc /gdb/printcmd.c
parent1d9a1fa39f1efe77c9399b8c596e5b572d325bd8 (diff)
downloadgdb-7dd06bddcb8b628be4e3c6443a7e419fd59c5a0e.tar.gz
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.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 99d4dba3e5c..1cc248d70f6 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\