- registers_fetched ();
- return;
- }
-
- /* else an individual register is addressed. */
-
- else if (regno < FP0_REGNUM) { /* a GPR */
- *(int*)®isters[REGISTER_BYTE (regno)] =
- ptrace (PT_READ_GPR, inferior_pid, (PTRACE_ARG3_TYPE) regno, 0, 0);
- }
- else if (regno <= FPLAST_REGNUM) { /* a FPR */
- ptrace (PT_READ_FPR, inferior_pid,
- (PTRACE_ARG3_TYPE) ®isters [REGISTER_BYTE (regno)],
- (regno-FP0_REGNUM+FPR0), 0);
- }
- else if (regno <= LAST_SP_REGNUM) { /* a special register */
- *(int*)®isters[REGISTER_BYTE (regno)] =
- ptrace (PT_READ_GPR, inferior_pid,
- (PTRACE_ARG3_TYPE) special_regs[regno-FIRST_SP_REGNUM], 0, 0);
- }
+static void vmap_symtab (struct vmap *);
+
+static void fetch_core_registers (char *, unsigned int, int, CORE_ADDR);
+
+static void exec_one_dummy_insn (void);
+
+extern void
+fixup_breakpoints (CORE_ADDR low, CORE_ADDR high, CORE_ADDR delta);
+
+/* Given REGNO, a gdb register number, return the corresponding
+ number suitable for use as a ptrace() parameter. Return -1 if
+ there's no suitable mapping. Also, set the int pointed to by
+ ISFLOAT to indicate whether REGNO is a floating point register. */
+
+static int
+regmap (int regno, int *isfloat)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
+
+ *isfloat = 0;
+ if (tdep->ppc_gp0_regnum <= regno && regno <= tdep->ppc_gplast_regnum)
+ return regno;
+ else if (FP0_REGNUM <= regno && regno <= FPLAST_REGNUM)
+ {
+ *isfloat = 1;
+ return regno - FP0_REGNUM + FPR0;
+ }
+ else if (regno == PC_REGNUM)
+ return IAR;
+ else if (regno == tdep->ppc_ps_regnum)
+ return MSR;
+ else if (regno == tdep->ppc_cr_regnum)
+ return CR;
+ else if (regno == tdep->ppc_lr_regnum)
+ return LR;
+ else if (regno == tdep->ppc_ctr_regnum)
+ return CTR;
+ else if (regno == tdep->ppc_xer_regnum)
+ return XER;
+ else if (regno == tdep->ppc_fpscr_regnum)
+ return FPSCR;
+ else if (tdep->ppc_mq_regnum >= 0 && regno == tdep->ppc_mq_regnum)
+ return MQ;