From: Mark Kettenis Date: Wed, 9 May 2001 16:16:33 +0000 (+0000) Subject: * i386-tdep.c (i386_frame_saved_pc): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0d17c81d95377cc552092f5f92dc9221d562ef77;p=binutils-gdb.git * i386-tdep.c (i386_frame_saved_pc): New function. * config/i386/tm-i386.h (FRAME_SAVED_PC): Redefine in terms of i386_frame_saved_pc. (i386_frame_saved_pc): New prototype. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2f82bb7118d..85276c83e36 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2001-05-09 Mark Kettenis + * i386-tdep.c (i386_frame_saved_pc): New function. + * config/i386/tm-i386.h (FRAME_SAVED_PC): Redefine in terms of + i386_frame_saved_pc. + (i386_frame_saved_pc): New prototype. + * i386-tdep.c (i386_register_virtual_type): New function. (i386_register_convertible): New function. * config/i386/tm-i386.h (REGISTER_VIRTUAL_TYPE): Redefine in terms diff --git a/gdb/config/i386/tm-i386.h b/gdb/config/i386/tm-i386.h index a59ed82d043..9248f184e71 100644 --- a/gdb/config/i386/tm-i386.h +++ b/gdb/config/i386/tm-i386.h @@ -330,15 +330,10 @@ extern CORE_ADDR i386_frame_chain (struct frame_info *frame); i386_frameless_function_invocation (frame) extern int i386_frameless_function_invocation (struct frame_info *frame); -/* Saved Pc. Get it from sigcontext if within sigtramp. */ +/* Return the saved program counter for FRAME. */ -#define FRAME_SAVED_PC(FRAME) \ - (((FRAME)->signal_handler_caller \ - ? sigtramp_saved_pc (FRAME) \ - : read_memory_unsigned_integer ((FRAME)->frame + 4, 4)) \ - ) - -extern CORE_ADDR sigtramp_saved_pc (struct frame_info *); +#define FRAME_SAVED_PC(frame) i386_frame_saved_pc (frame) +extern CORE_ADDR i386_frame_saved_pc (struct frame_info *frame); #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame) diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 446b268481f..0e3e34057ce 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -378,6 +378,23 @@ i386_frameless_function_invocation (struct frame_info *frame) return frameless_look_for_prologue (frame); } +/* Return the saved program counter for FRAME. */ + +CORE_ADDR +i386_frame_saved_pc (struct frame_info *frame) +{ + /* FIXME: kettenis/2001-05-09: Conditionalizing the next bit of code + on SIGCONTEXT_PC_OFFSET and I386V4_SIGTRAMP_SAVED_PC should be + considered a temporary hack. I plan to come up with something + better when we go multi-arch. */ +#if defined (SIGCONTEXT_PC_OFFSET) || defined (I386V4_SIGTRAMP_SAVED_PC) + if (frame->signal_handler_caller) + return sigtramp_saved_pc (frame); +#endif + + return read_memory_unsigned_integer (frame->frame + 4, 4); +} + /* Immediately after a function call, return the saved pc. */ CORE_ADDR