aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-valprint.c')
-rw-r--r--gdb/c-valprint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index f791e4c..f888262 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -403,10 +403,13 @@ c_val_print (type, valaddr, embedded_offset, address, stream, format, deref_ref,
}
else
{
- fprintf_filtered (stream, TYPE_UNSIGNED (type) ? "%u" : "%d",
- unpack_long (type, valaddr + embedded_offset));
+ val = unpack_long (type, valaddr + embedded_offset);
+ if (TYPE_UNSIGNED (type))
+ fprintf_filtered (stream, "%u", (unsigned int) val);
+ else
+ fprintf_filtered (stream, "%d", (int) val);
fputs_filtered (" ", stream);
- LA_PRINT_CHAR ((unsigned char) unpack_long (type, valaddr + embedded_offset), stream);
+ LA_PRINT_CHAR ((unsigned char) val, stream);
}
break;