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/3] gdb/block: make find_iterator_compunit_symtab a method of block_iterator
Date: Thu, 5 Feb 2026 14:17:36 -0500 [thread overview]
Message-ID: <cd54131e-29b9-48e6-b726-4e6a5ff06d1a@efficios.com> (raw)
In-Reply-To: <87pl6j58pp.fsf@tromey.com>
On 2/5/26 1:46 PM, Tom Tromey wrote:
>>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
>
> Simon> +compunit_symtab *
> Simon> +block_iterator::compunit_symtab () const
> Simon> {
> Simon> - if (iterator->idx == -1)
> Simon> - return iterator->d.compunit_symtab;
> Simon> - return iterator->d.compunit_symtab->includes[iterator->idx];
> Simon> + if (this->idx == -1)
> Simon> + return this->d.compunit_symtab;
> Simon> + return this->d.compunit_symtab->includes[this->idx];
>
> I just recalled that block iterators work in a funny way -- they can
> either iterate over a single block or a symtab.
>
> And, if iterating over a single block, then it's invalid to refer to
> d.compunit_symtab.
>
> So I think this new method should probably assert like
>
> gdb_assert (which != FIRST_LOCAL_BLOCK);
>
> See the comments in block_iterator in block.h.
Yeah I saw that, but I didn't dig too much. Because it's a functional
change, I will send it as a separate patch.
Simon
prev parent reply other threads:[~2026-02-05 19:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-30 2:55 simon.marchi
2026-01-30 2:55 ` [PATCH 2/3] gdb/symtab: make compunit_symtab::includes a std::vector simon.marchi
2026-02-05 18:38 ` Tom Tromey
2026-01-30 2:55 ` [PATCH 3/3] gdb/block: bool-ify some parameters simon.marchi
2026-02-03 17:36 ` [PATCH] gdb/dwarf2: don't search included symtabs recursively Simon Marchi
2026-02-05 18:53 ` Tom Tromey
2026-02-05 19:36 ` Simon Marchi
2026-02-05 18:38 ` [PATCH 3/3] gdb/block: bool-ify some parameters Tom Tromey
2026-02-05 17:41 ` [PATCH 1/3] gdb/block: make find_iterator_compunit_symtab a method of block_iterator Tom Tromey
2026-02-05 19:33 ` Simon Marchi
2026-02-05 18:46 ` Tom Tromey
2026-02-05 19:17 ` Simon Marchi [this message]
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=cd54131e-29b9-48e6-b726-4e6a5ff06d1a@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