public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39285]  New: Missing debug info for enum members in C++
@ 2009-02-24  8:12 ppluzhnikov at google dot com
  2009-02-24  8:38 ` [Bug c++/39285] [4.4 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ppluzhnikov at google dot com @ 2009-02-24  8:12 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-24 14:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-24  8:12 [Bug c++/39285] New: Missing debug info for enum members in C++ ppluzhnikov at google dot com
2009-02-24  8:38 ` [Bug c++/39285] [4.4 Regression] " pinskia at gcc dot gnu dot org
2009-02-24 13:27 ` rguenth at gcc dot gnu dot org
2009-02-24 13:30 ` rguenth at gcc dot gnu dot org
2009-02-24 14:48 ` [Bug debug/39285] " rguenth at gcc dot gnu dot org
2009-02-24 14:48 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).