35 #include <sys/ioctl.h> 37 #include <sys/procfs.h> 46 #include "floatformat.h" 56 #ifndef PTRACE_GET_THREAD_AREA 57 #define PTRACE_GET_THREAD_AREA 25 63 PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7,
64 PT_A0, PT_A1, PT_A2, PT_A3, PT_A4, PT_A5, PT_A6, PT_USP,
67 21, 24, 27, 30, 33, 36, 39, 42,
74 #define NUM_GREGS (18) 75 #define MAX_NUM_REGS (NUM_GREGS + 11) 91 #ifdef HAVE_PTRACE_GETREGS 113 regaddr = 4 *
regmap[regno];
117 val =
ptrace (PTRACE_PEEKUSER,
tid, regaddr, 0);
118 memcpy (&buf[i], &val,
sizeof (
long));
119 regaddr +=
sizeof (
long);
121 error (
_(
"Couldn't read register %s (#%d): %s."),
161 regaddr = 4 *
regmap[regno];
170 memcpy (&val, &buf[i],
sizeof (
long));
171 ptrace (PTRACE_POKEUSER,
tid, regaddr, val);
172 regaddr +=
sizeof (
long);
174 error (
_(
"Couldn't write register %s (#%d): %s."),
210 const elf_greg_t *regp = (
const elf_greg_t *) gregsetp;
228 elf_gregset_t *gregsetp,
int regno)
230 elf_greg_t *regp = (elf_greg_t *) gregsetp;
234 if (regno == -1 || regno == i)
238 #ifdef HAVE_PTRACE_GETREGS 297 #define FPREG_ADDR(f, n) (&(f)->fpregs[(n) * 3]) 324 elf_fpregset_t *fpregsetp,
int regno)
332 if (regno == -1 || regno == i)
339 if (regno == -1 || regno == i)
344 #ifdef HAVE_PTRACE_GETREGS 352 elf_fpregset_t fpregs;
366 elf_fpregset_t fpregs;
443 _(
"Got request for bad register number %d."), regno);
488 _(
"Got request to store bad register number %d."), regno);
496 lwpid_t lwpid,
int idx,
void **base)
504 *base = (
char *) *base - idx;
static constexpr ptid_t tid
void fill_fpregset(const struct regcache *regcache, elf_fpregset_t *fpregsetp, int regno)
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
#define PTRACE_GET_THREAD_AREA
#define M68K_MAX_REGISTER_SIZE
ptid_t regcache_get_ptid(const struct regcache *regcache)
void internal_error(const char *file, int line, const char *fmt,...)
static void store_register(const struct regcache *regcache, int regno)
int gdbarch_num_regs(struct gdbarch *gdbarch)
int gdbarch_ps_regnum(struct gdbarch *gdbarch)
void fill_gregset(const struct regcache *regcache, elf_gregset_t *gregsetp, int regno)
static void fetch_register(struct regcache *regcache, int regno)
static const int regmap[]
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
static void old_store_inferior_registers(const struct regcache *regcache, int regno)
static int getfpregs_supplies(int regno)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
void linux_nat_add_target(struct target_ops *t)
static void fetch_fpregs(struct regcache *regcache, int tid)
static void store_fpregs(const struct regcache *regcache, int tid, int regno)
struct target_ops * linux_target(void)
static void store_regs(const struct regcache *regcache, int tid, int regno)
static void old_fetch_inferior_registers(struct regcache *regcache, int regno)
void supply_fpregset(struct regcache *regcache, const elf_fpregset_t *fpregsetp)
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
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
static int have_ptrace_getregs
char * safe_strerror(int)
void supply_gregset(struct regcache *regcache, const elf_gregset_t *gregsetp)
void regcache_raw_supply(struct regcache *regcache, int regnum, const void *buf)
static int getregs_supplies(int regno)
static void m68k_linux_fetch_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regno)
int register_size(struct gdbarch *gdbarch, int regnum)
void regcache_raw_collect(const struct regcache *regcache, int regnum, void *buf)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
pid_t get_ptrace_pid(ptid_t ptid)
void _initialize_m68k_linux_nat(void)
static void fetch_regs(struct regcache *regcache, int tid)
void(* to_store_registers)(struct target_ops *, struct regcache *, int) TARGET_DEFAULT_NORETURN(noprocess())
static void m68k_linux_store_inferior_registers(struct target_ops *ops, struct regcache *regcache, int regno)
void error(const char *fmt,...)