This is the mail archive of the gcc@gcc.gnu.org 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


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
mark@codesourcery.com
(916) 791-8304


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