From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>
Cc: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCHv3] gdb: resolve class name via DW_AT_signature in cooked index
Date: Fri, 11 Sep 2026 22:06:58 -0400 [thread overview]
Message-ID: <deb3a797-090f-4fa8-8ea0-fa9ab39a7947@simark.ca> (raw)
In-Reply-To: <874ifvy4u7.fsf@tromey.com>
On 2026-09-11 15:18, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
>
>>> (a) If a DIE has no name, but does have a signature, then give the
>>> DIE a fake name (the empty string), and create an index entry
>>> for the DIE. Also keep a record that the cooked_index_entry
>>> for this DIE has a deferred name.
>
> Simon> Just wondering, if we end up not patching the entry for some reason,
> Simon> will an entry with an empty name cause problems / match things it's not
> Simon> supposed to match? Like will the child of that nameless entry be
> Simon> considered to be part of the top-level namespace or something like that?
>
> Simon> If it happens that we have an entry with an unresolved name, perhaps we
> Simon> should consider this entry invalid and just skip anything that would
> Simon> require it.
>
> Simon> So yeah, I wonder if it wouldn't be better to leave the name as
> Simon> nullptr, that would force us to add some nullptr checks to realize
> Simon> that the entry doesn't have a valid name, and we would skip it.
>
> I would much prefer a new cooked_index_flag_enum value over allowing
> NULL pointers.
Why? Just wondering.
> Simon> - the complaint runs on a thread pool worker, but no
> Simon> complaint_interceptor is installed in those threads, so
> Simon> complaint_internal writes straight to gdb_stderr from a worker
> Simon> thread, outside the collect-and-re-emit-on-the-main-thread machinery.
> Simon> Besides the raw thread-safety issue, the message can land at an
> Simon> arbitrary point in the main thread's output. Using the
> Simon> complaint interceptor would fix both.
>
> Complaints are worthless IMO.
>
> If this is user-actionable or interesting in any way, it's better to
> warn. If it isn't user-actionable, then it can just be ignored.
I don't recall, are we allowed to use debug_printf functions in
non-main-threads? I'd like if that kind of anomaly left a trace
somewhere, that you can look at without having to debug gdb itself. Of
course the debug output will probably not look pretty if multiple
threads spew some simultaneously, but you can always disable background
threads just for this.
> Simon> - The comment on cooked_index_entry::name says that it always points
> Simon> into mapped DWARF sections, which is not true anymore. The comment
> Simon> could talk about the "" case (or nullptr if we decided to go that
> Simon> route).
>
> I think it's actually wrong already since cooked_index_shard::finalize
> can synthesize names. It's really the lifetime of the pointer that is
> important, not the storage location; and the important invariant is that
> there's never a case where the string is freed but the entry is live.
Makes sense yeah.
Simon
next prev parent reply other threads:[~2026-09-12 2:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-19 10:03 [PATCH] [GDB 18] " Andrew Burgess
2026-08-21 17:07 ` Tom Tromey
2026-08-28 21:30 ` [PATCHv2] " Andrew Burgess
2026-09-01 13:31 ` [PATCHv3] " Andrew Burgess
2026-09-10 16:11 ` Simon Marchi
2026-09-11 19:18 ` Tom Tromey
2026-09-12 2:06 ` Simon Marchi [this message]
2026-09-14 13:23 ` Andrew Burgess
2026-09-14 14:57 ` Simon Marchi
2026-09-14 15:38 ` Tom Tromey
2026-09-15 10:25 ` Andrew Burgess
2026-09-15 15:01 ` Tom Tromey
2026-09-15 15:55 ` Simon Marchi
2026-09-15 17:21 ` Simon Marchi
2026-09-14 15:36 ` Tom Tromey
2026-09-10 16:18 ` Simon Marchi
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=deb3a797-090f-4fa8-8ea0-fa9ab39a7947@simark.ca \
--to=simark@simark.ca \
--cc=aburgess@redhat.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