2002-08-13 Andrew Cagney <cagney@redhat.com>
* regcache.c (init_regcache_descr): Overallocate the raw_register_valid_p array including space for NUM_PSEUDO_REGS. (registers_changed): Replace NUM_REGS+NUM_PSEUDO_REGS with num_raw_registers. (set_register_cached): Add range checking assertions. Use current_regcache.
This commit is contained in:
parent
cd2b29395d
commit
53826de97c
@ -1,3 +1,12 @@
|
||||
2002-08-13 Andrew Cagney <cagney@redhat.com>
|
||||
|
||||
* regcache.c (init_regcache_descr): Overallocate the
|
||||
raw_register_valid_p array including space for NUM_PSEUDO_REGS.
|
||||
(registers_changed): Replace NUM_REGS+NUM_PSEUDO_REGS with
|
||||
nr_raw_registers.
|
||||
(set_register_cached): Add range checking assertions. Use
|
||||
current_regcache.
|
||||
|
||||
2002-08-13 Mark Kettenis <kettenis@elgar.kettenis.dyndns.org>
|
||||
|
||||
* i386-tdep.c (i386_stab_reg_to_regnum): Return correct register
|
||||
|
@ -161,7 +161,12 @@ init_regcache_descr (struct gdbarch *gdbarch)
|
||||
/* Construct a strictly RAW register cache. Don't allow pseudo's
|
||||
into the register cache. */
|
||||
descr->nr_raw_registers = NUM_REGS;
|
||||
descr->sizeof_raw_register_valid_p = NUM_REGS;
|
||||
|
||||
/* FIXME: cagney/2002-08-13: Overallocate the register_valid_p
|
||||
array. This pretects GDB from erant code that accesses elements
|
||||
of the global register_valid_p[] array in the range [NUM_REGS
|
||||
.. NUM_REGS + NUM_PSEUDO_REGS). */
|
||||
descr->sizeof_raw_register_valid_p = NUM_REGS + NUM_PSEUDO_REGS;
|
||||
|
||||
/* Lay out the register cache. The pseud-registers are included in
|
||||
the layout even though their value isn't stored in the register
|
||||
@ -431,7 +436,9 @@ register_cached (int regnum)
|
||||
void
|
||||
set_register_cached (int regnum, int state)
|
||||
{
|
||||
register_valid[regnum] = state;
|
||||
gdb_assert (regnum >= 0);
|
||||
gdb_assert (regnum < current_regcache->descr->nr_raw_registers);
|
||||
current_regcache->raw_register_valid_p[regnum] = state;
|
||||
}
|
||||
|
||||
/* REGISTER_CHANGED
|
||||
@ -485,7 +492,7 @@ registers_changed (void)
|
||||
gdb gives control to the user (ie watchpoints). */
|
||||
alloca (0);
|
||||
|
||||
for (i = 0; i < NUM_REGS + NUM_PSEUDO_REGS; i++)
|
||||
for (i = 0; i < current_regcache->descr->nr_raw_registers; i++)
|
||||
set_register_cached (i, 0);
|
||||
|
||||
if (registers_changed_hook)
|
||||
|
Loading…
x
Reference in New Issue
Block a user