aboutsummaryrefslogtreecommitdiff
path: root/gdb/i386-tdep.h
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-05-31 16:08:06 +0000
committerMark Kettenis <kettenis@gnu.org>2003-05-31 16:08:06 +0000
commita338618604d020a6e8bde2f5e298a7e41abe290c (patch)
tree3ed44cb0d3bc55d72a54291a74bd58c4e26d717c /gdb/i386-tdep.h
parent25ab47902d12c8ffca6ab50b2b17151f1d86ce9b (diff)
downloadgdb-a338618604d020a6e8bde2f5e298a7e41abe290c.zip
gdb-a338618604d020a6e8bde2f5e298a7e41abe290c.tar.gz
gdb-a338618604d020a6e8bde2f5e298a7e41abe290c.tar.bz2
From Michal Ludvig <mludvig@suse.cz>:
* i386-tdep.h (struct gdbarch_tdep): Add members `sc_reg_offset' and `sc_num_regs'. (I386_EAX_REGNUM, I386_EDX_REGNUM, I386_ESP_REGNUM, I386_EBP_REGNUM, I386_EIP_REGNUM, I386_EFLAGS_REGNUM, I386_ST0_REGNUM): Move here from... * i386-tdep.c: ... here. (I386_NUM_SAVED_REGS): Define to I386_NUM_REGS. (i386_sigtramp_frame_cache): Use `sc_reg_offset' to find saved registers if possible. (i386_gdbarch_init): Initialize TDEP->sc_reg_offset. * i386bsd-tdep.c (i386bsd_sc_pc_offset, i386bsd_sc_sp_offset): Remove variables. (i386bsd_sc_reg_offset): New variable. (i386bsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. (i386fbsd_sc_reg_offset): New variable. (i386fbsdaout_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs. (i386fbsd4_sc_pc_offset, i386fbsd4_sc_sp_offset): Remove variables. (i386fbsd4_sc_reg_offset): New variable. (i3864bsd4_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386-linux-tdep.c (i386_linux_sc_reg_offset): New variable. (i386_linux_init_abi): Set TDEP->sc_reg_offset and TDEP->sc_num_regs. * i386nbsd-tdep.c (i386nbsd_sc_pc_offset, i386nbsd_sc_sp_offset): Remove variables. (i386nbsd_sc_reg_offset): New variable. (i386nbsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386obsd-tdep.c (i386obsd_sc_pc_offset, i386obsd_sc_sp_offset): Remove variables. (i386obsd_sc_reg_offset): New variable. (i386obsd_init_abi): Initialize TDEP->sc_reg_offset and TDEP->sc_num_regs instead of TDEP->sc_pc_offset and TDEP->sc_sp_offset. * i386bsd-nat.c (_initialize_i386bsd_nat): Adjust for changes in i386bsd-tdep.c, i386nbsd-tdep.c and i386obsd-tdep.c. Add check for frame pointer offset in `struct sigcontext'.
Diffstat (limited to 'gdb/i386-tdep.h')
-rw-r--r--gdb/i386-tdep.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index b2c2dff..38eac20 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -71,7 +71,12 @@ struct gdbarch_tdep
/* Get address of sigcontext for sigtramp. */
CORE_ADDR (*sigcontext_addr) (struct frame_info *);
- /* Offset of saved PC and SP in `struct sigcontext'. */
+ /* Offset of registers in `struct sigcontext'. */
+ int *sc_reg_offset;
+ int sc_num_regs;
+
+ /* Offset of saved PC and SP in `struct sigcontext'. Usage of these
+ is deprecated, please use `sc_reg_offset' instead. */
int sc_pc_offset;
int sc_sp_offset;
};
@@ -137,6 +142,16 @@ extern int i386_mxcsr_regnum_p (int regnum);
#define FDS_REGNUM FOSEG_REGNUM
#define FDOFF_REGNUM FOOFF_REGNUM
+/* Register numbers of various important registers. */
+
+#define I386_EAX_REGNUM 0 /* %eax */
+#define I386_EDX_REGNUM 2 /* %edx */
+#define I386_ESP_REGNUM 4 /* %esp */
+#define I386_EBP_REGNUM 5 /* %ebp */
+#define I386_EIP_REGNUM 8 /* %eip */
+#define I386_EFLAGS_REGNUM 9 /* %eflags */
+#define I386_ST0_REGNUM 16 /* %st(0) */
+
#define I386_NUM_GREGS 16
#define I386_NUM_FREGS 16
#define I386_NUM_XREGS 9