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.
This commit is contained in:
Jeff Johnston
2004-02-27 00:01:14 +00:00
parent e99183ebed
commit 6b9acc27a9
4 changed files with 77 additions and 4 deletions

View File

@@ -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);