public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/29398] New: [gdb/symtab] lazy CU expansion
Date: Sun, 24 Jul 2022 08:25:39 +0000	[thread overview]
Message-ID: <bug-29398-4717@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 29398
           Summary: [gdb/symtab] lazy CU expansion
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

>From PR29391 comment 1:
...
The second problem is that CU expansion can be slow.  Here I think
gdb could do a lot better, the basic idea being lazy CU expansion.
In response to a CU expansion request, the DWARF reader would
create the symtab / compunit_symtab structures and it would also
create some "outline" struct symbols -- one for each cooked_index_entry.
Then when some attribute of a symbol is needed (say, the type),
the DWARF reader would read the rest of the symbol that that moment.

The major advantage of this approach is that most data in a CU
is not needed at all.  So, much less work would need to be done in
general.  I think it would be possible to avoid reading every DIE.

A secondary advantage is that, because the symbols are created directly
from the cooked index, we would avoid the situation where the
two readers could diverge.  That would no longer be possible at all.

There are some downsides.  It's more complex, and it is complicated to
implement and test.  Also I think it would require fixing the .debug_names
bug, and also probably removing .gdb_index support.  Finally, we'd have
to change the blockvector to be expandable.
...

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

             reply	other threads:[~2022-07-24  8:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-24  8:25 vries at gcc dot gnu.org [this message]
2022-07-24  8:36 ` [Bug symtab/29398] " vries at gcc dot gnu.org
2022-07-24  8:43 ` vries at gcc dot gnu.org
2022-07-24  8:46 ` vries at gcc dot gnu.org
2022-10-21 17:20 ` tromey at sourceware dot org
2022-12-21 19:55 ` tromey at sourceware dot org
2022-12-25 20:03 ` tromey at sourceware dot org
2023-04-03 14:58 ` tromey at sourceware dot org
2023-10-25  8:44 ` sam at gentoo dot org
2023-11-25 18:12 ` tromey at sourceware dot org
2024-01-21 22:17 ` tromey at sourceware dot org
2024-01-23  0:24 ` tromey at sourceware dot org
2024-02-09 20:15 ` tromey at sourceware dot 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-29398-4717@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).