public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/29105] new DWARF reader still slow
Date: Thu, 01 Dec 2022 18:18:53 +0000	[thread overview]
Message-ID: <bug-29105-4717-jr3P220lCp@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29105-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29105

--- Comment #27 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=55fc1623f942fba10362cb199f9356d75ca5835b

commit 55fc1623f942fba10362cb199f9356d75ca5835b
Author: Tom Tromey <tromey@adacore.com>
Date:   Thu Nov 3 13:49:17 2022 -0600

    Add name canonicalization for C

    PR symtab/29105 shows a number of situations where symbol lookup can
    result in the expansion of too many CUs.

    What happens is that lookup_signed_typename will try to look up a type
    like "signed int".  In cooked_index_functions::expand_symtabs_matching,
    when looping over languages, the C++ case will canonicalize this type
    name to be "int" instead.  Then this method will proceed to expand
    every CU that has an entry for "int" -- i.e., nearly all of them.  A
    crucial component of this is that the caller, objfile::lookup_symbol,
    does not do this canonicalization, so when it tries to find the symbol
    for "signed int", it fails -- causing the loop to continue.

    This patch fixes the problem by introducing name canonicalization for
    C.  The idea here is that, by making C and C++ agree on the canonical
    name when a symbol name can have multiple spellings, we avoid the bad
    behavior in objfile::lookup_symbol (and any other such code -- I don't
    know if there is any).

    Unlike C++, C only has a few situations where canonicalization is
    needed.  And, in particular, due to the lack of overloading (thus
    avoiding any issues in linespec) and due to the way c-exp.y works, I
    think that no canonicalization is needed during symbol lookup -- only
    during symtab construction.  This explains why lookup_name_info is not
    touched.

    The stabs reader is modified on a "best effort" basis.

    The DWARF reader needed one small tweak in dwarf2_name to avoid a
    regression in dw2-unusual-field-names.exp.  I think this is adequately
    explained by the comment, but basically this is a scenario that should
    not occur in real code, only the gdb test suite.

    lookup_signed_typename is simplified.  It used to search for two
    different type names, but now gdb can search just for the canonical
    form.

    gdb.dwarf2/enum-type.exp needed a small tweak, because the
    canonicalizer turns "unsigned integer" into "unsigned int integer".
    It seems better here to use the correct C type name.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29105
    Tested-by: Simon Marchi <simark@simark.ca>
    Reviewed-by: Andrew Burgess <aburgess@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2022-12-01 18:18 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 19:51 [Bug symtab/29105] New: " tromey at sourceware dot org
2022-04-29 20:09 ` [Bug symtab/29105] " tromey at sourceware dot org
2022-05-13 20:56 ` tromey at sourceware dot org
2022-05-13 21:01 ` tromey at sourceware dot org
2022-05-16 18:51 ` tromey at sourceware dot org
2022-05-18 16:12 ` simon.marchi at polymtl dot ca
2022-05-20  1:54 ` simark at simark dot ca
2022-05-20 15:13 ` tromey at sourceware dot org
2022-05-20 15:36 ` simon.marchi at polymtl dot ca
2022-05-20 15:48 ` simon.marchi at polymtl dot ca
2022-05-26 13:49 ` cvs-commit at gcc dot gnu.org
2022-05-26 13:50 ` tromey at sourceware dot org
2022-07-13 16:49 ` tromey at sourceware dot org
2022-09-23 20:23 ` tromey at sourceware dot org
2022-09-23 20:44 ` tromey at sourceware dot org
2022-10-02  0:19 ` brobecker at gnat dot com
2022-10-06 20:44 ` tromey at sourceware dot org
2022-10-24 19:27 ` simon.marchi at polymtl dot ca
2022-11-01 20:42 ` tromey at sourceware dot org
2022-11-04 20:05 ` tromey at sourceware dot org
2022-11-04 20:10 ` simon.marchi at polymtl dot ca
2022-11-04 21:27 ` tromey at sourceware dot org
2022-11-04 21:28 ` tromey at sourceware dot org
2022-11-04 21:28 ` tromey at sourceware dot org
2022-11-05  1:28 ` simark at simark dot ca
2022-11-07 16:28 ` tromey at sourceware dot org
2022-11-16  0:09 ` tkacvins at gmail dot com
2022-11-16  0:56 ` simark at simark dot ca
2022-11-16 15:07 ` tkacvins at gmail dot com
2022-12-01 16:44 ` cvs-commit at gcc dot gnu.org
2022-12-01 18:18 ` cvs-commit at gcc dot gnu.org [this message]
2022-12-01 18:22 ` tromey at sourceware dot org
2022-12-14 10:23 ` cvs-commit at gcc dot gnu.org

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=bug-29105-4717-jr3P220lCp@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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).