Open dwblaikie opened 11 years ago
mentioned in issue llvm/llvm-bugzilla-archive#24345
Interestingly, when trying to "ptype bar::bar" (which should print the type of the default ctor - try this with a normal named type to see the comparison) GDB prints out:
Invalid anonymous type foo [in module /home/blaikie/Development/scratch/a.out], GCC PR debug/47510 bug?
I'm not sure just how "invalid" this is - whether that is just referring to the lack of a linkage name, or some other kind of invalidity we should be aware of/fixing.
assigned to @dwblaikie
@llvm/issue-subscribers-debuginfo
Author: David Blaikie (dwblaikie)
Extended Description
The debug info for types such as:
typedef struct { foo f; } bar;
in Clang does not include the name 'bar' in any of the debug info for the anonymous struct. GCC includes the MIPS_linkage_name for the anonymous struct as '3bar' as well as emitting the DW_AT_name of the ctor and dtor as "bar" and "~bar" respectively.
The latter (emitting the name of the ctor and dtor as bar/~bar) seems to be a bug ( http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47510 ) & instead should just be emitted as the linkage name, possibly (though I don't know if that'll resolve the test case).
This was found in the GDB 7.5 test suite (gdb.cp/anon-struct.exp).