From: Tom Tromey <tom@tromey.com>
To: simon.marchi@polymtl.ca
Cc: gdb-patches@sourceware.org, Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH] gdb/dwarf2: pass around DWARF expressions as gdb::array_view
Date: Fri, 01 May 2026 10:35:01 -0600 [thread overview]
Message-ID: <87y0i3gkay.fsf@tromey.com> (raw)
In-Reply-To: <20260429010252.927650-1-simon.marchi@polymtl.ca> (simon marchi's message of "Tue, 28 Apr 2026 20:55:42 -0400")
>>>>> "Simon" == simon marchi <simon.marchi@polymtl.ca> writes:
Simon> This patch converts a bunch of functions to take or return DWARF
Simon> expressions as `gdb::array_view<const gdb_byte>`, instead of raw pointer
Simon> and size. It doesn't do any non-trivial change to function
Simon> implementations, but the idea is that we could change them (for example
Simon> dwarf_expr_context::execute_stack_op) to operate on the array view
Simon> directly, giving us bounds checking when building in debug mode. But
Simon> that is not as trivial.
I skimmed this and it seems fine to me.
Approved-By: Tom Tromey <tom@tromey.com>
Simon> This patch also doesn't change structure fields to array_views (for
Simon> instance, dwarf2_loclist_baton), because that would make them
Simon> non-trivially constructible, and we'd (technically) need to change how
Simon> they are allocated.
I thought this sounded backward but I suppose it refers to the fact that
these are stored in a union inside dwarf2_property_baton.
A fix for that might be to use a class hierarchy rather than a union.
thanks,
Tom
next prev parent reply other threads:[~2026-05-01 16:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 0:55 simon.marchi
2026-05-01 16:35 ` Tom Tromey [this message]
2026-05-02 4:14 ` 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=87y0i3gkay.fsf@tromey.com \
--to=tom@tromey.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