Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Jan Vrany via Gdb <gdb@sourceware.org>
Cc: Jan Vrany <jan@vrany.io>
Subject: Re: Internals of -readnow implementation
Date: Tue, 11 Nov 2025 14:18:27 -0700	[thread overview]
Message-ID: <87ms4sxo7w.fsf@tromey.com> (raw)
In-Reply-To: <a91e746f9a15a78d887fcbd3a2c19e5c90f7586d.camel@vrany.io> (Jan Vrany via Gdb's message of "Tue, 11 Nov 2025 16:18:05 +0000")

Jan> looking at how -readnow is implemented, I'm puzzled
Jan> why implementation of readnow_functions inherits/user
Jan> dwarf2_base_index_functions?

It's mostly a convenience, because that class implements some methods.

Jan> My understanding is that if -readnow is specified, then
Jan> all compunit symbtabs in that objfile are fully read.
Jan> It seems to me that in theory one can implement it "directly" 
Jan> by traversing compunit symtabs, its blockvector and symbols 
Jan> (rather than using dwarf2_per_objfile and alike). 

Jan> Is that because it was just easier to implement it this way
Jan> or is there a reason why it has to go through DWARF reader
Jan> structures?

There's no deep reason.

For this bug:

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

... I am planning to reimplement it as you say: just search things
directly without regard to the DWARF data structures.

-readnow is weird because it's mostly there as a debugging aid, and
sometimes a workaround for other bugs.  While I have recommended it to
users, I don't really like doing so.  Occasionally I think about
removing it.

Tom

  reply	other threads:[~2025-11-11 21:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-11 16:18 Jan Vrany via Gdb
2025-11-11 21:18 ` Tom Tromey [this message]
2025-11-11 21:44   ` Jan Vrany 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=87ms4sxo7w.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb@sourceware.org \
    --cc=jan@vrany.io \
    /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