summaryrefslogtreecommitdiff
path: root/gdb/i386bsd-nat.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2002-07-02 09:12:37 +0000
committerMark Kettenis <kettenis@gnu.org>2002-07-02 09:12:37 +0000
commitfc110bcbcdeceb2b2a6ece71508a22a34ea96ef6 (patch)
tree83c9856277cbc2b6edb883020205e9bf7231972f /gdb/i386bsd-nat.c
parent1e2e82366b542a3fd0429aa8795fb8172e73d6e6 (diff)
downloadgdb-fc110bcbcdeceb2b2a6ece71508a22a34ea96ef6.tar.gz
* i386-tdep.c (i386_frameless_signal_p): New function.
(i386_frame_chain): Deal with frameless signals. (i386_sigtramp_saved_sp): New function. (i386_frame_saved_pc): Deal with frameless signals. (i386_saved_pc_after_call): Make sure the correct value is returned just after entry into a sigtramp. * i386bsd-tdep.c (i386bsd_sc_sp_offset, i386nbsd_sc_sp_offset, i386fbsd4_sc_sp_offset): New variables. (i386bsd_init_abi, i386nbsd_init_abi, i386fbsd4_init_abi): Use these variables to initialize tdep->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Add sanity check for sc_sp_offset similiar to what we already did for sc_pc_offset. * i386-sol2-tdep.c (i386_sol2_init_abi): Initialize tdep->sc_sp_offset.
Diffstat (limited to 'gdb/i386bsd-nat.c')
-rw-r--r--gdb/i386bsd-nat.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/i386bsd-nat.c b/gdb/i386bsd-nat.c
index 382e3f3f8bb..8a3acd4cf58 100644
--- a/gdb/i386bsd-nat.c
+++ b/gdb/i386bsd-nat.c
@@ -387,6 +387,7 @@ void
_initialize_i386bsd_nat (void)
{
int sc_pc_offset;
+ int sc_sp_offset;
/* To support the recognition of signal handlers, i386bsd-tdep.c
hardcodes some constants. Inclusion of this file means that we
@@ -396,13 +397,19 @@ _initialize_i386bsd_nat (void)
#if defined (__FreeBSD_version) && __FreeBSD_version >= 400011
extern int i386fbsd4_sc_pc_offset;
+ extern int i386fbsd4_sc_sp_offset;
#define SC_PC_OFFSET i386fbsd4_sc_pc_offset
+#define SC_SP_OFFSET i386fbsd4_sc_sp_offset
#elif defined (NetBSD) || defined (__NetBSD_Version__) || defined (OpenBSD)
extern int i386nbsd_sc_pc_offset;
+ extern int i386nbsd_sc_sp_offset;
#define SC_PC_OFFSET i386nbsd_sc_pc_offset
+#define SC_SP_OFFSET i386nbsd_sc_sp_offset
#else
extern int i386bsd_sc_pc_offset;
+ extern int i386bsd_sc_sp_offset;
#define SC_PC_OFFSET i386bsd_sc_pc_offset
+#define SC_SP_OFFSET i386bsd_sc_sp_offset
#endif
/* Override the default value for the offset of the program counter
@@ -418,4 +425,17 @@ Please report this to <bug-gdb@gnu.org>.",
}
SC_PC_OFFSET = sc_pc_offset;
+
+ /* Likewise for the stack pointer. */
+ sc_sp_offset = offsetof (struct sigcontext, sc_sp);
+
+ if (SC_SP_OFFSET != sc_sp_offset)
+ {
+ warning ("\
+offsetof (struct sigcontext, sc_sp) yields %d instead of %d.\n\
+Please report this to <bug-gdb@gnu.org>.",
+ sc_sp_offset, SC_SP_OFFSET);
+ }
+
+ SC_SP_OFFSET = sc_sp_offset;
}