aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2011-01-18 17:03:57 +0000
committerJoel Brobecker <brobecker@gnat.com>2011-01-18 17:03:57 +0000
commitf9be282007d4aba65e23d13eef5bec2e44834b88 (patch)
tree1d424b0db6b95d6bd1f048399c306f159d1ab3e1
parent8a25bc6eb2bc532f96811d4070d6788e114507b9 (diff)
downloadgdb-f9be282007d4aba65e23d13eef5bec2e44834b88.zip
gdb-f9be282007d4aba65e23d13eef5bec2e44834b88.tar.gz
gdb-f9be282007d4aba65e23d13eef5bec2e44834b88.tar.bz2
fix printing of Ada wide characters on ppc-aix
Same problem as before: We were downcasting the character value from int to unsigned char, which caused an overflow. The reason why we did not see this problem before is probably related to the fact that we're using stabs on AIX and thus characters types are defined as a TYPE_CODE_INT (or TYPE_CODE_RANGE?). gdb/ChangeLog: * ada-valprint.c (ada_print_scalar): Remove unsigned char downcast. (ada_val_print_1): Likewise.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/ada-valprint.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4edda80..41c076b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-18 Joel Brobecker <brobecker@adacore.com>
+
+ * ada-valprint.c (ada_print_scalar): Remove unsigned char downcast.
+ (ada_val_print_1): Likewise.
+
2011-01-14 Joel Brobecker <brobecker@adacore.com>
* ada-valprint. (ada_printchar): Use the correct type length
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index c9a8c94..cc74a33 100644
--- a/gdb/ada-valprint.c
+++ b/gdb/ada-valprint.c
@@ -417,7 +417,7 @@ ada_print_scalar (struct type *type, LONGEST val, struct ui_file *stream)
break;
case TYPE_CODE_CHAR:
- LA_PRINT_CHAR ((unsigned char) val, type, stream);
+ LA_PRINT_CHAR (val, type, stream);
break;
case TYPE_CODE_BOOL:
@@ -795,8 +795,7 @@ ada_val_print_1 (struct type *type, const gdb_byte *valaddr0,
if (ada_is_character_type (type))
{
fputs_filtered (" ", stream);
- ada_printchar ((unsigned char) unpack_long (type, valaddr),
- type, stream);
+ ada_printchar (unpack_long (type, valaddr), type, stream);
}
}
return 0;