sp = read_register (SP_REGNUM);
- target_xfer_memory (sp, ®isters[REGISTER_BYTE(I0_REGNUM)],
+ target_xfer_memory (sp + FRAME_SAVED_I0,
+ ®isters[REGISTER_BYTE(I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM), 0);
for (i = I0_REGNUM; i <= I7_REGNUM; i++)
register_valid[i] = 1;
- sp += 8 * REGISTER_RAW_SIZE (I0_REGNUM);
-
- target_xfer_memory (sp, ®isters[REGISTER_BYTE(L0_REGNUM)],
+ target_xfer_memory (sp + FRAME_SAVED_L0,
+ ®isters[REGISTER_BYTE(L0_REGNUM)],
8 * REGISTER_RAW_SIZE (L0_REGNUM), 0);
for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
register_valid[i] = 1;
{
if (!register_valid[L0_REGNUM+5])
abort();
- target_xfer_memory (sp, ®isters[REGISTER_BYTE (I0_REGNUM)],
+ target_xfer_memory (sp + FRAME_SAVED_I0,
+ ®isters[REGISTER_BYTE (I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM), 1);
- sp += 8 * REGISTER_RAW_SIZE (I0_REGNUM);
- target_xfer_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)],
+
+ target_xfer_memory (sp + FRAME_SAVED_L0,
+ ®isters[REGISTER_BYTE (L0_REGNUM)],
8 * REGISTER_RAW_SIZE (L0_REGNUM), 1);
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
abort();
if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
- + 8 * REGISTER_RAW_SIZE (I0_REGNUM);
+ + FRAME_SAVED_L0;
else
- regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (I0_REGNUM);
+ regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (I0_REGNUM)
+ + FRAME_SAVED_I0;
target_xfer_memory (sp + regoffset, ®isters[REGISTER_BYTE (regno)],
REGISTER_RAW_SIZE (regno), 1);
}
perror_with_name ("Sparc fetch_inferior_registers(ptrace)");
}
}
-#endif
+#endif /* SPARC */
#ifndef SPARC
ecp = registers_addr (inferior_pid);
- for (regno = reglo; regno <= reghi && regmap[regno] != -1; regno++)
+ for (regno = reglo; regno <= reghi; regno++)
{
char buf[MAX_REGISTER_RAW_SIZE];
int ptrace_fun = PTRACE_PEEKTHREAD;
ecp = registers_addr (inferior_pid);
- for (regno = reglo; regno <= reghi && regmap[regno] != -1; regno++)
+ for (regno = reglo; regno <= reghi; regno++)
{
int ptrace_fun = PTRACE_POKEUSER;
for (regno = 0; regno < NUM_REGS; regno++)
supply_register (regno, core_reg_sect + offsetof (st_t, ec)
+ regmap[regno]);
+
+#ifdef SPARC
+/* Fetching this register causes all of the I & L regs to be read from the
+ stack and validated. */
+
+ fetch_inferior_registers (I0_REGNUM);
+#endif
}