Devang Patel wrote:
C++ does not generate debug info for anonymous aggregates in cases like :
class A
{
public:
typedef struct
{
int d;
} mystruct;
mystruct data;
};
This is because FE sets DECL_IGNORED_P bit. This causes debug info
generator to
skip debug info when invoked through rest_of_type_compilation(). The
fix I am
testing over night is to reset DECL_IGNORED_P bit when real name is
assigned
to anonymous aggregates and invoke debug_hooks again.
Is this the right approach? If yes then based on gcc and gdb dejagnu
results
I'll prepare actual patch.
Actually, I think the best fix would be just not to set DECL_IGNORED_P
in the first place, and let the debug-generators sort it out. They
should learn about anonymous unions (and anonymous structures). Real
debugging formats (e.g., DWARF 2) support that; if stabs doesn't, then
the debug generator can work around that by skipping the type if it so
pleases.
--
Mark Mitchell
CodeSourcery, LLC
[EMAIL PROTECTED]
(916) 791-8304