diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-12-01 11:27:21 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-12-14 16:04:49 +0000 |
commit | a7952927db56b6adca3c1f58398f61dcd8f32d36 (patch) | |
tree | d6c051e51b92bb5f4e617f9c307269f32c036640 /gdb/aarch64-tdep.c | |
parent | f6e3d5577db80e7b43b585f83a383bc6621ae71b (diff) | |
download | binutils-a7952927db56b6adca3c1f58398f61dcd8f32d36.zip binutils-a7952927db56b6adca3c1f58398f61dcd8f32d36.tar.gz binutils-a7952927db56b6adca3c1f58398f61dcd8f32d36.tar.bz2 |
gdb: change value_of_register and value_of_register_lazy to take the next frame
Some functions related to the handling of registers in frames accept
"this frame", for which we want to read or write the register values,
while other functions accept "the next frame", which is the frame next
to that. The later is needed because we sometimes need to read register
values for a frame that does not exist yet (usually when trying to
unwind that frame-to-be).
value_of_register and value_of_register_lazy both take "this frame",
even if what they ultimately want internally is "the next frame". This
is annoying if you are in a spot that currently has "the next frame" and
need to call one of these functions (which happens later in this
series). You need to get the previous frame only for those functions to
get the next frame again. This is more manipulations, more chances of
mistake.
I propose to change these functions (and a few more functions in the
subsequent patches) to operate on "the next frame". Things become a bit
less awkward when all these functions agree on which frame they take.
So, in this patch, change value_of_register_lazy and value_of_register
to take "the next frame" instead of "this frame". This adds a lot of
get_next_frame_sentinel_okay, but if we convert the user registers API
to also use "the next frame" instead of "this frame", it will get simple
again.
Change-Id: Iaa24815e648fbe5ae3c214c738758890a91819cd
Reviewed-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r-- | gdb/aarch64-tdep.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 4a7ce68..b0aee19 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3449,9 +3449,8 @@ value_of_aarch64_user_reg (frame_info_ptr frame, const void *baton) { const int *reg_p = (const int *) baton; - return value_of_register (*reg_p, frame); + return value_of_register (*reg_p, get_next_frame_sentinel_okay (frame)); } - /* Implement the "software_single_step" gdbarch method, needed to single step through atomic sequences on AArch64. */ |