debug/7241: DWARF encoding for "char" incorrect in gcc

James Cownie jcownie@etnus.com
Tue Jul 9 04:16:00 GMT 2002


The following reply was made to PR debug/7241; it has been noted by GNATS.

From: James Cownie <jcownie@etnus.com>
To: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Subject: Re: debug/7241: DWARF encoding for "char" incorrect in gcc 
Date: Tue, 09 Jul 2002 12:12:20 +0100

 > Hmm, I would rather think g++ is the wrong one here. IIRC in C++ (C
 > too?)  "char"/"signed char"/"unsigned char" are actually 3 distinct
 > types and thus encoding 6 should have only be used if you would have
 > explicitly written "signed char" in your example, or?
 
 My point is not the issue of signedness, but that of "character"-ness.
 
 Gcc is emitting this as if it were int8_t (a single byte integer), and
 is not telling the debugger that the type should be displayed as
 holding a character.
 
 DWARF only has encodings for explicitly signed or explicitly unsigned
 objects. The fact that C has three different char types ("char",
 "signed char" and "unsigned char") is not expressible in DWARF, where
 the debugger needs to know what the underlying representation really
 is. Therefore in DWARF I would always expect that the C "char" type
 should be represented as either DW_ATE_signed_char or
 DW_ATE_unsigned_char, as appropriate.
 
 "char" should _not_ be represented as DW_ATE_signed or DW_ATE_unsigned,
 since those are _integer_ types, and the debugger will not attempt to
 display them as characters.
 
 -- Jim 
 
 James Cownie	<jcownie@etnus.com>
 Etnus, LLC.     +44 117 9071438
 http://www.etnus.com



More information about the Gcc-prs mailing list