Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] [gdb/symtab] Fix DW_TAG_member regression
Date: Fri, 19 Sep 2025 11:30:30 -0600	[thread overview]
Message-ID: <87ikhee4eh.fsf@tromey.com> (raw)
In-Reply-To: <20250915153334.18723-1-tdevries@suse.de> (Tom de Vries's message of "Mon, 15 Sep 2025 17:33:34 +0200")

Tom> +      else if (cur_abbrev->tag == DW_TAG_member && has_const_value
Tom> +	       && has_external)

I'm a little surprised by this test.

I guess I would assume we'd see this same problem for a static class
variable even if it doesn't have an initializer.  And I'm not sure
has_external is needed?

I would have expected something like "has const value or has a location"
instead.  Could

Tom> +	{
Tom> +	  /* For Dwarf v4, GCC generates a DW_TAG_member for a static const
Tom> +	     member.  */

... but OTOH if this is the only case where DW_TAG_member is generated
then it seems fine.  Though I still don't understand the "external" bit.

So if this is correct could you add some explanation for it?

Tom> --- a/gdb/dwarf2/cooked-index-shard.c
Tom> +++ b/gdb/dwarf2/cooked-index-shard.c
Tom> @@ -65,6 +65,15 @@ cooked_index_shard::create (sect_offset die_offset,
Tom>    else if (tag_is_type (tag))
Tom>      flags |= IS_STATIC;
 
Tom> +  if (tag == DW_TAG_member)
Tom> +    {
Tom> +      /* A cooked index entry generated for a DW_TAG_member should be treated
Tom> +	 the same as one generated for a DW_TAG_variable.  Normalize to
Tom> +	 DW_TAG_variable, to simplify code dealing with cooked index
Tom> +	 entries.  */
Tom> +      tag = DW_TAG_variable;
Tom> +    }

I think this should be in the scanner and not here.

Tom

  reply	other threads:[~2025-09-19 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15 15:33 Tom de Vries
2025-09-19 17:30 ` Tom Tromey [this message]
2025-11-09  6:41   ` Tom de Vries
2025-09-19 17:31 ` Tom Tromey
2025-11-09  6:44   ` Tom de Vries

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=87ikhee4eh.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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