From: Kevin Buettner <kevinb@redhat.com>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>,
Simon Marchi <simon.marchi@polymtl.ca>
Subject: Re: [PATCH] gdb/dwarf: turn some errors into asserts
Date: Mon, 2 Feb 2026 10:42:18 -0700 [thread overview]
Message-ID: <20260202104218.7aa08244@f42-mesa-1> (raw)
In-Reply-To: <20260126170120.268777-1-simon.marchi@efficios.com>
On Mon, 26 Jan 2026 12:01:17 -0500
Simon Marchi <simon.marchi@efficios.com> wrote:
> From: Simon Marchi <simon.marchi@efficios.com>
> To: gdb-patches@sourceware.org
> Cc: Simon Marchi <simon.marchi@polymtl.ca>
> Subject: [PATCH] gdb/dwarf: turn some errors into asserts
> Date: Mon, 26 Jan 2026 12:01:17 -0500
>
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> There are some nullptr checks on the return value of load_cu that I
> think can't possibly ever be true. load_cu returns nullptr only if the
> CU is "dummy". A "dummy" CU is one that has a header but no DIE. The
> body (the part after the header, included in the unit reported by the
> header) is either empty or consists only of zeroes (null entries).
>
> In the various spots I modified we are doing some work (e.g. evaluating an
> expression) in the context of PER_CU, so PER_CU can't possibly be empty
> / dummy.
>
> Change those conditions to asserts. No behavior change expected, unless
> my reasoning is incorrect.
I agree with your reasoning.
Approved-by: Kevin Buettner <kevinb@redhat.com>
next prev parent reply other threads:[~2026-02-02 17:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-26 17:01 Simon Marchi
2026-02-02 17:42 ` Kevin Buettner [this message]
2026-02-02 18:15 ` 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=20260202104218.7aa08244@f42-mesa-1 \
--to=kevinb@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