From: Simon Marchi <simon.marchi@efficios.com>
To: Tom Tromey <tom@tromey.com>, simon.marchi@polymtl.ca
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] gdb/block: remove block_iterator::d::block, remove union
Date: Fri, 6 Feb 2026 14:01:17 -0500 [thread overview]
Message-ID: <189096bc-677f-410c-aa2f-f32d59e926fb@efficios.com> (raw)
In-Reply-To: <87v7g94yd2.fsf@tromey.com>
On 2026-02-06 11:42, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
>
> Simon> From: Simon Marchi <simon.marchi@efficios.com>
> Simon> The block field is never used. The block is only used to grab a
> Simon> reference to the mdict, which is stored in the mdict_iterator.
>
> Simon> Remove it and remove the union. Leave the compunit_symtab field, whose
> Simon> name unfortunately conflicts with the method.
>
> Seems reasonable to me.
>
> Using an m_ name wouldn't be remiss, we have other cases where we've
> done this but where the field is still "public".
>
> Simon> else
> Simon> {
> Simon> - iter->d.block = block;
> Simon> -
>
> I didn't look to see how the initialization is done, but I wonder if
> this should assign nullptr to the compunit_symtab field.
It could, but I don't think it's necessary. This code path puts the
iterator in FIRST_LOCAL_BLOCK mode (iterate on a single block), and it's
forbidden (protected by the assert added in the following patch) to
access the compunit when in that mode. So it's fine if it stays in an
undefined state.
> Approved-By: Tom Tromey <tom@tromey.com>
Thanks,
Simon
next prev parent reply other threads:[~2026-02-06 19:01 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-06 2:52 simon.marchi
2026-02-06 2:52 ` [PATCH 2/2] gdb/block: add assert in block_iterator::compunit_symtab simon.marchi
2026-02-06 16:13 ` Guinevere Larsen
2026-02-06 16:36 ` Andrew Burgess
2026-02-06 16:43 ` Tom Tromey
2026-02-06 19:01 ` Simon Marchi
2026-02-06 16:08 ` [PATCH 1/2] gdb/block: remove block_iterator::d::block, remove union Guinevere Larsen
2026-02-06 18:56 ` Simon Marchi
2026-02-06 16:35 ` Andrew Burgess
2026-02-06 16:45 ` Tom Tromey
2026-02-06 18:57 ` Simon Marchi
2026-02-06 16:42 ` Tom Tromey
2026-02-06 19:01 ` Simon Marchi [this message]
2026-02-06 20:23 ` 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=189096bc-677f-410c-aa2f-f32d59e926fb@efficios.com \
--to=simon.marchi@efficios.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@polymtl.ca \
--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