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

James Cownie jcownie@etnus.com
Tue Jul 9 06:15:00 GMT 2002


> 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-bugs mailing list