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.
radr://5070293
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.
*** Bug 35462 has been marked as a duplicate of this bug. ***
I think this has been fixed by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146137 http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146290 http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146897 on the trunk.
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)
Fixed a while ago.