- regs[ARM_PC_REGNUM] = gdbarch_addr_bits_remove
- (get_regcache_arch (regcache), regs[ARM_PC_REGNUM]);
- regcache_raw_supply (regcache, ARM_PC_REGNUM,
- (char *) ®s[ARM_PC_REGNUM]);
-}
-
-/* Store all general registers of the process from the values in
- regcache. */
-
-static void
-store_register (const struct regcache *regcache, int regno)
-{
- int ret, tid;
- elf_gregset_t regs;
-
- if (REG_VALID != regcache_register_status (regcache, regno))
- return;
-
- /* Get the thread id for the ptrace call. */
- tid = GET_THREAD_ID (inferior_ptid);
-
- /* Get the general registers from the process. */
- if (have_ptrace_getregset)
- {
- struct iovec iov;
-
- iov.iov_base = ®s;
- iov.iov_len = sizeof (regs);
-
- ret = ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iov);
- }
- else
- ret = ptrace (PTRACE_GETREGS, tid, 0, ®s);
-
- if (ret < 0)
- {
- warning (_("Unable to fetch general registers."));
- return;
- }
-
- if (regno >= ARM_A1_REGNUM && regno <= ARM_PC_REGNUM)
- regcache_raw_collect (regcache, regno, (char *) ®s[regno]);
- else if (arm_apcs_32 && regno == ARM_PS_REGNUM)
- regcache_raw_collect (regcache, regno,
- (char *) ®s[ARM_CPSR_GREGNUM]);
- else if (!arm_apcs_32 && regno == ARM_PS_REGNUM)
- regcache_raw_collect (regcache, ARM_PC_REGNUM,
- (char *) ®s[ARM_PC_REGNUM]);
-
- if (have_ptrace_getregset)
- {
- struct iovec iov;
-
- iov.iov_base = ®s;
- iov.iov_len = sizeof (regs);
-
- ret = ptrace (PTRACE_SETREGSET, tid, NT_PRSTATUS, &iov);
- }
- else
- ret = ptrace (PTRACE_SETREGS, tid, 0, ®s);
-
- if (ret < 0)
- {
- warning (_("Unable to store general register."));
- return;
- }