This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
src/gdb ChangeLog ada-valprint.c c-valprint.c
- From: brobecke at sourceware dot org
- To: gdb-cvs at sourceware dot org
- Date: 14 Jan 2011 20:18:21 -0000
- Subject: src/gdb ChangeLog ada-valprint.c c-valprint.c
CVSROOT: /cvs/src
Module name: src
Branch: gdb_7_2-branch
Changes by: brobecke@sourceware.org 2011-01-14 20:18:21
Modified files:
gdb : ChangeLog ada-valprint.c c-valprint.c
Log message:
Fix printing of Wide_Character & Wide_Wide_Character entities.
Wide_Characters and Wide_Wide_Characters are incorrectly printed.
Consider for instance:
Medium : Wide_Character := Wide_Character'Val(16#dead#);
Trying to print the value of this variable yields:
(gdb) p medium
$1 = 57005 '["ad"]'
The integer value is correct (57005 = 0xdead), but the character
representation is not, it should be:
$1 = 57005 '["dead"]'
Same for Wide_Wide_Characters.
There were two issues:
(a) The first issue was in ada-valprint, where we were assuming
that character types were 1 byte long;
(b) The second problem was in c-valprint, where we were down-casting
the integer value of the character to type `unsigned char',
causing use to lose all but the lowest byte.
gdb/ChangeLog:
* ada-valprint. (ada_printchar): Use the correct type length
in call to ada_emit_char.
* c-valprint.c (c_val_print): Remove cast in call to LA_PRINT_CHAR.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.11973.2.65&r2=1.11973.2.66
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ada-valprint.c.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.66.2.1&r2=1.66.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/c-valprint.c.diff?cvsroot=src&only_with_tag=gdb_7_2-branch&r1=1.71.2.1&r2=1.71.2.2