diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2004-02-27 00:01:14 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2004-02-27 00:01:14 +0000 |
commit | 6b9acc27a9f99a131b016e25b8e52481959b9321 (patch) | |
tree | d2bc05fd7c20069ccf878fb9948552bc53caaa0b /gdb/printcmd.c | |
parent | e99183ebedfba97f6361ae194093b96df5a573a7 (diff) | |
download | gdb-6b9acc27a9f99a131b016e25b8e52481959b9321.zip gdb-6b9acc27a9f99a131b016e25b8e52481959b9321.tar.gz gdb-6b9acc27a9f99a131b016e25b8e52481959b9321.tar.bz2 |
2004-02-26 Jeff Johnston <jjohnstn@redhat.com>
* valprint.h (print_hex_chars, print_char_chars): New prototypes.
* valprint.c (print_hex_chars): Change from static to external.
(print_char_chars): New function.
* printcmd.c (print_scalar_formatted): For integer and enum types
that are longer than LONGEST, perform processing via appropriate
print_*_chars routines.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r-- | gdb/printcmd.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c index a93ddbf..9734ec1 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -350,6 +350,33 @@ print_scalar_formatted (void *valaddr, struct type *type, int format, int size, LONGEST val_long = 0; unsigned int len = TYPE_LENGTH (type); + if (len > sizeof(LONGEST) && + (TYPE_CODE (type) == TYPE_CODE_INT + || TYPE_CODE (type) == TYPE_CODE_ENUM)) + { + switch (format) + { + case 'o': + print_octal_chars (stream, valaddr, len); + return; + case 'u': + case 'd': + print_decimal_chars (stream, valaddr, len); + return; + case 't': + print_binary_chars (stream, valaddr, len); + return; + case 'x': + print_hex_chars (stream, valaddr, len); + return; + case 'c': + print_char_chars (stream, valaddr, len); + return; + default: + break; + }; + } + if (format != 'f') val_long = unpack_long (type, valaddr); |