Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Lluís Batlle i Rossell via Gdb" <gdb@sourceware.org>
To: gdb@sourceware.org
Subject: Loading some symbols, when, and index-cache
Date: Sun, 6 Apr 2025 17:07:37 +0200	[thread overview]
Message-ID: <e3slt5yktlplzzxztvrg47bs5zb4ruz6rpnid2yewwpxin4mw5@7ittqxficilz> (raw)

Hello,

I'm trying to make sense of what symbols are loaded and when, in gdb.
For example, opening an elf file, it will build some index (usable as
index-cache) of some symbols, but not all.

If I do "gdb gdb" (for my compiled gdb), and then "maint print stat" I
get:

  Number of "minimal" symbols read: 33435
  Number of read CUs: 0
  Number of unread CUs: 682

Why haven't all CUs been read, and incorporated into the index? Because at
file loading the CUs symbols index is generated with worker threads (read.c),
therefore, potentially using all cores of the system. And the result would
be cached in the index-cache.

Because the next thing I notice is that when I type "list def<TAB>" to get
symbol completion, a very slow single-thread symbol expansion causes many CUs
to be loaded. After which:, "maint print stat":

  Number of "minimal" symbols read: 33435
  Number of "full" symbols read: 2732412
  Number of "types" defined: 4292812
  Number of symbol tables: 57075
  Number of symbol tables with line tables: 9608
  Number of symbol tables with blockvectors: 351
  Number of read CUs: 351
  Number of unread CUs: 331

Is there any way this work can be done ahead? Why the index-cache only helps
for the "minimal" symbols? How can we use the cache for all symbols? Why not
all CUs have been loaded yet?

Regards,
Lluís.

             reply	other threads:[~2025-04-06 15:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-06 15:07 Lluís Batlle i Rossell via Gdb [this message]
2025-04-07 12:05 ` Guinevere Larsen via Gdb
2025-04-07 12:21   ` Lluís Batlle i Rossell via Gdb
2025-04-07 16:01     ` Simon Marchi via Gdb
2025-04-08  7:29       ` Lluís Batlle i Rossell via Gdb
2025-04-08 13:43         ` Simon Marchi via Gdb
2025-04-09  7:42           ` Lluís Batlle i Rossell via Gdb
2025-04-22 15:31             ` Simon Marchi via Gdb

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=e3slt5yktlplzzxztvrg47bs5zb4ruz6rpnid2yewwpxin4mw5@7ittqxficilz \
    --to=gdb@sourceware.org \
    --cc=viric@viric.name \
    /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