[debug-early] C++ clones and limbo DIEs
Jason Merrill
jason@redhat.com
Thu Feb 12 19:27:00 GMT 2015
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
More information about the Gcc-patches
mailing list