aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-05-09 16:16:33 +0000
committerMark Kettenis <kettenis@gnu.org>2001-05-09 16:16:33 +0000
commit0d17c81d95377cc552092f5f92dc9221d562ef77 (patch)
tree748faccf823073b134edec7797e39abe50a49641 /gdb/i386-tdep.c
parent96f37af640dc063447f69cccf024cac29d06a1c3 (diff)
downloadgdb-0d17c81d95377cc552092f5f92dc9221d562ef77.zip
gdb-0d17c81d95377cc552092f5f92dc9221d562ef77.tar.gz
gdb-0d17c81d95377cc552092f5f92dc9221d562ef77.tar.bz2
* 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.
Diffstat (limited to 'gdb/i386-tdep.c')
-rw-r--r--gdb/i386-tdep.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 446b268..0e3e340 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