From: Simon Marchi Date: Sat, 21 Jul 2018 02:19:04 +0000 (-0400) Subject: Rename some frame unwind function parameters X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ee6c332f36222a73abee41bc5168bacf78c9189;p=binutils-gdb.git Rename some frame unwind function parameters I am currently working with these functions, and though this renaming could help to reason about the code. Some functions take a frame and will return the value associated to that frame, others will return the value associated to the previous frame. Those usually conveniently contain "unwind" in their name, but naming the variable next_frame instead of frame helps remembering which frame we are dealing with. I also included a little typo fix at the top of frame.h. gdb/ChangeLog: * frame.c (frame_register_unwind): Change parameter name. (frame_unwind_register): Likewise. (frame_unwind_register_value): Likewise. (frame_unwind_register_signed): Likewise. (frame_unwind_register_unsigned): Likewise. * frame.h (frame_register_unwind): Likewise. (frame_unwind_register): Likewise. (frame_unwind_register_value): Likewise. (frame_unwind_register_signed): Likewise. (frame_unwind_register_unsigned): Likewise. (frame_unwind_arch): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index cada9471ce3..68c3bb35b5e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,17 @@ +2018-07-20 Simon Marchi + + * frame.c (frame_register_unwind): Change parameter name. + (frame_unwind_register): Likewise. + (frame_unwind_register_value): Likewise. + (frame_unwind_register_signed): Likewise. + (frame_unwind_register_unsigned): Likewise. + * frame.h (frame_register_unwind): Likewise. + (frame_unwind_register): Likewise. + (frame_unwind_register_value): Likewise. + (frame_unwind_register_signed): Likewise. + (frame_unwind_register_unsigned): Likewise. + (frame_unwind_arch): Likewise. + 2018-07-20 Maciej W. Rozycki * MAINTAINERS: Update my e-mail address, downgrade to MIPS I-IV diff --git a/gdb/frame.c b/gdb/frame.c index 1fe882cd014..0dc2cb7e716 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1091,7 +1091,7 @@ frame_pop (struct frame_info *this_frame) } void -frame_register_unwind (struct frame_info *frame, int regnum, +frame_register_unwind (frame_info *next_frame, int regnum, int *optimizedp, int *unavailablep, enum lval_type *lvalp, CORE_ADDR *addrp, int *realnump, gdb_byte *bufferp) @@ -1106,7 +1106,7 @@ frame_register_unwind (struct frame_info *frame, int regnum, gdb_assert (realnump != NULL); /* gdb_assert (bufferp != NULL); */ - value = frame_unwind_register_value (frame, regnum); + value = frame_unwind_register_value (next_frame, regnum); gdb_assert (value != NULL); @@ -1154,7 +1154,7 @@ frame_register (struct frame_info *frame, int regnum, } void -frame_unwind_register (struct frame_info *frame, int regnum, gdb_byte *buf) +frame_unwind_register (frame_info *next_frame, int regnum, gdb_byte *buf) { int optimized; int unavailable; @@ -1162,7 +1162,7 @@ frame_unwind_register (struct frame_info *frame, int regnum, gdb_byte *buf) int realnum; enum lval_type lval; - frame_register_unwind (frame, regnum, &optimized, &unavailable, + frame_register_unwind (next_frame, regnum, &optimized, &unavailable, &lval, &addr, &realnum, buf); if (optimized) @@ -1181,29 +1181,31 @@ get_frame_register (struct frame_info *frame, } struct value * -frame_unwind_register_value (struct frame_info *frame, int regnum) +frame_unwind_register_value (frame_info *next_frame, int regnum) { struct gdbarch *gdbarch; struct value *value; - gdb_assert (frame != NULL); - gdbarch = frame_unwind_arch (frame); + gdb_assert (next_frame != NULL); + gdbarch = frame_unwind_arch (next_frame); if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "{ frame_unwind_register_value " "(frame=%d,regnum=%d(%s),...) ", - frame->level, regnum, + next_frame->level, regnum, user_reg_map_regnum_to_name (gdbarch, regnum)); } /* Find the unwinder. */ - if (frame->unwind == NULL) - frame_unwind_find_by_frame (frame, &frame->prologue_cache); + if (next_frame->unwind == NULL) + frame_unwind_find_by_frame (next_frame, &next_frame->prologue_cache); /* Ask this frame to unwind its register. */ - value = frame->unwind->prev_register (frame, &frame->prologue_cache, regnum); + value = next_frame->unwind->prev_register (next_frame, + &next_frame->prologue_cache, + regnum); if (frame_debug) { @@ -1253,12 +1255,12 @@ get_frame_register_value (struct frame_info *frame, int regnum) } LONGEST -frame_unwind_register_signed (struct frame_info *frame, int regnum) +frame_unwind_register_signed (frame_info *next_frame, int regnum) { - struct gdbarch *gdbarch = frame_unwind_arch (frame); + struct gdbarch *gdbarch = frame_unwind_arch (next_frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int size = register_size (gdbarch, regnum); - struct value *value = frame_unwind_register_value (frame, regnum); + struct value *value = frame_unwind_register_value (next_frame, regnum); gdb_assert (value != NULL); @@ -1287,12 +1289,12 @@ get_frame_register_signed (struct frame_info *frame, int regnum) } ULONGEST -frame_unwind_register_unsigned (struct frame_info *frame, int regnum) +frame_unwind_register_unsigned (frame_info *next_frame, int regnum) { - struct gdbarch *gdbarch = frame_unwind_arch (frame); + struct gdbarch *gdbarch = frame_unwind_arch (next_frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int size = register_size (gdbarch, regnum); - struct value *value = frame_unwind_register_value (frame, regnum); + struct value *value = frame_unwind_register_value (next_frame, regnum); gdb_assert (value != NULL); diff --git a/gdb/frame.h b/gdb/frame.h index a6f7fd8947d..2793204e568 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -26,7 +26,7 @@ Prefixes: - get_frame_WHAT...(): Get WHAT from the THIS frame (functionaly + get_frame_WHAT...(): Get WHAT from the THIS frame (functionally equivalent to THIS->next->unwind->what) frame_unwind_WHAT...(): Unwind THIS frame's WHAT from the NEXT @@ -559,7 +559,7 @@ const char *frame_stop_reason_string (struct frame_info *); (up, older) frame is returned. If VALUEP is NULL, don't fetch/compute the value. Instead just return the location of the value. */ -extern void frame_register_unwind (struct frame_info *frame, int regnum, +extern void frame_register_unwind (frame_info *frame, int regnum, int *optimizedp, int *unavailablep, enum lval_type *lvalp, CORE_ADDR *addrp, int *realnump, @@ -571,22 +571,22 @@ extern void frame_register_unwind (struct frame_info *frame, int regnum, fetch fails. The value methods never return NULL, but usually do return a lazy value. */ -extern void frame_unwind_register (struct frame_info *frame, +extern void frame_unwind_register (frame_info *next_frame, int regnum, gdb_byte *buf); extern void get_frame_register (struct frame_info *frame, int regnum, gdb_byte *buf); -struct value *frame_unwind_register_value (struct frame_info *frame, +struct value *frame_unwind_register_value (frame_info *next_frame, int regnum); struct value *get_frame_register_value (struct frame_info *frame, int regnum); -extern LONGEST frame_unwind_register_signed (struct frame_info *frame, +extern LONGEST frame_unwind_register_signed (frame_info *next_frame, int regnum); extern LONGEST get_frame_register_signed (struct frame_info *frame, int regnum); -extern ULONGEST frame_unwind_register_unsigned (struct frame_info *frame, - int regnum); +extern ULONGEST frame_unwind_register_unsigned (frame_info *frame, + int regnum); extern ULONGEST get_frame_register_unsigned (struct frame_info *frame, int regnum); @@ -669,7 +669,7 @@ extern int safe_frame_unwind_memory (struct frame_info *this_frame, extern struct gdbarch *get_frame_arch (struct frame_info *this_frame); /* Return the previous frame's architecture. */ -extern struct gdbarch *frame_unwind_arch (struct frame_info *frame); +extern struct gdbarch *frame_unwind_arch (frame_info *next_frame); /* Return the previous frame's architecture, skipping inline functions. */ extern struct gdbarch *frame_unwind_caller_arch (struct frame_info *frame);