static void fetch_fpregister (struct regcache *regcache, int regno) { int ret, tid; gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE]; /* Get the thread id for the ptrace call. */ tid = GET_THREAD_ID (inferior_ptid); /* Read the floating point state. */ ret = ptrace (PT_GETFPREGS, tid, 0, fp); if (ret < 0) { warning (_("Unable to fetch floating point register.")); return; } /* Fetch fpsr. */ if (ARM_FPS_REGNUM == regno) regcache_raw_supply (regcache, ARM_FPS_REGNUM, fp + NWFPE_FPSR_OFFSET); /* Fetch the floating point register. */ if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM) supply_nwfpe_register (regcache, regno, fp); }
void arm_linux_supply_nwfpe (const struct regset *regset, struct regcache *regcache, int regnum, const void *regs_buf, size_t len) { const gdb_byte *regs = regs_buf; int regno; if (regnum == ARM_FPS_REGNUM || regnum == -1) regcache_raw_supply (regcache, ARM_FPS_REGNUM, regs + NWFPE_FPSR_OFFSET); for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++) if (regnum == -1 || regnum == regno) supply_nwfpe_register (regcache, regno, regs); }
static void fetch_fpregister (struct regcache *regcache, int regno) { int ret, tid; gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE]; /* Get the thread id for the ptrace call. */ tid = GET_THREAD_ID (inferior_ptid); /* Read the floating point state. */ if (have_ptrace_getregset == TRIBOOL_TRUE) { struct iovec iov; iov.iov_base = &fp; iov.iov_len = ARM_LINUX_SIZEOF_NWFPE; ret = ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iov); } else ret = ptrace (PT_GETFPREGS, tid, 0, fp); if (ret < 0) { warning (_("Unable to fetch floating point register.")); return; } /* Fetch fpsr. */ if (ARM_FPS_REGNUM == regno) regcache_raw_supply (regcache, ARM_FPS_REGNUM, fp + NWFPE_FPSR_OFFSET); /* Fetch the floating point register. */ if (regno >= ARM_F0_REGNUM && regno <= ARM_F7_REGNUM) supply_nwfpe_register (regcache, regno, fp); }