From 33e27657fbfa8d586a73764b0288d9ddac5124de Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Fri, 15 Nov 2002 22:16:25 +0000 Subject: 2002-11-15 Andrew Cagney * frame.c (frame_pc_unwind): New function. (frame_saved_regs_pc_unwind): New function. (frame_register_unwind): Pass unwind_cache instead of register_unwind_cache. (set_unwind_by_pc): Add unwind_pc parameter, set. (create_new_frame): Pass frame->pc_unwind to set_unwind_by_pc. (get_prev_frame): Ditto. * frame.h (frame_pc_unwind_ftype): Declare. (struct frame_info): Add pc_unwind, pc_unwind_cache_p and pc_unwind_cache. Rename register_unwind_cache to unwind_cache. (frame_pc_unwind): Declare. * dummy-frame.c (dummy_frame_pc_unwind): New function. (struct dummy_frame): Add comment mentioning that values are for previous frame. * dummy-frame.h (dummy_frame_pc_unwind): Declare. * blockframe.c (file_frame_chain_valid): Use frame_pc_unwind. (generic_file_frame_chain_valid): Ditto. * stack.c (frame_info): Ditto. --- gdb/frame.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'gdb/frame.h') diff --git a/gdb/frame.h b/gdb/frame.h index 70d85f13c9c..a371a58de42 100644 --- a/gdb/frame.h +++ b/gdb/frame.h @@ -139,6 +139,12 @@ extern void frame_read_unsigned_register (struct frame_info *frame, extern int frame_map_name_to_regnum (const char *name, int strlen); extern const char *frame_map_regnum_to_name (int regnum); +/* Unwind the PC. Strictly speaking return the resume address of the + calling frame. For GDB, `pc' is the resume address and not a + specific register. */ + +extern CORE_ADDR frame_pc_unwind (struct frame_info *frame); + /* Return the location (and possibly value) of REGNUM for the previous (older, up) frame. All parameters except VALUEP can be assumed to @@ -163,6 +169,12 @@ typedef void (frame_register_unwind_ftype) (struct frame_info *frame, int *realnump, void *valuep); +/* Same as for registers above, but return the address at which the + calling frame would resume. */ + +typedef CORE_ADDR (frame_pc_unwind_ftype) (struct frame_info *frame, + void **unwind_cache); + /* Describe the saved registers of a frame. */ #if defined (EXTRA_FRAME_INFO) || defined (FRAME_FIND_SAVED_REGS) @@ -252,10 +264,18 @@ struct frame_info related unwind data. */ struct context *context; - /* See description above. Return the register value for the - previous frame. */ + /* Unwind cache shared between the unwind functions - they had + better all agree as to the contents. */ + void *unwind_cache; + + /* See description above. The previous frame's registers. */ frame_register_unwind_ftype *register_unwind; - void *register_unwind_cache; + + /* See description above. The previous frame's resume address. + Save the previous PC in a local cache. */ + frame_pc_unwind_ftype *pc_unwind; + int pc_unwind_cache_p; + CORE_ADDR pc_unwind_cache; /* Pointers to the next (down, inner, younger) and previous (up, outer, older) frame_info's in the frame cache. */ -- cgit v1.2.1