This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [debug-early] C++ clones and limbo DIEs
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: Richard Biener <richard dot guenther at gmail dot com>
- Cc: Jason Merrill <jason at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 12 Feb 2015 10:04:05 -0800
- Subject: Re: [debug-early] C++ clones and limbo DIEs
- Authentication-results: sourceware.org; auth=none
- References: <54B87E5B dot 1090502 at redhat dot com> <54B88149 dot 1040906 at redhat dot com> <54B94F4D dot 4040009 at redhat dot com> <54B97854 dot 7040007 at redhat dot com> <54C296B5 dot 4050506 at redhat dot com> <54C7FA41 dot 8010903 at redhat dot com> <54C92A59 dot 4070401 at redhat dot com> <54C92A80 dot 80306 at redhat dot com> <54C92FA8 dot 9040005 at redhat dot com> <54CBEB69 dot 3000401 at redhat dot com> <54CBFFE7 dot 1010003 at redhat dot com> <54CC1885 dot 5010105 at redhat dot com> <54CDC625 dot 8070902 at redhat dot com> <54CEEBD5 dot 7090608 at redhat dot com> <54CEF9FE dot 6020107 at redhat dot com> <54D2B907 dot 1040309 at redhat dot com> <54D3CE5A dot 1000609 at redhat dot com> <54D4159F dot 4090601 at redhat dot com> <54D4C95D dot 8040000 at redhat dot com> <54D4EEDC dot 1070307 at redhat dot com> <CAFiYyc2i6mF2nHpof_de-216qJwpa=wHy+n0+7v2deNMndKgJQ at mail dot gmail dot com>
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'd have expected for a TU like
void foo (int, int);
int main()
{
return 0;
}
to be able to do
(gdb) start
(gdb) ptype foo
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?
Likewise for
struct foo { int i; };
int main ()
{
return 0;
}
This is already working if compiled with
-fno-eliminate-unused-debug-types, probably by virtue of types being
called from the front-ends with debug_hooks->type_decl(). We could
certainly enable -fno-eliminate-unused-debug-{symbols,types} for -g3 if
desirable.
Thanks for doing all this work!
Thanks for volunteering to do the LTO bits ;-).
Aldy