mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 09:38:57 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user