Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Vrany via Gdb <gdb@sourceware.org>
To: undisclosed-recipients:;
Subject: Re: Internals of -readnow implementation
Date: Tue, 11 Nov 2025 21:44:34 +0000	[thread overview]
Message-ID: <28b9830603b54526509cfa2e435f84c34711edba.camel@vrany.io> (raw)
In-Reply-To: <28b9830603b54526509cfa2e435f84c34711edba.camel@vrany.io>

On Tue, 2025-11-11 at 14:18 -0700, Tom Tromey wrote:
> 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.

I see, thanks. 
> 
> 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.

Yes! I encountered the same issue when working on Python JIT API
and came to the same realization.

In fact, I already started working on it and got relatively far
in replacing current implementation of readnow_functions but still 
have loose ends especially in ::search method. It seems to me that the 
implementations not always match its comment.

Jan

> 
> -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


      parent reply	other threads:[~2025-11-11 22:02 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
2025-11-11 21:44   ` Jan Vrany via Gdb [this message]

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=28b9830603b54526509cfa2e435f84c34711edba.camel@vrany.io \
    --to=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