25 #include <sys/types.h> 26 #include <sys/ptrace.h> 27 #include <machine/reg.h> 28 #include <machine/frame.h> 43 #define REG_OFFSET(member) offsetof (struct reg, member) 64 #ifdef HAVE_STRUCT_REG_R_FS 69 #ifdef HAVE_STRUCT_REG_R_GS 77 #define GETREGS_SUPPLIES(regnum) \ 78 ((0 <= (regnum) && (regnum) <= 15)) 80 #ifdef HAVE_PT_GETXMMREGS 83 static int have_ptrace_xmmregs = -1;
92 const char *regs = (
const char *) gregs;
112 char *regs = (
char *) gregs;
151 #ifdef HAVE_PT_GETXMMREGS 155 #ifdef PT_GETXSTATE_INFO 170 #ifdef HAVE_PT_GETXMMREGS 171 if (have_ptrace_xmmregs != 0
174 have_ptrace_xmmregs = 1;
179 have_ptrace_xmmregs = 0;
185 #ifdef HAVE_PT_GETXMMREGS 219 #ifdef HAVE_PT_GETXMMREGS 223 #ifdef PT_GETXSTATE_INFO 242 #ifdef HAVE_PT_GETXMMREGS 243 if (have_ptrace_xmmregs != 0
246 have_ptrace_xmmregs = 1;
255 have_ptrace_xmmregs = 0;
264 #ifdef HAVE_PT_GETXMMREGS 295 #if defined (__FreeBSD_version) && __FreeBSD_version >= 400011 296 #define SC_REG_OFFSET i386fbsd4_sc_reg_offset 297 #elif defined (__FreeBSD_version) && __FreeBSD_version >= 300005 298 #define SC_REG_OFFSET i386fbsd_sc_reg_offset 299 #elif defined (NetBSD) || defined (__NetBSD_Version__) 300 #define SC_REG_OFFSET i386nbsd_sc_reg_offset 301 #elif defined (OpenBSD) 302 #define SC_REG_OFFSET i386obsd_sc_reg_offset 313 #define SC_PC_OFFSET SC_REG_OFFSET[I386_EIP_REGNUM] 314 #define SC_SP_OFFSET SC_REG_OFFSET[I386_ESP_REGNUM] 315 #define SC_FP_OFFSET SC_REG_OFFSET[I386_EBP_REGNUM] 319 offset = offsetof (
struct sigcontext, sc_pc);
321 if (SC_PC_OFFSET !=
offset)
324 offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\ 325 Please report this to <bug-gdb@gnu.org>."),
332 offset = offsetof (
struct sigcontext, sc_sp);
334 if (SC_SP_OFFSET !=
offset)
337 offsetof (struct sigcontext, sc_sp) yields %d instead of %d.\n\ 338 Please report this to <bug-gdb@gnu.org>."),
345 offset = offsetof (
struct sigcontext, sc_fp);
347 if (SC_FP_OFFSET !=
offset)
350 offsetof (struct sigcontext, sc_fp) yields %d instead of %d.\n\ 351 Please report this to <bug-gdb@gnu.org>."),
void i387_collect_fsave(const struct regcache *regcache, int regnum, void *fsave)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
void warning(const char *fmt,...)
void i387_supply_fxsave(struct regcache *regcache, int regnum, const void *fxsave)
#define REG_OFFSET(member)
ptid_t regcache_get_ptid(const struct regcache *regcache)
void i387_supply_fsave(struct regcache *regcache, int regnum, const void *fsave)
static void i386bsd_supply_gregset(struct regcache *regcache, const void *gregs)
#define GETREGS_SUPPLIES(regnum)
void _initialize_i386bsd_nat(void)
struct target_ops * x86bsd_target(void)
void i387_collect_fxsave(const struct regcache *regcache, int regnum, void *fxsave)
static void i386bsd_store_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
void i387_collect_xsave(const struct regcache *regcache, int regnum, void *xsave, int gcore)
static int i386bsd_r_reg_offset[]
void(* to_fetch_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_IGNORE()
void void void void void void void void void perror_with_name(const char *string) ATTRIBUTE_NORETURN
static void i386bsd_collect_gregset(const struct regcache *regcache, void *gregs, int regnum)
struct target_ops * i386bsd_target(void)
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
static void i386bsd_fetch_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regnum)
pid_t get_ptrace_pid(ptid_t ptid)
void i387_supply_xsave(struct regcache *regcache, int regnum, const void *xsave)
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())