public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Cary Coutant <ccoutant@google.com>
Cc: Tom Tromey <tromey@redhat.com>,
	Project Archer <archer@sourceware.org>,
	 Dodji Seketeli <dodji@redhat.com>,
	Sterling Augustine <saugustine@google.com>
Subject: Re: Generating gdb index at link time
Date: Wed, 10 Aug 2011 20:12:00 -0000	[thread overview]
Message-ID: <CAN9gPaGC=QxGhEdgcYxt35qdBvQ-BEfUy67ioYnG7=hKoegLYQ@mail.gmail.com> (raw)
In-Reply-To: <CAHACq4qhGTg7ShS-eoMHq1oDmoBj=GC=Bx06knVq-+XTUN4ohw@mail.gmail.com>

On Fri, Aug 5, 2011 at 4:30 PM, Cary Coutant <ccoutant@google.com> 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
of history.

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
remember).

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.

-- 
Thanks,
Daniel

      parent reply	other threads:[~2011-08-10 20:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAHACq4oHymXfBOqzJfyzQXNyW5PYkN6g65X6x1rMU+YmJybZmQ@mail.gmail.com>
     [not found] ` <m3d3gkx8ar.fsf@fleche.redhat.com>
     [not found]   ` <CAHACq4ofyavZBt4y65OfYSoeW--HeEAT=sz86urLC0MXBB0hnA@mail.gmail.com>
     [not found]     ` <m3d3gjwuho.fsf@fleche.redhat.com>
     [not found]       ` <CAHACq4poC0QkGowdHkg0_Y1FRmyXTZZDeoBYrUf91nxz9SJtQw@mail.gmail.com>
2011-08-05 20:30         ` Cary Coutant
2011-08-06 11:17           ` Dodji Seketeli
2011-08-10 20:12           ` Daniel Jacobowitz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAN9gPaGC=QxGhEdgcYxt35qdBvQ-BEfUy67ioYnG7=hKoegLYQ@mail.gmail.com' \
    --to=drow@false.org \
    --cc=archer@sourceware.org \
    --cc=ccoutant@google.com \
    --cc=dodji@redhat.com \
    --cc=saugustine@google.com \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).