From: Simon Marchi <simark@simark.ca>
To: Thiago Jung Bauermann <thiago.bauermann@linaro.org>,
gdb-patches@sourceware.org
Cc: "Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>,
"Maciej W. Rozycki" <macro@orcam.me.uk>
Subject: Re: [PATCH 1/2] GDB: frame: Make VALUEP argument optional in frame_register_unwind
Date: Fri, 10 Jan 2025 12:02:44 -0500 [thread overview]
Message-ID: <27c5451c-bc77-480d-bd04-8c70e852c24e@simark.ca> (raw)
In-Reply-To: <20250110164430.3376697-2-thiago.bauermann@linaro.org>
On 2025-01-10 11:43, Thiago Jung Bauermann wrote:
> It already accepts a nullptr value and a couple of places were always
> calling it that way, so make it possible to omit the argument entirely.
> ---
> gdb/frame.c | 4 ++--
> gdb/frame.h | 4 ++--
> gdb/stack.c | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/gdb/frame.c b/gdb/frame.c
> index a6900b280724..ba4a07179f64 100644
> --- a/gdb/frame.c
> +++ b/gdb/frame.c
> @@ -1447,7 +1447,7 @@ put_frame_register (const frame_info_ptr &next_frame, int regnum,
> gdb_assert (buf.size () == size);
>
> frame_register_unwind (next_frame, regnum, &optim, &unavail, &lval, &addr,
> - &realnum, nullptr);
> + &realnum);
> if (optim)
> error (_("Attempt to assign to a register that was not saved."));
> switch (lval)
> @@ -2159,7 +2159,7 @@ frame_register_unwind_location (const frame_info_ptr &initial_this_frame,
> int unavailable;
>
> frame_register_unwind (this_frame, regnum, optimizedp, &unavailable,
> - lvalp, addrp, realnump, NULL);
> + lvalp, addrp, realnump);
>
> if (*optimizedp)
> break;
> diff --git a/gdb/frame.h b/gdb/frame.h
> index 9b41dd958fa4..b265c9bc5bb3 100644
> --- a/gdb/frame.h
> +++ b/gdb/frame.h
> @@ -685,14 +685,14 @@ const char *unwind_stop_reason_to_string (enum unwind_stop_reason);
> const char *frame_stop_reason_string (const frame_info_ptr &);
>
> /* Unwind the stack frame so that the value of REGNUM, in the previous
> - (up, older) frame is returned. If VALUEP is NULL, don't
> + (up, older) frame is returned. If VALUEP is nullptr, don't
> fetch/compute the value. Instead just return the location of the
> value. */
> extern void frame_register_unwind (const frame_info_ptr &frame, int regnum,
> int *optimizedp, int *unavailablep,
> enum lval_type *lvalp,
> CORE_ADDR *addrp, int *realnump,
> - gdb_byte *valuep);
> + gdb_byte *valuep = nullptr);
>
> /* Fetch a register from this, or unwind a register from the next
> frame. Note that the get_frame methods are wrappers to
> diff --git a/gdb/stack.c b/gdb/stack.c
> index 73165c801343..2d6712ab16ba 100644
> --- a/gdb/stack.c
> +++ b/gdb/stack.c
> @@ -1750,7 +1750,7 @@ info_frame_command_core (const frame_info_ptr &fi, bool selected_frame_p)
> /* Find out the location of the saved register without
> fetching the corresponding value. */
> frame_register_unwind (fi, i, &optimized, &unavailable,
> - &lval, &addr, &realnum, NULL);
> + &lval, &addr, &realnum);
> /* For moment, only display registers that were saved on the
> stack. */
> if (!optimized && !unavailable && lval == lval_memory)
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
next prev parent reply other threads:[~2025-01-10 17:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-10 16:43 [PATCH 0/2] Improvements to a few GDB frame unwind functions Thiago Jung Bauermann
2025-01-10 16:43 ` [PATCH 1/2] GDB: frame: Make VALUEP argument optional in frame_register_unwind Thiago Jung Bauermann
2025-01-10 17:02 ` Simon Marchi [this message]
2025-01-10 22:23 ` Thiago Jung Bauermann
2025-01-10 16:44 ` [PATCH 2/2] GDB: Use gdb::array_view for buffers used in register reading and unwinding Thiago Jung Bauermann
2025-01-10 17:45 ` Simon Marchi
2025-01-10 22:28 ` Thiago Jung Bauermann
2025-01-11 13:54 ` Tom de Vries
2025-01-11 15:46 ` Thiago Jung Bauermann
2025-01-11 16:01 ` Tom de Vries
2025-01-12 0:32 ` Thiago Jung Bauermann
2025-01-13 16:40 ` Tom de Vries
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=27c5451c-bc77-480d-bd04-8c70e852c24e@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=macro@orcam.me.uk \
--cc=tankut.baris.aktemur@intel.com \
--cc=thiago.bauermann@linaro.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