Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Guinevere Larsen <guinevere@redhat.com>
To: simon.marchi@polymtl.ca, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH 2/2] gdb/block: add assert in block_iterator::compunit_symtab
Date: Fri, 6 Feb 2026 13:13:35 -0300	[thread overview]
Message-ID: <1f3fdbb5-1716-404f-abd5-da0858939bf4@redhat.com> (raw)
In-Reply-To: <20260206025238.3467043-2-simon.marchi@polymtl.ca>

On 2/5/26 11:52 PM, simon.marchi@polymtl.ca wrote:
> From: Simon Marchi <simon.marchi@efficios.com>
>
> Verify that the compunit is only accessed when the iterator is in the
> mode where that field makes sense.
>
> We could also set compunit_symtab_ even in "single block" mode, it
> wouldn't hurt, but it would not be useful either.
>
> Change-Id: I237db16bb485148f9e906b2e7238159e9f0a8585

Same as the previous patch

Tested-By: Guinevere Larsen <guinevere@redhat.com>

> ---
>   gdb/block.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/gdb/block.c b/gdb/block.c
> index 5aa58545393b..730e4580a5b7 100644
> --- a/gdb/block.c
> +++ b/gdb/block.c
> @@ -442,6 +442,10 @@ initialize_block_iterator (const struct block *block,
>   compunit_symtab *
>   block_iterator::compunit_symtab () const
>   {
> +  /* The compunit field is only used when iterating over global or static
> +     blocks.  */
> +  gdb_assert (this->which != FIRST_LOCAL_BLOCK);
> +
>     if (this->idx == -1)
>       return this->compunit_symtab_;
>   


-- 
Cheers,
Guinevere Larsen
It/she


  reply	other threads:[~2026-02-06 16:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06  2:52 [PATCH 1/2] gdb/block: remove block_iterator::d::block, remove union 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 [this message]
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
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=1f3fdbb5-1716-404f-abd5-da0858939bf4@redhat.com \
    --to=guinevere@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --cc=simon.marchi@polymtl.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