This is the mail archive of the gcc-patches@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: [debug-early] C++ clones and limbo DIEs


On 02/12/2015 01:04 PM, Aldy Hernandez wrote:
On 02/10/2015 02:52 AM, Richard Biener wrote:
On Fri, Feb 6, 2015 at 5:42 PM, Aldy Hernandez <aldyh@redhat.com> wrote:

Of course I wonder why you need to separate handling of functions and
variables

The variables need to be handled earlier, else the call to
analyze_functions() will remove some optimized global variables away,
and we'll never see them.  I believe that Jason said they were needed
up-thread.

variables.  What breaks if you emit debug info for functions before
the first analyze_functions () call?
 >
 > I also wonder why you restrict it to functions with a GIMPLE body.

The functions, on the other hand, need to be handled after the second
call to analyze_function (and with a GIMPLE body) else we get far more
function DIEs than mainline currently does, especially wrt C++ clones.
Otherwise, we get DIEs for base constructors, complete constructors, and
what-have-yous.  Jason wanted less DIEs, more attune to what mainline is
currently doing.

I think it makes sense to generate DIEs for everything defined in the TU if we don't have -feliminate-unused-debug-symbols. But since clones are artificial, emit them only if they're used.

void foo (int, int);
and get a prototype for foo?  (ok, that may be -g3 stuff)

This may need frontend support.  I don't think we get any of these
prototype symbols in cgraphunit, at least not in the symbol table
(FOR_EACH_SYMBOL).  Perhaps a call from the front-ends, similar to what
we do with types with debug_hooks->type_decl().  But... do really want
that?  Is there a practical use?

We haven't done that, historically. But it would be useful for ABI verification by, comparing the debug info for the declarations to the debug info for the definition in the shared library.

Jason


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