From 4cc24188905500812f6951ff67f1799c57c7c858 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 8 Mar 2000 22:34:19 +0000 Subject: [PATCH] 2000-03-08 Mark Kettenis * i386-tdep.c (i386_linux_saved_pc_after_call): New function. * config/i386/tm-linux.h (SAVED_PC_AFTER_CALL): Define to call i386_linux_saved_pc_after_call. --- gdb/ChangeLog | 6 ++++++ gdb/config/i386/tm-linux.h | 4 ++++ gdb/i386-tdep.c | 11 +++++++++++ 3 files changed, 21 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 75e29b18351..71b307de1bd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2000-03-08 Mark Kettenis + + * i386-tdep.c (i386_linux_saved_pc_after_call): New function. + * config/i386/tm-linux.h (SAVED_PC_AFTER_CALL): Define to call + i386_linux_saved_pc_after_call. + 2000-03-06 Jim Blandy From Tom Tromey and Keith Seitz : diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h index 391d5c08aad..3c557f04fc6 100644 --- a/gdb/config/i386/tm-linux.h +++ b/gdb/config/i386/tm-linux.h @@ -154,6 +154,10 @@ extern CORE_ADDR i386_linux_sigtramp_saved_pc (struct frame_info *); extern CORE_ADDR i386_linux_sigtramp_saved_sp (struct frame_info *); +#undef SAVED_PC_AFTER_CALL +#define SAVED_PC_AFTER_CALL(frame) i386_linux_saved_pc_after_call (frame) +extern CORE_ADDR i386_linux_saved_pc_after_call (struct frame_info *); + /* When we call a function in a shared library, and the PLT sends us into the dynamic linker to find the function's real address, we need to skip over the dynamic linker call. This function decides diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 10011f671b6..e940e2ff3c2 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1024,6 +1024,17 @@ i386_linux_sigtramp_saved_sp (struct frame_info *frame) return read_memory_integer (addr + LINUX_SIGCONTEXT_SP_OFFSET, 4); } +/* Immediately after a function call, return the saved pc. */ + +CORE_ADDR +i386_linux_saved_pc_after_call (struct frame_info *frame) +{ + if (frame->signal_handler_caller) + return i386_linux_sigtramp_saved_pc (frame); + + return read_memory_integer (read_register (SP_REGNUM), 4); +} + #endif /* I386_LINUX_SIGTRAMP */ #ifdef STATIC_TRANSFORM_NAME -- 2.30.2