This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/Ada] fix printing of Ada wide characters on ppc-aix
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>
- Date: Tue, 18 Jan 2011 12:06:59 -0500
- Subject: [commit/Ada] 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.
Tested on ppc-aix and x86_64-linux. Checked in HEAD and branch
(I applied it to the branch because the the other patches were
applied to the branch as well).
---
gdb/ChangeLog | 5 +++++
gdb/ada-valprint.c | 5 ++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 10ab673..1a99d78 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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-18 Joel Brobecker <brobecker@adacore.com>
+
* rs6000-tdep.c (rs6000_skip_prologue): Make sure that the prologue
upper limit address is not greater than the function end address
when the upper limit could not be computed using the debugging
diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c
index ee37617..c08daeb 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:
@@ -801,8 +801,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;
--
1.7.1