Bug 35463 - [4.4 only] typedef missing in debug information with -gdwarf-2 for c++
Summary: [4.4 only] typedef missing in debug information with -gdwarf-2 for c++
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: 4.5.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 35462 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-03-04 20:11 UTC by Mike Stump
Modified: 2014-06-25 19:08 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.0
Known to fail: 4.4.0
Last reconfirmed: 2009-06-15 18:21:49


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Stump 2008-03-04 20:11:09 UTC
typedef struct {
  int x;
} mystruct;
mystruct m;

is missing any debug information for mystruct.  If one compiles as C, mystruct is present.

Still broken in 20080308 compiler.  Should be target independent.
Comment 1 Mike Stump 2008-03-04 20:15:00 UTC
radr://5070293
Comment 2 Hiroto Shibuya 2008-09-26 20:48:44 UTC
I verified this to be the case since 4.1.0.  The last version this was working was 4.0.4. 

Also this is specific to anonymous struct.  If the struct is named, it works fine.  

This is sever issue for us when we moved from RHEL4 (gcc 3.4.6) to RHEL5 (gcc 4.1.2) that most of our gdb scripts stopped working which were heavily relying on using typedef names of anonymous structs.

Comment 3 Jakub Jelinek 2009-04-30 12:46:25 UTC
*** Bug 35462 has been marked as a duplicate of this bug. ***
Comment 5 Jan Kratochvil 2009-04-30 15:15:43 UTC
Just that I agree this Bug looks to me fixed in g++-4.5.

The sample code like what is Comment 0 here from:
http://gcc.gnu.org/ml/gcc-help/2009-04/msg00393.html

gives DW_TAG_structure_type DW_AT_name "<anonymous struct>" on:
g++ (GCC) 4.4.0 20090427 (Red Hat 4.4.0-3)

and gives DW_TAG_structure_type DW_AT_name "type27" on:
g++ (GCC) 4.5.0 20090430 (experimental)
Comment 6 Tom Tromey 2014-06-25 19:08:50 UTC
Fixed a while ago.