From: Tom Tromey <tom@tromey.com>
To: Jielun Wu <firmiana402@gmail.com>
Cc: gdb-patches@sourceware.org, simark@simark.ca
Subject: Re: [PATCH v2] gdb: Check DW_OP_deref_type size against type
Date: Fri, 23 Oct 2026 12:03:18 -0600 [thread overview]
Message-ID: <87pkx0qopl.fsf@tromey.com> (raw)
In-Reply-To: <20260822035621.694548-1-firmiana402@gmail.com> (Jielun Wu's message of "Sat, 22 Aug 2026 11:56:21 +0800")
>>>>> Jielun Wu <firmiana402@gmail.com> writes:
> DWARF v5 requires the explicit size operand of DW_OP_deref_type to
> match the size of the referenced base type. The evaluator currently
> passes both sizes to dwarf_expr_context::deref without validating the
> encoding, and the generic dereference helper accepts the mismatch by
> zero-extending the bytes read from memory.
> Reject a mismatch after resolving the base type. Name the actual opcode
> and report both sizes in the diagnostic.
> Teach the testsuite's DWARF assembler to emit DW_OP_deref_type and
> DW_OP_GNU_deref_type operands. Add tests covering matching and
> mismatched sizes for both opcodes.
> Tested on x86_64-linux.
Thank you for the patch. This looks good to me.
If you want to get write-after-access to land this and future patches,
please email me and I will get you set up.
Otherwise let me know and I can check it in.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
next prev parent reply other threads:[~2026-10-23 18:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 3:56 Jielun Wu
2026-10-23 18:03 ` Tom Tromey [this message]
2026-10-29 8:32 ` Jielun Wu
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=87pkx0qopl.fsf@tromey.com \
--to=tom@tromey.com \
--cc=firmiana402@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.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