Given this line: enum e {I, J=(unsigned)0xffffffff} e = J; Compiled with -gdwarf-2, we get: <2><2f>: Abbrev Number: 3 (DW_TAG_enumerator) DW_AT_name : I DW_AT_const_value : 0 <2><33>: Abbrev Number: 4 (DW_TAG_enumerator) DW_AT_name : J There is no DW_AT_const_value for J, so GDB can not figure out the value of J.
I can confirm this on 3.2.3, 3.3.1 (20030616) and the mainline (20030705), but on 3.0.4, I get: <2><61>: Abbrev Number: 4 (DW_TAG_enumerator) DW_AT_name : J DW_AT_const_value : -1 So this is a regression wrt 3.0.4.
Subject: Bug 11279 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-07-20 07:22:59 Modified files: gcc : ChangeLog dwarf2out.c Log message: PR debug/11279 * dwarf2out.c (gen_enumeration_type_die): Remember that enumerators can be unsigned. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.16114.2.675&r2=1.16114.2.676 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.390.2.7&r2=1.390.2.8
Subject: Bug 11279 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-07-20 07:24:58 Modified files: gcc : ChangeLog dwarf2out.c Log message: PR debug/11279 * dwarf2out.c (gen_enumeration_type_die): Remember that enumerators can be unsigned. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.573&r2=2.574 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/dwarf2out.c.diff?cvsroot=gcc&r1=1.443&r2=1.444
Fixed in GCC 3.3.1 and GCC 3.4.