From: Tom Tromey <tom@tromey.com>
To: Simon Marchi <simark@simark.ca>
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 13:18:24 -0600 [thread overview]
Message-ID: <874ifvy4u7.fsf@tromey.com> (raw)
In-Reply-To: <1a67b29f-e2f1-480a-ae2b-e0d0d5acfdca@simark.ca> (Simon Marchi's message of "Thu, 10 Sep 2026 12:11:05 -0400")
>>>>> "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.
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.
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.
Tom
next prev parent reply other threads:[~2026-09-11 19:19 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 [this message]
2026-09-12 2:06 ` Simon Marchi
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=874ifvy4u7.fsf@tromey.com \
--to=tom@tromey.com \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
/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