static void mips_fbsd_fetch_inferior_registers (struct target_ops *ops, struct regcache *regcache, int regnum) { pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache)); struct gdbarch *gdbarch = regcache->arch (); if (regnum == -1 || getregs_supplies (gdbarch, regnum)) { struct reg regs; if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); mips_fbsd_supply_gregs (regcache, regnum, ®s, sizeof (register_t)); } if (regnum == -1 || getfpregs_supplies (gdbarch, regnum)) { struct fpreg fpregs; if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); mips_fbsd_supply_fpregs (regcache, regnum, &fpregs, sizeof (f_register_t)); } }
static void mips_fbsd_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { size_t regsize = mips_abi_regsize (regcache->arch ()); gdb_assert (len >= MIPS_FBSD_NUM_GREGS * regsize); mips_fbsd_supply_gregs (regcache, regnum, gregs, regsize); }