This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C++ RFC] Debug info for anonymous aggregates

On Jul 23, 2005, at 8:44 PM, Mark Mitchell wrote:

Devang Patel wrote:

C++ does not generate debug info for anonymous aggregates in cases like :
class A
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.

OK. Here is the patch.

I did following to test this patch:

1) Bootstrap FSF GCC mainline
2) Run GCC dejaGNU tests. No new failures.

3) Bootstrap Apple branch based on GCC-4.0.1
4) Run GCC dejaGNU tests. No new failures.
5) Run GDB dejaGNU tests, twice (with and without -fno-eliminate- unused-debug-symbols). No new failures.

6) Verified that above test case works on darwin.

     * name-lookup.c (pushtag): Do not set DECL_IGNORED_P bit.
OK ?

Attachment: anon_typedef_struct_debug.diff
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]