binutils-gdb/gdb/mi
Simon Marchi a7952927db 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>
2023-12-14 16:04:49 +00:00
..
ChangeLog-1999-2003
mi-cmd-break.c Use unique_xmalloc_ptr in explicit_location_spec 2023-12-13 14:12:52 -07:00
mi-cmd-break.h
mi-cmd-catch.c
mi-cmd-disas.c
mi-cmd-env.c
mi-cmd-file.c gdb: rename struct so_list to shobj 2023-10-19 11:14:26 -04:00
mi-cmd-info.c
mi-cmd-stack.c Use C++17 [[fallthrough]] attribute 2023-11-29 14:29:43 -07:00
mi-cmd-target.c
mi-cmd-var.c gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
mi-cmds.c gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
mi-cmds.h gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
mi-common.c Remove gdb_static_assert 2023-11-29 14:29:44 -07:00
mi-common.h
mi-console.c
mi-console.h
mi-getopt.c
mi-getopt.h
mi-interp.c gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
mi-interp.h gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
mi-main.c gdb: change value_of_register and value_of_register_lazy to take the next frame 2023-12-14 16:04:49 +00:00
mi-main.h gdb/mi: make current_token a field of mi_interp 2023-09-07 10:42:46 -04:00
mi-out.c gdb: Use C++17's std::make_unique instead of gdb::make_unique 2023-11-21 11:52:35 +00:00
mi-out.h
mi-parse.c
mi-parse.h Remove explanatory comments from includes 2023-09-20 11:45:16 -06:00
mi-symbol-cmds.c