* regcache.h (deprecated_register_valid): Rename register_valid.
* regcache.c: Update.
* ia64-aix-nat.c: Update.
* i386gnu-nat.c: Update.
* alpha-nat.c: Update.
* sparc-nat.c: Update.
* lynx-nat.c: Update.
* remote-mips.c: Update.
+2002-11-06 Andrew Cagney <ac131313@redhat.com>
+
+ * regcache.h (deprecated_register_valid): Rename register_valid.
+ * regcache.c: Update.
+ * ia64-aix-nat.c: Update.
+ * i386gnu-nat.c: Update.
+ * alpha-nat.c: Update.
+ * sparc-nat.c: Update.
+ * lynx-nat.c: Update.
+ * remote-mips.c: Update.
+
2002-11-06 Joel Brobecker <brobecker@gnat.com>
* hppa-tdep.c (_initialize_hppa_tdep): Move function body
/* The FPU Registers. */
memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31 * 8);
memset (®isters[REGISTER_BYTE (FP0_REGNUM + 31)], 0, 8);
- memset (®ister_valid[FP0_REGNUM], 1, 32);
+ memset (&deprecated_register_valid[FP0_REGNUM], 1, 32);
}
else
{
31 * 8);
memcpy (®isters[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
memset (®isters[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8);
- memset (®ister_valid[ALPHA_V0_REGNUM], 1, 32);
- register_valid[PC_REGNUM] = 1;
+ memset (&deprecated_register_valid[ALPHA_V0_REGNUM], 1, 32);
+ deprecated_register_valid[PC_REGNUM] = 1;
}
}
}
/* FIXME: kettenis/2001-07-15: Is this right? Should we somehow
- take into account REGISTER_VALID like the old code did? */
+ take into account DEPRECATED_REGISTER_VALID like the old code did? */
i387_fill_fsave (state.hw_state, regno);
err = thread_set_state (thread->port, i386_FLOAT_STATE,
proc_debug (thread, "storing all registers");
for (i = 0; i < I386_NUM_GREGS; i++)
- if (register_valid[i])
+ if (deprecated_register_valid[i])
fill (state, i);
}
else
{
proc_debug (thread, "storing register %s", REGISTER_NAME (regno));
- gdb_assert (register_valid[regno]);
+ gdb_assert (deprecated_register_valid[regno]);
fill (state, regno);
}
by other means. Those that aren't are already handled by the
code above. */
for (regi = IA64_GR32_REGNUM; regi <= IA64_GR127_REGNUM; regi++)
- register_valid[regi] = 1;
+ deprecated_register_valid[regi] = 1;
for (regi = IA64_PR0_REGNUM; regi <= IA64_PR63_REGNUM; regi++)
- register_valid[regi] = 1;
+ deprecated_register_valid[regi] = 1;
for (regi = IA64_VFP_REGNUM; regi <= NUM_REGS; regi++)
- register_valid[regi] = 1;
+ deprecated_register_valid[regi] = 1;
}
void
memcpy (®isters[REGISTER_BYTE (G1_REGNUM)], &ec.g1,
4 * REGISTER_RAW_SIZE (G1_REGNUM));
for (i = G1_REGNUM; i <= G1_REGNUM + 3; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
supply_register (PS_REGNUM, (char *) &ec.psr);
supply_register (Y_REGNUM, (char *) &ec.y);
memcpy (®isters[REGISTER_BYTE (O0_REGNUM)], ec.o,
8 * REGISTER_RAW_SIZE (O0_REGNUM));
for (i = O0_REGNUM; i <= O0_REGNUM + 7; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
}
if (whatregs & WHATREGS_STACK)
®isters[REGISTER_BYTE (I0_REGNUM)],
8 * REGISTER_RAW_SIZE (I0_REGNUM));
for (i = I0_REGNUM; i <= I7_REGNUM; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
target_read_memory (sp + FRAME_SAVED_L0,
®isters[REGISTER_BYTE (L0_REGNUM)],
8 * REGISTER_RAW_SIZE (L0_REGNUM));
for (i = L0_REGNUM; i <= L0_REGNUM + 7; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
}
if (whatregs & WHATREGS_FLOAT)
memcpy (®isters[REGISTER_BYTE (FP0_REGNUM)], fc.f.fregs,
32 * REGISTER_RAW_SIZE (FP0_REGNUM));
for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
supply_register (FPS_REGNUM, (char *) &fc.fsr);
}
if (regno == -1 || regno == SP_REGNUM)
{
- if (!register_valid[L0_REGNUM + 5])
+ if (!deprecated_register_valid[L0_REGNUM + 5])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp + FRAME_SAVED_I0,
®isters[REGISTER_BYTE (I0_REGNUM)],
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
{
- if (!register_valid[regno])
+ if (!deprecated_register_valid[regno])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
if (regno >= L0_REGNUM && regno <= L0_REGNUM + 7)
regoffset = REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM)
/* Global structure containing the current regcache. */
/* FIXME: cagney/2002-05-11: The two global arrays registers[] and
- register_valid[] currently point into this structure. */
+ deprecated_register_valid[] currently point into this structure. */
struct regcache *current_regcache;
/* NOTE: this is a write-through cache. There is no "dirty" bit for
char *registers;
-/* REGISTER_VALID is 0 if the register needs to be fetched,
+/* DEPRECATED_REGISTER_VALID is 0 if the register needs to be fetched,
1 if it has been fetched, and
-1 if the register value was not available.
system being debugged - some of the registers in such a system may
not have been saved. */
-signed char *register_valid;
+signed char *deprecated_register_valid;
/* The thread/process associated with the current set of registers. */
int
register_cached (int regnum)
{
- return register_valid[regnum];
+ return deprecated_register_valid[regnum];
}
/* Record that REGNUM's value is cached if STATE is >0, uncached but
gdb_assert (regcache == current_regcache);
/* For moment, just use underlying legacy code. Ulgh!!! This
silently and very indirectly updates the regcache's regcache
- via the global register_valid[]. */
+ via the global deprecated_register_valid[]. */
legacy_read_register_gen (regnum, buf);
return;
}
{
/* For moment, just use underlying legacy code. Ulgh!!! This
silently and very indirectly updates the regcache's buffers
- via the globals register_valid[] and registers[]. */
+ via the globals deprecated_register_valid[] and registers[]. */
gdb_assert (regcache == current_regcache);
legacy_write_register_gen (regnum, buf);
return;
current_regcache = regcache_xmalloc (current_gdbarch);
current_regcache->passthrough_p = 1;
registers = deprecated_grub_regcache_for_registers (current_regcache);
- register_valid = deprecated_grub_regcache_for_register_valid (current_regcache);
+ deprecated_register_valid = deprecated_grub_regcache_for_register_valid (current_regcache);
}
static void
xfree_regcache_descr);
REGISTER_GDBARCH_SWAP (current_regcache);
register_gdbarch_swap (®isters, sizeof (registers), NULL);
- register_gdbarch_swap (®ister_valid, sizeof (register_valid), NULL);
+ register_gdbarch_swap (&deprecated_register_valid, sizeof (deprecated_register_valid), NULL);
register_gdbarch_swap (NULL, 0, build_regcache);
add_com ("flushregs", class_maintenance, reg_flush_command,
extern char *registers;
-/* DEPRECATED: Character array containing the current state of each
- register (unavailable<0, invalid=0, valid>0) for the most recently
- referenced thread. */
-
-extern signed char *register_valid;
-
/* Copy/duplicate the contents of a register cache. By default, the
operation is pass-through. Writes to DST and reads from SRC will
go through to the target.
extern void deprecated_read_register_gen (int regnum, char *myaddr);
extern void deprecated_write_register_gen (int regnum, char *myaddr);
+/* Character array containing the current state of each register
+ (unavailable<0, invalid=0, valid>0) for the most recently
+ referenced thread. This global is often found in close proximity
+ to code that is directly manipulating the deprecated_registers[]
+ array. In such cases, it should be possible to replace the lot
+ with a call to supply_register(). If you find yourself in dire
+ straits, still needing access to the cache status bit, the
+ regcache_valid_p() and set_register_cached() functions are
+ available. */
+extern signed char *deprecated_register_valid;
+
extern int register_cached (int regnum);
extern void set_register_cached (int regnum, int state);
/* Work around problem where PMON monitor updates the PC after a load
to a different value than GDB thinks it has. The following ensures
that the write_pc() WILL update the PC value: */
- register_valid[PC_REGNUM] = 0;
+ deprecated_register_valid[PC_REGNUM] = 0;
}
if (exec_bfd)
write_pc (bfd_get_start_address (exec_bfd));
to the stack pointer. */
if (regno < O7_REGNUM /* including -1 */
|| regno >= Y_REGNUM
- || (!register_valid[SP_REGNUM] && regno < I7_REGNUM))
+ || (!deprecated_register_valid[SP_REGNUM] && regno < I7_REGNUM))
{
if (0 != ptrace (PTRACE_GETREGS, PIDGET (inferior_ptid),
(PTRACE_ARG3_TYPE) & inferior_registers, 0))
*(int *) ®isters[REGISTER_BYTE (Y_REGNUM)] = inferior_registers.r_y;
for (i = G0_REGNUM; i <= O7_REGNUM; i++)
- register_valid[i] = 1;
- register_valid[Y_REGNUM] = 1;
- register_valid[PS_REGNUM] = 1;
- register_valid[PC_REGNUM] = 1;
- register_valid[NPC_REGNUM] = 1;
+ deprecated_register_valid[i] = 1;
+ deprecated_register_valid[Y_REGNUM] = 1;
+ deprecated_register_valid[PS_REGNUM] = 1;
+ deprecated_register_valid[PC_REGNUM] = 1;
+ deprecated_register_valid[NPC_REGNUM] = 1;
/* If we don't set these valid, read_register_bytes() rereads
all the regs every time it is called! FIXME. */
- register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */
- register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */
+ deprecated_register_valid[WIM_REGNUM] = 1; /* Not true yet, FIXME */
+ deprecated_register_valid[TBR_REGNUM] = 1; /* Not true yet, FIXME */
+ deprecated_register_valid[CPS_REGNUM] = 1; /* Not true yet, FIXME */
}
/* Floating point registers */
&inferior_fp_registers.Fpu_fsr,
sizeof (FPU_FSR_TYPE));
for (i = FP0_REGNUM; i <= FP0_REGNUM + 31; i++)
- register_valid[i] = 1;
- register_valid[FPS_REGNUM] = 1;
+ deprecated_register_valid[i] = 1;
+ deprecated_register_valid[FPS_REGNUM] = 1;
}
/* These regs are saved on the stack by the kernel. Only read them
target_read_memory (sp, ®isters[REGISTER_BYTE (L0_REGNUM)],
16 * REGISTER_RAW_SIZE (L0_REGNUM));
for (i = L0_REGNUM; i <= I7_REGNUM; i++)
- register_valid[i] = 1;
+ deprecated_register_valid[i] = 1;
}
else if (regno >= L0_REGNUM && regno <= I7_REGNUM)
{
CORE_ADDR sp = *(unsigned int *) & registers[REGISTER_BYTE (SP_REGNUM)];
i = REGISTER_BYTE (regno);
- if (register_valid[regno])
+ if (deprecated_register_valid[regno])
printf_unfiltered ("register %d valid and read\n", regno);
target_read_memory (sp + i - REGISTER_BYTE (L0_REGNUM),
®isters[i], REGISTER_RAW_SIZE (regno));
- register_valid[regno] = 1;
+ deprecated_register_valid[regno] = 1;
}
}
if (regno < 0 || regno == SP_REGNUM)
{
- if (!register_valid[L0_REGNUM + 5])
+ if (!deprecated_register_valid[L0_REGNUM + 5])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp,
®isters[REGISTER_BYTE (L0_REGNUM)],
}
else
{
- if (!register_valid[regno])
+ if (!deprecated_register_valid[regno])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
target_write_memory (sp + REGISTER_BYTE (regno) - REGISTER_BYTE (L0_REGNUM),
®isters[REGISTER_BYTE (regno)],
if (wanna_store & INT_REGS)
{
- if (!register_valid[G1_REGNUM])
+ if (!deprecated_register_valid[G1_REGNUM])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
memcpy (&inferior_registers.r_g1, ®isters[REGISTER_BYTE (G1_REGNUM)],
if (wanna_store & FP_REGS)
{
- if (!register_valid[FP0_REGNUM + 9])
+ if (!deprecated_register_valid[FP0_REGNUM + 9])
internal_error (__FILE__, __LINE__, "failed internal consistency check");
memcpy (&inferior_fp_registers, ®isters[REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.fpu_fr);