GCC @144404 does not generate DW_AT_const_value for enum members in C++ mode (in C everything appears fine). This is a regression from 4.3.1.
Test case: enum E { red = 1, green = 42 }; int main() { E e = red; return e; } When above is compiled with gcc-4.3.1, readelf -w shows: <2><2f>: Abbrev Number: 3 (DW_TAG_enumerator) <30> DW_AT_name : red <34> DW_AT_const_value : 1 <2><35>: Abbrev Number: 4 (DW_TAG_enumerator) <36> DW_AT_name : (indirect string, offset: 0x8): green <3a> DW_AT_const_value : 42 <1><3c>: Abbrev Number: 5 (DW_TAG_subprogram) ... When compiled with gcc-4.4.0: <2><2f>: Abbrev Number: 3 (DW_TAG_enumerator) <30> DW_AT_name : red <2><34>: Abbrev Number: 4 (DW_TAG_enumerator) <35> DW_AT_name : (indirect string, offset: 0x8): green <1><3a>: Abbrev Number: 5 (DW_TAG_subprogram) ... AFAICT, this is causing the following GDB tests to fail: FAIL: gdb.cp/classes.exp: print obj_with_enum (2) FAIL: gdb.cp/classes.exp: print obj_with_enum.priv_enum FAIL: gdb.cp/classes.exp: ptype obj_with_enum.priv_enum FAIL: gdb.cp/classes.exp: print ('ClassWithEnum::PrivEnum') 42 FAIL: gdb.cp/m-data.exp: simple object, enum FAIL: gdb.cp/m-data.exp: derived template object, derived enum FAIL: gdb.cp/m-data.exp: template object, derived enum FAIL: gdb.cp/m-static.exp: derived template object, static enum FAIL: gdb.cp/m-static.exp: template object, static derived enum -- Summary: Missing debug info for enum members in C++ Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ppluzhnikov at google dot com GCC build triplet: i686-host_pc-linux-gnu GCC host triplet: i686-host_pc-linux-gnu GCC target triplet: i686-host_pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39285