38#include <sys/procfs.h>
47#include "floatformat.h"
57#ifndef PTRACE_GET_THREAD_AREA
58#define PTRACE_GET_THREAD_AREA 25
75 PT_D0, PT_D1, PT_D2, PT_D3, PT_D4, PT_D5, PT_D6, PT_D7,
76 PT_A0, PT_A1, PT_A2, PT_A3, PT_A4, PT_A5, PT_A6, PT_USP,
79 21, 24, 27, 30, 33, 36, 39, 42,
87#define MAX_NUM_REGS (NUM_GREGS + 11)
103#ifdef HAVE_PTRACE_GETREGS
125 regaddr = 4 *
regmap[regno];
129 val =
ptrace (PTRACE_PEEKUSER, tid, regaddr, 0);
130 memcpy (&buf[i], &val,
sizeof (
long));
131 regaddr +=
sizeof (long);
133 error (_(
"Couldn't read register %s (#%d): %s."),
135 regno, safe_strerror (errno));
173 regaddr = 4 *
regmap[regno];
182 memcpy (&val, &buf[i],
sizeof (
long));
183 ptrace (PTRACE_POKEUSER, tid, regaddr, val);
184 regaddr +=
sizeof (long);
186 error (_(
"Couldn't write register %s (#%d): %s."),
188 regno, safe_strerror (errno));
222 const elf_greg_t *regp = (
const elf_greg_t *) gregsetp;
238 elf_gregset_t *gregsetp,
int regno)
240 elf_greg_t *regp = (elf_greg_t *) gregsetp;
244 if (regno == -1 || regno == i)
248#ifdef HAVE_PTRACE_GETREGS
268 perror_with_name (_(
"Couldn't get registers"));
283 perror_with_name (_(
"Couldn't get registers"));
288 perror_with_name (_(
"Couldn't write registers"));
307#define FPREG_ADDR(f, n) (&(f)->fpregs[(n) * 3])
333 elf_fpregset_t *fpregsetp,
int regno)
341 if (regno == -1 || regno == i)
347 if (regno == -1 || regno == i)
351#ifdef HAVE_PTRACE_GETREGS
359 elf_fpregset_t fpregs;
362 perror_with_name (_(
"Couldn't get floating point status"));
373 elf_fpregset_t fpregs;
376 perror_with_name (_(
"Couldn't get floating point status"));
381 perror_with_name (_(
"Couldn't write floating point status"));
448 internal_error (_(
"Got request for bad register number %d."), regno);
491 internal_error (_(
"Got request to store bad register number %d."), regno);
499 lwpid_t lwpid,
int idx,
void **base)
507 *base = (
char *) *base - idx;
void store_registers(struct regcache *, int) override
void fetch_registers(struct regcache *, int) override
void raw_collect(int regnum, void *buf) const override
void raw_supply(int regnum, const void *buf) override
#define ptrace(request, pid, addr, data)
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
const char * gdbarch_register_name(struct gdbarch *gdbarch, int regnr)
int gdbarch_num_regs(struct gdbarch *gdbarch)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
int gdbarch_ps_regnum(struct gdbarch *gdbarch)
int gdbarch_fp0_regnum(struct gdbarch *gdbarch)
void add_inf_child_target(inf_child_target *target)
pid_t get_ptrace_pid(ptid_t ptid)
struct linux_nat_target * linux_target
void fill_fpregset(const struct regcache *regcache, elf_fpregset_t *fpregsetp, int regno)
#define PTRACE_GET_THREAD_AREA
static void fetch_register(struct regcache *regcache, int regno)
void fill_gregset(const struct regcache *regcache, elf_gregset_t *gregsetp, int regno)
static int getfpregs_supplies(int regno)
void _initialize_m68k_linux_nat()
static void fetch_fpregs(struct regcache *regcache, int tid)
static void fetch_regs(struct regcache *regcache, int tid)
static void store_regs(const struct regcache *regcache, int tid, int regno)
static void store_register(const struct regcache *regcache, int regno)
static int have_ptrace_getregs
static int getregs_supplies(int regno)
ps_err_e ps_get_thread_area(struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base)
static void old_store_inferior_registers(const struct regcache *regcache, int regno)
void supply_gregset(struct regcache *regcache, const elf_gregset_t *gregsetp)
static const int regmap[]
static void old_fetch_inferior_registers(struct regcache *regcache, int regno)
static void store_fpregs(const struct regcache *regcache, int tid, int regno)
void supply_fpregset(struct regcache *regcache, const elf_fpregset_t *fpregsetp)
static m68k_linux_nat_target the_m68k_linux_nat_target
#define M68K_MAX_REGISTER_SIZE
int register_size(struct gdbarch *gdbarch, int regnum)