public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simon.marchi at polymtl dot ca" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/29105] new DWARF reader still slow
Date: Fri, 20 May 2022 15:36:44 +0000	[thread overview]
Message-ID: <bug-29105-4717-oqLJ0UVKyF@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 #7 from Simon Marchi <simon.marchi at polymtl dot ca> ---
I'm currently debugging objfile::lookup_symbol, and it seems the intention to
stop expanding when the symbol is found.  What I see is that we are looking for
the "signed int" type:

(top-gdb) frame
#6  0x0000555555c5dd69 in objfile::lookup_symbol (this=0x555556807040,
kind=STATIC_BLOCK, name=0x7fffffffaca0 "signed int", domain=VAR_DOMAIN) at
symfile-debug.c:276
276           if (!iter->expand_symtabs_matching (this,

But in cooked_index_functions::expand_symtabs_matching, we decided to match
index entries with "int" instead of "signed int" (see the name_vec vector):

(top-gdb) frame
#5  0x00005555558e1d07 in
cooked_index_functions::expand_symtabs_matching(objfile*,
gdb::function_view<bool (char const*, bool)>, lookup_name_info const*,
gdb::function_view<bool (char const*)>, gdb::function_view<bool
(compunit_symtab*)>, enum_flags<block_search_flag_values>, domain_enum_tag,
search_domain) (this=0x555556809360, objfile=0x555556807040, file_matcher=...,
lookup_name=0x7fffffffa760, symbol_matcher=..., expansion_notify=...,
search_flags=..., domain=VAR_DOMAIN, kind=ALL_DOMAIN) at dwarf2/read.c:20288
20288             if (!dw2_expand_symtabs_matching_one (entry->per_cu,
per_objfile,
(top-gdb) p name_vec
$13 = std::vector of length 1, capacity 1 = {"int"}

Most CUs have a type called "int", so that matches a lot of them.

Back in the expansion notifier in objfile::lookup_symbol, we search the just
expanded CUs for the "signed int" type, and we don't find it, so we return
false, meaning "not found, please expand the next CU".

I'm not too familiar with this code, but the discrepancy between the criteria
on which we choose the CUs to expand (those that have the "int" type) and then
the type we actually look for ("signed int") is odd.

In the previous psymtabs code, I think we looked for partial symbols named
"signed int", and didn't find any, so it didn't cause expansion of these CUs.

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

  parent reply	other threads:[~2022-05-20 15:36 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 [this message]
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
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-oqLJ0UVKyF@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).