diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-12-01 11:27:22 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-12-14 16:04:49 +0000 |
commit | 2461802cbec145437b5161934e18664278f5fc34 (patch) | |
tree | da9eb266a6c78fff04ca5c5b398e14c45c618ee3 /gdb | |
parent | a7952927db56b6adca3c1f58398f61dcd8f32d36 (diff) | |
download | gdb-2461802cbec145437b5161934e18664278f5fc34.zip gdb-2461802cbec145437b5161934e18664278f5fc34.tar.gz gdb-2461802cbec145437b5161934e18664278f5fc34.tar.bz2 |
gdb: remove frame_register
I was going to change frame_register to take the "next frame", but I
realized that doing so would make it a useless wrapper around
frame_register_unwind. So, just remove frame_register and replace uses
with frame_register_unwind.
Change-Id: I185868bc69f8e098124775d0550d069220a4678a
Reviewed-By: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/frame.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/gdb/frame.c b/gdb/frame.c index 9312d1b..61d6822 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1214,31 +1214,6 @@ frame_register_unwind (frame_info_ptr next_frame, int regnum, release_value (value); } -/* Get the value of the register that belongs to this FRAME. This - function is a wrapper to the call sequence ``frame_register_unwind - (get_next_frame (FRAME))''. As per frame_register_unwind(), if - VALUEP is NULL, the registers value is not fetched/computed. */ - -static void -frame_register (frame_info_ptr frame, int regnum, - int *optimizedp, int *unavailablep, enum lval_type *lvalp, - CORE_ADDR *addrp, int *realnump, gdb_byte *bufferp) -{ - /* Require all but BUFFERP to be valid. A NULL BUFFERP indicates - that the value proper does not need to be fetched. */ - gdb_assert (optimizedp != NULL); - gdb_assert (lvalp != NULL); - gdb_assert (addrp != NULL); - gdb_assert (realnump != NULL); - /* gdb_assert (bufferp != NULL); */ - - /* Obtain the register value by unwinding the register from the next - (more inner frame). */ - gdb_assert (frame != NULL && frame->next != NULL); - frame_register_unwind (frame_info_ptr (frame->next), regnum, optimizedp, - unavailablep, lvalp, addrp, realnump, bufferp); -} - void frame_unwind_register (frame_info_ptr next_frame, int regnum, gdb_byte *buf) { @@ -1436,8 +1411,8 @@ put_frame_register (frame_info_ptr frame, int regnum, gdb_assert (buf.size () == size); - frame_register (frame, regnum, &optim, &unavail, - &lval, &addr, &realnum, NULL); + frame_register_unwind (get_next_frame_sentinel_okay (frame), regnum, &optim, + &unavail, &lval, &addr, &realnum, nullptr); if (optim) error (_("Attempt to assign to a register that was not saved.")); switch (lval) @@ -1473,8 +1448,9 @@ deprecated_frame_register_read (frame_info_ptr frame, int regnum, CORE_ADDR addr; int realnum; - frame_register (frame, regnum, &optimized, &unavailable, - &lval, &addr, &realnum, myaddr); + frame_register_unwind (get_next_frame_sentinel_okay (frame), regnum, + &optimized, &unavailable, &lval, &addr, &realnum, + myaddr); return !optimized && !unavailable; } @@ -1523,8 +1499,9 @@ get_frame_register_bytes (frame_info_ptr frame, int regnum, CORE_ADDR addr; int realnum; - frame_register (frame, regnum, optimizedp, unavailablep, &lval, - &addr, &realnum, buffer.data ()); + frame_register_unwind (get_next_frame_sentinel_okay (frame), regnum, + optimizedp, unavailablep, &lval, &addr, + &realnum, buffer.data ()); if (*optimizedp || *unavailablep) return false; } |