summaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2004-02-27 00:01:14 +0000
committerJeff Johnston <jjohnstn@redhat.com>2004-02-27 00:01:14 +0000
commitb0d41ce2d23b171c7030f8e671ae69f210a34624 (patch)
tree74e769dc5709151e2f82db302606b7a6ab492f63 /gdb/printcmd.c
parent730902294267ef579c8a181af97ccf9379115ed8 (diff)
downloadgdb-b0d41ce2d23b171c7030f8e671ae69f210a34624.tar.gz
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.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index a93ddbf8dd8..9734ec12ed6 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);