-
- switch (regno)
- {
- case ARM_SP_REGNUM:
- regcache->raw_supply (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
- break;
-
- case ARM_LR_REGNUM:
- regcache->raw_supply (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
- break;
-
- case ARM_PC_REGNUM:
- /* This is ok: we're running native... */
- inferior_registers.r_pc = gdbarch_addr_bits_remove
- (regcache->arch (),
- inferior_registers.r_pc);
- regcache->raw_supply (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
- break;
-
- case ARM_PS_REGNUM:
- if (arm_apcs_32)
- regcache->raw_supply (ARM_PS_REGNUM,
- (char *) &inferior_registers.r_cpsr);
- else
- regcache->raw_supply (ARM_PS_REGNUM,
- (char *) &inferior_registers.r_pc);
- break;
-
- default:
- regcache->raw_supply (regno, (char *) &inferior_registers.r[regno]);
- break;
- }
-}
-
-static void
-fetch_regs (struct regcache *regcache)
-{
- struct reg inferior_registers;
- int ret;
- int regno;
-
- ret = ptrace (PT_GETREGS, regcache->ptid ().pid (),
- (PTRACE_TYPE_ARG3) &inferior_registers, 0);
-
- if (ret < 0)
- {
- warning (_("unable to fetch general registers"));
- return;
- }
-
- arm_supply_gregset (regcache, &inferior_registers);
+ arm_nbsd_supply_gregset (nullptr, regcache, regno, &inferior_registers,
+ sizeof (inferior_registers));