aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-12-28 19:48:15 +0000
committerMark Kettenis <kettenis@gnu.org>2003-12-28 19:48:15 +0000
commit8349554debe1e86515a9d89d02bd976357281039 (patch)
treed3c9dcd64f8abd77c800cdfc009858e2c4615b47
parent2666fb59a086d0ed8f0647f997b34b7109696898 (diff)
downloadgdb-8349554debe1e86515a9d89d02bd976357281039.zip
gdb-8349554debe1e86515a9d89d02bd976357281039.tar.gz
gdb-8349554debe1e86515a9d89d02bd976357281039.tar.bz2
* i386-sol2-tdep.c (i386_sol2_mcontext_addr): New function.
(i386_sol2_init_abi): Initialize TDEP->sigcontext_addr, TDEP->sc_reg_offset and TDEP->sc_num_regs.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/i386-sol2-tdep.c18
2 files changed, 22 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a0bd4c7..5c2e531 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2003-12-28 Mark Kettenis <kettenis@gnu.org>
+ * i386-sol2-tdep.c (i386_sol2_mcontext_addr): New function.
+ (i386_sol2_init_abi): Initialize TDEP->sigcontext_addr,
+ TDEP->sc_reg_offset and TDEP->sc_num_regs.
+
* i386-tdep.h (i386_regnum): Add I386_CS_REGNUM and
I386_SS_REGNUM.
diff --git a/gdb/i386-sol2-tdep.c b/gdb/i386-sol2-tdep.c
index 2aa964e..0da32d5 100644
--- a/gdb/i386-sol2-tdep.c
+++ b/gdb/i386-sol2-tdep.c
@@ -53,6 +53,20 @@ i386_sol2_pc_in_sigtramp (CORE_ADDR pc, char *name)
return (pc == 0xffffffff);
}
+/* Solaris doesn't have a `struct sigcontext', but it does have a
+ `mcontext_t' that contains the saved set of machine registers. */
+
+static CORE_ADDR
+i386_sol2_mcontext_addr (struct frame_info *next_frame)
+{
+ CORE_ADDR sp, ucontext_addr;
+
+ sp = frame_unwind_register_unsigned (next_frame, I386_ESP_REGNUM);
+ ucontext_addr = get_frame_memory_unsigned (next_frame, sp + 8, 4);
+
+ return ucontext_addr + 36;
+}
+
/* Solaris 2. */
static void
@@ -71,6 +85,10 @@ i386_sol2_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
tdep->sizeof_gregset = 19 * 4;
tdep->sizeof_fpregset = 380;
+ tdep->sigcontext_addr = i386_sol2_mcontext_addr;
+ tdep->sc_reg_offset = tdep->gregset_reg_offset;
+ tdep->sc_num_regs = tdep->gregset_num_regs;
+
/* Signal trampolines are slightly different from SVR4. */
set_gdbarch_pc_in_sigtramp (gdbarch, i386_sol2_pc_in_sigtramp);
}