summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-11-07 02:40:28 +0000
committerAndrew Cagney <cagney@redhat.com>2002-11-07 02:40:28 +0000
commit92d232f518f20eefde8cc9d85b4953cbbc24aa09 (patch)
tree98fd63e43b351e5d693ddb7726b40614626290f5
parent4e9c57853c15eae2ec7455abce5f6ea13f65cfd4 (diff)
downloadgdb-92d232f518f20eefde8cc9d85b4953cbbc24aa09.tar.gz
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.
-rw-r--r--gdb/ChangeLog11
-rw-r--r--gdb/alpha-nat.c6
-rw-r--r--gdb/i386gnu-nat.c6
-rw-r--r--gdb/ia64-aix-nat.c6
-rw-r--r--gdb/lynx-nat.c14
-rw-r--r--gdb/regcache.c16
-rw-r--r--gdb/regcache.h17
-rw-r--r--gdb/remote-mips.c2
-rw-r--r--gdb/sparc-nat.c36
9 files changed, 65 insertions, 49 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e28370eb382..7f6838188f6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,14 @@
+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
diff --git a/gdb/alpha-nat.c b/gdb/alpha-nat.c
index 580dcc0e809..ef468f50693 100644
--- a/gdb/alpha-nat.c
+++ b/gdb/alpha-nat.c
@@ -135,7 +135,7 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size,
/* The FPU Registers. */
memcpy (&registers[REGISTER_BYTE (FP0_REGNUM)], core_reg_sect, 31 * 8);
memset (&registers[REGISTER_BYTE (FP0_REGNUM + 31)], 0, 8);
- memset (&register_valid[FP0_REGNUM], 1, 32);
+ memset (&deprecated_register_valid[FP0_REGNUM], 1, 32);
}
else
{
@@ -144,8 +144,8 @@ fetch_elf_core_registers (char *core_reg_sect, unsigned core_reg_size,
31 * 8);
memcpy (&registers[REGISTER_BYTE (PC_REGNUM)], core_reg_sect + 31 * 8, 8);
memset (&registers[REGISTER_BYTE (ALPHA_ZERO_REGNUM)], 0, 8);
- memset (&register_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;
}
}
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index 3fa99a34d88..82f9ee57647 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -184,7 +184,7 @@ store_fpregs (struct proc *thread, int regno)
}
/* 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,
@@ -266,14 +266,14 @@ gnu_store_registers (int regno)
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);
}
diff --git a/gdb/ia64-aix-nat.c b/gdb/ia64-aix-nat.c
index c41cc7cc88c..dbf664c0c11 100644
--- a/gdb/ia64-aix-nat.c
+++ b/gdb/ia64-aix-nat.c
@@ -71,11 +71,11 @@ supply_gregset (prgregset_t *gregsetp)
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
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index 9cd1672d336..8f8f15ea894 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -299,7 +299,7 @@ fetch_inferior_registers (int regno)
memcpy (&registers[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);
@@ -310,7 +310,7 @@ fetch_inferior_registers (int regno)
memcpy (&registers[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)
@@ -324,13 +324,13 @@ fetch_inferior_registers (int regno)
&registers[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,
&registers[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)
@@ -348,7 +348,7 @@ fetch_inferior_registers (int regno)
memcpy (&registers[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);
}
@@ -411,7 +411,7 @@ store_inferior_registers (int regno)
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,
&registers[REGISTER_BYTE (I0_REGNUM)],
@@ -423,7 +423,7 @@ store_inferior_registers (int regno)
}
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)
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 16a520cb5af..14162f2a2ba 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -418,7 +418,7 @@ deprecated_grub_regcache_for_register_valid (struct regcache *regcache)
/* 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
@@ -430,7 +430,7 @@ struct regcache *current_regcache;
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.
@@ -441,7 +441,7 @@ char *registers;
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. */
@@ -460,7 +460,7 @@ static ptid_t registers_ptid;
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
@@ -675,7 +675,7 @@ regcache_raw_read (struct regcache *regcache, int regnum, void *buf)
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;
}
@@ -850,7 +850,7 @@ regcache_raw_write (struct regcache *regcache, int regnum, const void *buf)
{
/* 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;
@@ -1455,7 +1455,7 @@ build_regcache (void)
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
@@ -1737,7 +1737,7 @@ _initialize_regcache (void)
xfree_regcache_descr);
REGISTER_GDBARCH_SWAP (current_regcache);
register_gdbarch_swap (&registers, sizeof (registers), NULL);
- register_gdbarch_swap (&register_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,
diff --git a/gdb/regcache.h b/gdb/regcache.h
index a15fc369d99..e2c17fd8dbc 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -149,12 +149,6 @@ extern int max_register_size (struct gdbarch *gdbarch);
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.
@@ -188,6 +182,17 @@ extern char *deprecated_grub_regcache_for_register_valid (struct regcache *);
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);
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index a1df0eb94e9..abd590bef2b 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -3443,7 +3443,7 @@ mips_load (char *file, int from_tty)
/* 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));
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index e892fe8fbda..611f50d578a 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -73,7 +73,7 @@ fetch_inferior_registers (int regno)
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))
@@ -88,16 +88,16 @@ fetch_inferior_registers (int regno)
*(int *) &registers[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 */
@@ -115,8 +115,8 @@ fetch_inferior_registers (int regno)
&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
@@ -127,17 +127,17 @@ fetch_inferior_registers (int regno)
target_read_memory (sp, &registers[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),
&registers[i], REGISTER_RAW_SIZE (regno));
- register_valid[regno] = 1;
+ deprecated_register_valid[regno] = 1;
}
}
@@ -199,7 +199,7 @@ store_inferior_registers (int regno)
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,
&registers[REGISTER_BYTE (L0_REGNUM)],
@@ -207,7 +207,7 @@ store_inferior_registers (int regno)
}
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),
&registers[REGISTER_BYTE (regno)],
@@ -218,7 +218,7 @@ store_inferior_registers (int 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, &registers[REGISTER_BYTE (G1_REGNUM)],
@@ -240,7 +240,7 @@ store_inferior_registers (int regno)
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, &registers[REGISTER_BYTE (FP0_REGNUM)],
sizeof inferior_fp_registers.fpu_fr);