24#include "elf/common.h"
36#include "gdbsupport/x86-xstate.h"
44#ifndef PTRACE_ARCH_PRCTL
45#define PTRACE_ARCH_PRCTL 30
79 -1, -1, -1, -1, -1, -1, -1, -1,
80 -1, -1, -1, -1, -1, -1, -1, -1,
81 -1, -1, -1, -1, -1, -1, -1, -1, -1,
82 -1, -1, -1, -1, -1, -1, -1, -1,
85 -1, -1, -1, -1, -1, -1, -1, -1,
86 -1, -1, -1, -1, -1, -1, -1, -1,
152 void *ptr = ((gdb_byte *) gregs
155 *(int64_t *) ptr = *(int32_t *) ptr;
175 elf_gregset_t *gregsetp,
int regnum)
197 elf_fpregset_t *fpregsetp,
int regnum)
226 perror_with_name (_(
"Couldn't get registers"));
235 elf_fpregset_t fpregs;
247 memset (xstateregs, 0,
sizeof (xstateregs));
248 iov.iov_base = xstateregs;
249 iov.iov_len =
sizeof (xstateregs);
251 (
unsigned int) NT_X86_XSTATE, (
long) &iov) < 0)
252 perror_with_name (_(
"Couldn't get extended state status"));
259 perror_with_name (_(
"Couldn't get floating point status"));
287 perror_with_name (_(
"Couldn't get registers"));
292 perror_with_name (_(
"Couldn't write registers"));
300 elf_fpregset_t fpregs;
307 iov.iov_base = xstateregs;
308 iov.iov_len =
sizeof (xstateregs);
310 (
unsigned int) NT_X86_XSTATE, (
long) &iov) < 0)
311 perror_with_name (_(
"Couldn't get extended state status"));
316 (
unsigned int) NT_X86_XSTATE, (
long) &iov) < 0)
317 perror_with_name (_(
"Couldn't write extended state status"));
322 perror_with_name (_(
"Couldn't get floating point status"));
327 perror_with_name (_(
"Couldn't write floating point status"));
338 lwpid_t lwpid,
int idx,
void **base)
342 unsigned int base_addr;
351 (*base) = (
void *) (
long) base_addr;
368 fs =
ptrace (PTRACE_PEEKUSER, lwpid,
369 offsetof (
struct user_regs_struct, fs_base), 0);
383 gs =
ptrace (PTRACE_PEEKUSER, lwpid,
384 offsetof (
struct user_regs_struct, gs_base), 0);
void _initialize_amd64_linux_nat()
void fill_gregset(const struct regcache *regcache, elf_gregset_t *gregsetp, int regnum)
static amd64_linux_nat_target the_amd64_linux_nat_target
void fill_fpregset(const struct regcache *regcache, elf_fpregset_t *fpregsetp, int regnum)
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
void supply_gregset(struct regcache *regcache, const elf_gregset_t *gregsetp)
static int amd64_linux_gregset32_reg_offset[]
static void amd64_linux_collect_native_gregset(const struct regcache *regcache, void *gregs, int regnum)
void supply_fpregset(struct regcache *regcache, const elf_fpregset_t *fpregsetp)
int amd64_linux_siginfo_fixup_common(siginfo_t *ptrace, gdb_byte *inf, int direction, enum amd64_siginfo_fixup_mode mode)
int amd64_linux_gregset_reg_offset[]
#define AMD64_LINUX_NUM_REGS
int amd64_native_gregset32_num_regs
void amd64_collect_native_gregset(const struct regcache *regcache, void *gregs, int regnum)
int * amd64_native_gregset32_reg_offset
int amd64_native_gregset64_num_regs
int * amd64_native_gregset64_reg_offset
void amd64_supply_native_gregset(struct regcache *regcache, const void *gregs, int regnum)
int amd64_native_gregset_supplies_p(struct gdbarch *gdbarch, int regnum)
void amd64_collect_xsave(const struct regcache *regcache, int regnum, void *xsave, int gcore)
void amd64_supply_fxsave(struct regcache *regcache, int regnum, const void *fxsave)
void amd64_supply_xsave(struct regcache *regcache, int regnum, const void *xsave)
void amd64_collect_fxsave(const struct regcache *regcache, int regnum, void *fxsave)
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
frame_info_ptr get_current_frame(void)
#define ptrace(request, pid, addr, data)
int gdbarch_addr_bit(struct gdbarch *gdbarch)
const struct bfd_arch_info * gdbarch_bfd_arch_info(struct gdbarch *gdbarch)
#define I386_LINUX_NUM_REGS
void add_inf_child_target(inf_child_target *target)
struct linux_nat_target * linux_target
enum tribool have_ptrace_getregset
void fetch_registers(struct regcache *, int) override
void store_registers(struct regcache *, int) override
bool low_siginfo_fixup(siginfo_t *ptrace, gdb_byte *inf, int direction) override
x86_xsave_layout xsave_layout
ps_err_e x86_linux_get_thread_area(pid_t pid, void *addr, unsigned int *base_addr)