From: Joel Brobecker Date: Tue, 18 Jan 2011 16:38:59 +0000 (+0000) Subject: fix printing of Ada wide characters on ppc-aix X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10d44370412c8e79458800f13004173f1d30c74e;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 10ab67329fb..1a99d78f024 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2011-01-18 Joel Brobecker + + * ada-valprint.c (ada_print_scalar): Remove unsigned char downcast. + (ada_val_print_1): Likewise. + 2011-01-18 Joel Brobecker * rs6000-tdep.c (rs6000_skip_prologue): Make sure that the prologue diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index ee3761725fb..c08daeb4538 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;