From: Simon Marchi <simark@simark.ca>
To: Firmiana <firmiana402@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH][PR gdb/34239][PR gdb/34299] gdb: Check bounds before reading DWARF expression operands
Date: Fri, 26 Jun 2026 10:23:31 -0400 [thread overview]
Message-ID: <eb129116-4a17-401a-8675-7e375c779858@simark.ca> (raw)
In-Reply-To: <CADzhaFxBUuwAPC_a1XrekDV=ZocGQOn02Vsq40ekOPsceaGMTg@mail.gmail.com>
On 2026-06-26 03:34, Firmiana wrote:
> Hi,
>
> Thanks for the review. Given the amount of changes needed, I plan to prepare a v2 that
> supersedes this version. Before preparing v2, I would like to clarify a few questions.
>
> First, regarding copyright assignment: I do not currently have an FSF
> copyright assignment on file. I noticed the 2022 binutils announcement
> that DCO signed contributions are accepted:
>
> https://sourceware.org/pipermail/binutils/2022-October/123680.html <https://sourceware.org/pipermail/binutils/2022-October/123680.html>
>
> and binutils/MAINTAINERS documents DCO as an alternative to FSF copyright
> assignment. Does this DCO path also apply to GDB patches touching gdb/?
> If so, I will add:
>
> Signed-off-by: Jielun Wu <firmiana402@gmail.com <mailto:firmiana402@gmail.com>>
>
> to the v2 commit. If GDB still requires FSF copyright assignment for
> this patch, I am willing to start that process.
Thanks a lot.
No it doesn't apply to GDB. There are ongoing discussions to maybe use
DCO for GDB too but we haven't reached a consensus yet.
> On the technical comments, I agree with most of them and plan to address
> them in v2:
>
> - make the helper comments more precise;
> - change the `buf > buf_end` cases in safe_skip_bytes() to assertions;
> - switch the new fixed-width integer helpers to reference/template
> style, unless you prefer keeping them closer to the existing
> safe_read_uleb128/safe_read_sleb128 style;
> - add assertions that LEN fits in the destination type;
> - remove the unrelated whitespace-only changes;
> - change the dwarf_block_to_dwarf_reg_deref guard to the
> `gdb_assert (buf <= buf_end); if (buf == buf_end) return -1;`
> form;
> - add selftests for dwarf_block_to_dwarf_reg and
> dwarf_block_to_dwarf_reg_deref;
> - rewrite the DW_OP_deref* branch using the explicit if/else form you
> suggested.
>
> For the helper style: in v1 I mirrored the nearby safe_read_uleb128 and
> safe_read_sleb128 helpers, which use output pointer parameters and short
> "or throw an error" comments. But I agree that these new helpers can be
> clearer, so unless you prefer otherwise I will use the reference/template
> style you suggested for v2.
Ack. It's good to leave the place a little nicer than how you found it
:).
Simon
prev parent reply other threads:[~2026-06-26 14:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 18:01 Jielun Wu
2026-06-23 18:56 ` Guinevere Larsen
2026-06-26 8:31 ` Firmiana
2026-06-26 14:30 ` Simon Marchi
2026-06-25 15:23 ` Simon Marchi
2026-06-25 16:36 ` Simon Marchi
2026-06-26 7:34 ` Firmiana
2026-06-26 14:23 ` 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=eb129116-4a17-401a-8675-7e375c779858@simark.ca \
--to=simark@simark.ca \
--cc=firmiana402@gmail.com \
--cc=gdb-patches@sourceware.org \
/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