static void ppcnbsd_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum) { struct gdbarch *gdbarch = get_regcache_arch (regcache); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) { struct reg regs; if (ptrace (PT_GETREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); ppc_supply_gregset (&ppcnbsd_gregset, regcache, regnum, ®s, sizeof regs); } if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) { struct fpreg fpregs; if (ptrace (PT_GETFPREGS, ptid_get_pid (inferior_ptid), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get FP registers")); ppc_supply_fpregset (&ppcnbsd_fpregset, regcache, regnum, &fpregs, sizeof fpregs); } }
static void ppcobsd_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regnum) { struct reg regs; if (ptrace (PT_GETREGS, PIDGET (inferior_ptid), (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); ppc_supply_gregset (&ppcobsd_gregset, regcache, -1, ®s, sizeof regs); #ifndef PT_GETFPREGS ppc_supply_fpregset (&ppcobsd_gregset, regcache, -1, ®s, sizeof regs); #endif #ifdef PT_GETFPREGS if (regnum == -1 || getfpregs_supplies (get_regcache_arch (regcache), regnum)) { struct fpreg fpregs; if (ptrace (PT_GETFPREGS, PIDGET (inferior_ptid), (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); ppc_supply_fpregset (&ppcobsd_fpregset, regcache, -1, &fpregs, sizeof fpregs); } #endif }
void supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp) { const struct regset *regset = ppc_linux_gregset (sizeof (long)); ppc_supply_gregset (regset, regcache, -1, gregsetp, sizeof (*gregsetp)); }
static void rs6000_aix_supply_regset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { ppc_supply_gregset (regset, regcache, regnum, gregs, len); ppc_supply_fpregset (regset, regcache, regnum, gregs, len); }
void ppcobsd_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { ppc_supply_gregset (regset, regcache, regnum, gregs, len); ppc_supply_fpregset (regset, regcache, regnum, gregs, len); }
static void ppc_linux_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { const struct ppc_reg_offsets *offsets = regset->descr; ppc_supply_gregset (regset, regcache, regnum, gregs, len); if (ppc_linux_trap_reg_p (get_regcache_arch (regcache))) { /* "orig_r3" is stored 2 slots after "pc". */ if (regnum == -1 || regnum == PPC_ORIG_R3_REGNUM) ppc_supply_reg (regcache, PPC_ORIG_R3_REGNUM, gregs, offsets->pc_offset + 2 * offsets->gpr_size, offsets->gpr_size); /* "trap" is stored 8 slots after "pc". */ if (regnum == -1 || regnum == PPC_TRAP_REGNUM) ppc_supply_reg (regcache, PPC_TRAP_REGNUM, gregs, offsets->pc_offset + 8 * offsets->gpr_size, offsets->gpr_size); } }