This is the mail archive of the
mailing list for the Archer project.
Re: Generating gdb index at link time
- From: Daniel Jacobowitz <drow at false dot org>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Tom Tromey <tromey at redhat dot com>, Project Archer <archer at sourceware dot org>, Dodji Seketeli <dodji at redhat dot com>, Sterling Augustine <saugustine at google dot com>
- Date: Wed, 10 Aug 2011 16:12:16 -0400
- Subject: Re: Generating gdb index at link time
- References: <CAHACq4oHymXfBOqzJfyzQXNyW5PYkN6g65X6x1rMU+YmJybZmQ@mail.gmail.com><firstname.lastname@example.org><CAHACq4ofyavZBt4y65OfYSoeW--HeEAT=sz86urLC0MXBB0hnA@mail.gmail.com><email@example.com><CAHACq4poC0QkGowdHkg0_Y1FRmyXTZZDeoBYrUf91nxz9SJtQw@mail.gmail.com><CAHACq4qhGTg7ShS-eoMHq1oDmoBj=GC=Bx06knVq-+XTUN4ohw@mail.gmail.com>
On Fri, Aug 5, 2011 at 4:30 PM, Cary Coutant <firstname.lastname@example.org> wrote:
>> Cary> Any comments, objections, advice, ...?
>> I think the biggest difficulty is in C++ name canonicalization.
>> My understanding (Jan and Keith are the experts here) is that DW_AT_name
>> does not always agree with the demangler; but one also cannot always
>> rely on the demangler because not all entities are given a
>> DW_linkage_name (perhaps fixed in newer GCC versions? ?Dodji would
>> know, or anyway it is in bugzilla).
>> We have a second canonicalization step (a bunch of code in
>> cp-name-parser.y) that we run on the demangled names. ?I'm not 100% sure
>> this is still necessary. ?I think this code is reasonably
>> self-contained; but maybe slow.
>> I think it is worth considering changes to the index, even radical ones,
>> if it would make your solution better. ?The index is purely an ad hoc
>> invention and should, IMO, be considered as mutable as any other piece.
You may all know most of this already, but just in case, here's a bit
The purpose of name canonicalization is to accept different spellings
of the same C++ name and be able to reliably and efficiently look up
the symbol for the canonical spelling of the name. It is still
necessary, even with GCC.
Tom is right; DW_AT_name can not be trusted. That's true across
multiple compilers, not just GCC, but GCC is a particularly egregious
offender. There are some cosmetic differences, like spacing, and some
more significant differences like whether typedefs are expanded.
It is definitely slow. I spent a long time speeding it up, but it's
still a significant chunk of startup time (a couple percent? don't
It's really important that the index use the same canonicalization as
GDB. If it doesn't, we will fail to look up symbols where there's a
difference. It would be nice to have some robust tests for this;
maybe a flag where GDB checks that all names in the index are
canonical, so we can run the testsuite that way? That makes me a
little nervous about skew between GDB and Gold.
Not all entities have a linkage name because there are entities which
don't appear in the output. Types, for instance. Plus the abstract
copy of the two constructor versions, that's a historic trouble spot.