From: "Jan Vraný" <Jan.Vrany@labware.com>
To: "tom@tromey.com" <tom@tromey.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [PATCH v2 13/13] gdb: update message in symbol_file_add_with_addrs after changes in readnow_functions
Date: Wed, 3 Dec 2025 17:46:12 +0000 [thread overview]
Message-ID: <b725b235a704acb668f312a4c67dcd27f980221e.camel@labware.com> (raw)
In-Reply-To: <875xao9061.fsf@tromey.com>
On Tue, 2025-12-02 at 12:03 -0700, Tom Tromey wrote:
> > > > > > "Jan" == Jan Vraný <Jan.Vrany@labware.com> writes:
>
> Jan> Maybe better way to go about it might be:
>
> Jan> 1) introduce new quick functions, say "default_symbol_functions" with
> Jan> the code from this (V2) series.
> Jan> 2) then DWARF's readnow_functions may inherit from "default_symbol_functions"
> Jan> and override what's desirable
>
> Jan> and then JIT reader would just use these new "default_symbol_functions".
>
> I am not overly fond of the name "default_symbol_functions" but I think
> the general idea holds.
On a second thought, it won't be that easy. One cannot just implement readnow_functions
by merely subclassing "default_symbol_functions" and overriding expand_all_symtabs()
to do what it does right now.
The problem is that compunit_symtab is not instantiated and installed into an objfile
until call to dw2_instantiate_symtab().
So even if one specifies -readnow, more work is done when objfile is loaded, but still CUs are
not instantiated (no call to dw2_instantiate_symtab()). If then corresponding ::search is
implemented so that it iterates objfile->compunits() then it won't see them.
This is why commit "gdb: implement readnow_functions::expand_all_symtabs" from this series
calls (new) dw2_instantiate_all_symtabs() from dwarf2_initialize_objfile().
And if we do call dw2_instantiate_all_symtabs(), then doing the same thing in expand_all_symtabs
makes no sense.
In other words: if we want to keep current readnow_functions::expand_all_symtabs() then it would well mean
keeping other methods too and then we may well keep it as it is.
Still, for JIT reader created objfiles (and for future "Python JIT API"-created ones) we will need
"default_symbol_functions" so we'll end up with "default_symbol_functions" alongside existing
readnow_functions. I'm fine with that.
And yes, I do not like name "default_symbol_function" either, I just don't have a better name
right now.
Jan
>
> Tom
next prev parent reply other threads:[~2025-12-03 17:46 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 19:55 [PATCH v2 00/13] reimplement readnow_functions Jan Vrany
2025-11-24 19:55 ` [PATCH v2 01/13] gdb: reimplement readnow_functions::search Jan Vrany
2025-12-02 17:25 ` Tom Tromey
2025-11-24 19:55 ` [PATCH v2 02/13] gdb: implement readnow_functions::has_symbols Jan Vrany
2025-11-24 19:55 ` [PATCH v2 03/13] gdb: implement readnow_functions::has_unexpanded_symtabs Jan Vrany
2025-11-24 19:55 ` [PATCH v2 04/13] gdb: implement readnow_functions::find_last_source_symtab Jan Vrany
2025-11-24 19:55 ` [PATCH v2 05/13] gdb: implement readnow_functions::forget_cached_source_info Jan Vrany
2025-11-24 19:55 ` [PATCH v2 06/13] gdb: implement readnow_functions::lookup_global_symbol_language Jan Vrany
2025-11-24 19:55 ` [PATCH v2 07/13] gdb: implement readnow_functions::print_stats Jan Vrany
2025-11-24 19:55 ` [PATCH v2 08/13] gdb: implement readnow_functions::expand_all_symtabs Jan Vrany
2025-11-24 19:55 ` [PATCH v2 09/13] gdb: implement readnow_functions::find_pc_sect_compunit_symtab Jan Vrany
2025-11-24 19:55 ` [PATCH v2 10/13] gdb: implement readnow_functions::map_symbol_filenames Jan Vrany
2025-11-24 19:55 ` [PATCH v2 11/13] gdb: make readnow_functions to inherit from quick_symbol_functions Jan Vrany
2025-11-24 19:55 ` [PATCH v2 12/13] gdb/testsuite: fix few tests after change in readnow_functions Jan Vrany
2025-12-02 17:26 ` Tom Tromey
2025-11-24 19:55 ` [PATCH v2 13/13] gdb: update message in symbol_file_add_with_addrs after changes " Jan Vrany
2025-12-02 17:29 ` Tom Tromey
2025-12-02 18:48 ` Jan Vraný
2025-12-02 18:57 ` Tom Tromey
2025-12-02 19:03 ` Tom Tromey
2025-12-03 17:46 ` Jan Vraný [this message]
2025-12-02 13:39 ` [PATCH v2 00/13] reimplement readnow_functions Jan Vraný
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=b725b235a704acb668f312a4c67dcd27f980221e.camel@labware.com \
--to=jan.vrany@labware.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/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