diff options
Diffstat (limited to 'gdb/i386-tdep.h')
-rw-r--r-- | gdb/i386-tdep.h | 80 |
1 files changed, 62 insertions, 18 deletions
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h index 0bdbb057e2f..64af99d1e66 100644 --- a/gdb/i386-tdep.h +++ b/gdb/i386-tdep.h @@ -1,5 +1,5 @@ /* Target-dependent code for GDB, the GNU debugger. - Copyright 2001 + Copyright 2001, 2002 Free Software Foundation, Inc. This file is part of GDB. @@ -22,6 +22,8 @@ #ifndef I386_TDEP_H #define I386_TDEP_H +#include "osabi.h" + /* GDB's i386 target supports both the 32-bit Intel Architecture (IA-32) and the 64-bit AMD x86-64 architecture. Internally it uses a similar register layout for both. @@ -40,30 +42,38 @@ differs and is determined by the num_xmm_regs member of `struct gdbarch_tdep'. */ -/* ABI variants that we know about. */ -enum i386_abi -{ - I386_ABI_UNKNOWN = 0, - - /* ELF */ - I386_ABI_SVR4, /* This is the default. */ - I386_ABI_NETBSD, - I386_ABI_LINUX, - I386_ABI_HURD, - I386_ABI_SOLARIS, - I386_ABI_FREEBSD, +/* Convention for returning structures. */ - I386_ABI_INVALID = -1 +enum struct_return +{ + pcc_struct_return, /* Return "short" structures in memory. */ + reg_struct_return /* Return "short" structures in registers. */ }; /* i386 architecture specific information. */ struct gdbarch_tdep { /* ABI. */ - enum i386_abi abi; + enum gdb_osabi osabi; /* Number of SSE registers. */ int num_xmm_regs; + + /* Offset of saved PC in jmp_buf. */ + int jb_pc_offset; + + /* Convention for returning structures. */ + enum struct_return struct_return; + + /* Get saved PC for sigtramp. */ + CORE_ADDR (*sigtramp_saved_pc) (struct frame_info *); + + /* Address range where sigtramp lives. */ + CORE_ADDR sigtramp_start; + CORE_ADDR sigtramp_end; + + /* Offset of saved PC in `struct sigcontext'. */ + int sc_pc_offset; }; /* Floating-point registers. */ @@ -129,8 +139,42 @@ struct gdbarch_tdep #define IS_FPU_CTRL_REGNUM(n) FPC_REGNUM_P (n) #define IS_SSE_REGNUM(n) SSE_REGNUM_P (n) -void i386_gdbarch_register_os_abi (enum i386_abi, - void (*init_abi)(struct gdbarch_info, - struct gdbarch *)); +#define I386_NUM_GREGS 16 +#define I386_NUM_FREGS 16 +#define I386_NUM_XREGS 9 + +#define I386_SSE_NUM_REGS (I386_NUM_GREGS + I386_NUM_FREGS \ + + I386_NUM_XREGS) + +/* Sizes of individual register sets. These cover the entire register + file, so summing up the sizes of those portions actually present + yields REGISTER_BYTES. */ +#define I386_SIZEOF_GREGS (I386_NUM_GREGS * 4) +#define I386_SIZEOF_FREGS (8 * 10 + 8 * 4) +#define I386_SIZEOF_XREGS (8 * 16 + 4) + +#define I386_SSE_SIZEOF_REGS (I386_SIZEOF_GREGS + I386_SIZEOF_FREGS \ + + I386_SIZEOF_XREGS) + +/* Return the name of register REG. */ +extern char *i386_register_name (int reg); + +/* Return the offset into the register array of the start of register + number REG. */ +extern int i386_register_byte (int reg); + +/* Return the number of bytes of storage in GDB's register array + occupied by register REG. */ +extern int i386_register_raw_size (int reg); + +/* Initialize a basic ELF architecture variant. */ +extern void i386_elf_init_abi (struct gdbarch_info, struct gdbarch *); + +/* Initialize a SVR4 architecture variant. */ +extern void i386_svr4_init_abi (struct gdbarch_info, struct gdbarch *); + +/* Functions exported from i386bsd-tdep.c. */ + +extern CORE_ADDR i386bsd_sigtramp_saved_pc (struct frame_info *frame); #endif /* i386-tdep.h */ |