aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-03-26 19:51:47 +0000
committerMark Kettenis <kettenis@gnu.org>2001-03-26 19:51:47 +0000
commit50e27f84bf58bb7cb518bb178b05cc4a685d8e07 (patch)
tree776b314806bfc0a43b15950162290a1654bb8f72
parent10a5181444d6e9400e7c3334f16e866085a83cf9 (diff)
downloadgdb-50e27f84bf58bb7cb518bb178b05cc4a685d8e07.zip
gdb-50e27f84bf58bb7cb518bb178b05cc4a685d8e07.tar.gz
gdb-50e27f84bf58bb7cb518bb178b05cc4a685d8e07.tar.bz2
* i386-linux-tdep.c (i386_linux_sigtramp_saved_pc,
i386_linux_sigtramp_saved_sp): Make static. (i386_linux_frame_saved_pc): New function based on the old FRAME_SAVED_PC macro, but use read_memory_unsigned_integer instead of read_memory_integer. * config/i386/tm-linux.h (sigtramp_saved_pc): Remove definition. (i386_linux_sigtramp_saved_pc): Remove prototype. (FRAME_SAVED_PC): Redefine in terms of i386_linux_frame_saved_pc. (i386_linux_frame_saved_pc): New prototype.
-rw-r--r--gdb/ChangeLog12
-rw-r--r--gdb/config/i386/tm-linux.h16
-rw-r--r--gdb/i386-linux-tdep.c26
3 files changed, 38 insertions, 16 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 760e6b8..1a21bc9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2001-03-26 Mark Kettenis <kettenis@gnu.org>
+
+ * i386-linux-tdep.c (i386_linux_sigtramp_saved_pc,
+ i386_linux_sigtramp_saved_sp): Make static.
+ (i386_linux_frame_saved_pc): New function based on the old
+ FRAME_SAVED_PC macro, but use read_memory_unsigned_integer instead
+ of read_memory_integer.
+ * config/i386/tm-linux.h (sigtramp_saved_pc): Remove definition.
+ (i386_linux_sigtramp_saved_pc): Remove prototype.
+ (FRAME_SAVED_PC): Redefine in terms of i386_linux_frame_saved_pc.
+ (i386_linux_frame_saved_pc): New prototype.
+
2001-03-26 Andrew Cagney <ac131313@redhat.com>
* MAINTAINERS: Document m88k as a ``Known problem in 5.1''.
diff --git a/gdb/config/i386/tm-linux.h b/gdb/config/i386/tm-linux.h
index f72b3c9..6c34498 100644
--- a/gdb/config/i386/tm-linux.h
+++ b/gdb/config/i386/tm-linux.h
@@ -46,12 +46,6 @@ extern struct link_map_offsets *i386_linux_svr4_fetch_link_map_offsets (void);
#define IN_SIGTRAMP(pc, name) i386_linux_in_sigtramp (pc, name)
extern int i386_linux_in_sigtramp (CORE_ADDR, char *);
-/* We need our own version of sigtramp_saved_pc to get the saved PC in
- a sigtramp routine. */
-
-#define sigtramp_saved_pc i386_linux_sigtramp_saved_pc
-extern CORE_ADDR i386_linux_sigtramp_saved_pc (struct frame_info *);
-
/* Signal trampolines don't have a meaningful frame. As in tm-i386.h,
the frame pointer value we use is actually the frame pointer of the
calling frame--that is, the frame which was in progress when the
@@ -89,14 +83,8 @@ extern CORE_ADDR i386_linux_sigtramp_saved_pc (struct frame_info *);
: 0)))
#undef FRAME_SAVED_PC
-#define FRAME_SAVED_PC(FRAME) \
- ((FRAME)->signal_handler_caller \
- ? sigtramp_saved_pc (FRAME) \
- : (FRAMELESS_SIGNAL (FRAME) \
- ? read_memory_integer (i386_linux_sigtramp_saved_sp ((FRAME)->next), 4) \
- : read_memory_integer ((FRAME)->frame + 4, 4)))
-
-extern CORE_ADDR i386_linux_sigtramp_saved_sp (struct frame_info *);
+#define FRAME_SAVED_PC(frame) i386_linux_frame_saved_pc (frame)
+extern CORE_ADDR i386_linux_frame_saved_pc (struct frame_info *frame);
#undef SAVED_PC_AFTER_CALL
#define SAVED_PC_AFTER_CALL(frame) i386_linux_saved_pc_after_call (frame)
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index a973ac9..56a5ead 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -255,7 +255,7 @@ i386_linux_sigcontext_addr (struct frame_info *frame)
/* Assuming FRAME is for a Linux sigtramp routine, return the saved
program counter. */
-CORE_ADDR
+static CORE_ADDR
i386_linux_sigtramp_saved_pc (struct frame_info *frame)
{
CORE_ADDR addr;
@@ -269,7 +269,7 @@ i386_linux_sigtramp_saved_pc (struct frame_info *frame)
/* Assuming FRAME is for a Linux sigtramp routine, return the saved
stack pointer. */
-CORE_ADDR
+static CORE_ADDR
i386_linux_sigtramp_saved_sp (struct frame_info *frame)
{
CORE_ADDR addr;
@@ -277,6 +277,28 @@ i386_linux_sigtramp_saved_sp (struct frame_info *frame)
return read_memory_integer (addr + LINUX_SIGCONTEXT_SP_OFFSET, 4);
}
+/* Return the saved program counter for FRAME. */
+
+CORE_ADDR
+i386_linux_frame_saved_pc (struct frame_info *frame)
+{
+ if (frame->signal_handler_caller)
+ return i386_linux_sigtramp_saved_pc (frame);
+
+ /* See comment in "i386/tm-linux.h" for an explanation what this
+ "FRAMELESS_SIGNAL" stuff is supposed to do.
+
+ FIXME: kettenis/2001-03-26: That comment should eventually be
+ moved to this file. */
+ if (FRAMELESS_SIGNAL (frame))
+ {
+ CORE_ADDR sp = i386_linux_sigtramp_saved_sp (frame->next);
+ return read_memory_unsigned_integer (sp, 4);
+ }
+
+ return read_memory_unsigned_integer (frame->frame + 4, 4);
+}
+
/* Immediately after a function call, return the saved pc. */
CORE_ADDR