/* Cache and manage the values of registers for GDB, the GNU debugger.
Copyright 1986, 1987, 1989, 1991, 1994, 1995, 1996, 1998, 2000,
- 2001, 2002 Free Software Foundation, Inc.
+ 2001, 2002, 2004 Free Software Foundation, Inc.
This file is part of GDB.
for (i = 0; i < descr->nr_cooked_registers; i++)
{
/* FIXME: cagney/2001-12-04: This code shouldn't need to use
- DEPRECATED_REGISTER_BYTE(). Unfortunatly, legacy code likes
+ DEPRECATED_REGISTER_BYTE(). Unfortunately, legacy code likes
to lay the buffer out so that certain registers just happen
to overlap. Ulgh! New targets use gdbarch's register
read/write and entirely avoid this uglyness. */
descr->register_offset[i] = DEPRECATED_REGISTER_BYTE (i);
- descr->sizeof_register[i] = REGISTER_RAW_SIZE (i);
- gdb_assert (MAX_REGISTER_SIZE >= REGISTER_RAW_SIZE (i));
- gdb_assert (MAX_REGISTER_SIZE >= REGISTER_VIRTUAL_SIZE (i));
+ descr->sizeof_register[i] = DEPRECATED_REGISTER_RAW_SIZE (i);
+ gdb_assert (MAX_REGISTER_SIZE >= DEPRECATED_REGISTER_RAW_SIZE (i));
+ gdb_assert (MAX_REGISTER_SIZE >= DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
}
/* Compute the real size of the register buffer. Start out by
descr->sizeof_cooked_registers = regend;
}
/* FIXME: cagney/2002-05-11: Shouldn't be including pseudo-registers
- in the register cache. Unfortunatly some architectures still
+ in the register cache. Unfortunately some architectures still
rely on this and the pseudo_register_write() method. */
descr->sizeof_raw_registers = descr->sizeof_cooked_registers;
}
/* If an old style architecture, fill in the remainder of the
register cache descriptor using the register macros. */
/* NOTE: cagney/2003-06-29: If either of DEPRECATED_REGISTER_BYTE or
- REGISTER_RAW_SIZE are still present, things are most likely
+ DEPRECATED_REGISTER_RAW_SIZE are still present, things are most likely
totally screwed. Ex: an architecture with raw register sizes
smaller than what DEPRECATED_REGISTER_BYTE indicates; non
monotonic DEPRECATED_REGISTER_BYTE values. For GDB 6 check for
if ((!gdbarch_pseudo_register_read_p (gdbarch)
&& !gdbarch_pseudo_register_write_p (gdbarch)
&& !gdbarch_register_type_p (gdbarch))
- || DEPRECATED_REGISTER_BYTE_P () || REGISTER_RAW_SIZE_P ())
+ || DEPRECATED_REGISTER_BYTE_P ()
+ || DEPRECATED_REGISTER_RAW_SIZE_P ())
{
descr->legacy_p = 1;
init_legacy_regcache_descr (gdbarch, descr);
}
/* FIXME: cagney/2002-05-22: Should only need to allocate space for
- the raw registers. Unfortunatly some code still accesses the
+ the raw registers. Unfortunately some code still accesses the
register array directly using the global registers[]. Until that
code has been purged, play safe and over allocating the register
buffer. Ulgh! */
if (DEPRECATED_REGISTER_BYTE_P ())
gdb_assert (descr->register_offset[i] == DEPRECATED_REGISTER_BYTE (i));
#if 0
- gdb_assert (descr->sizeof_register[i] == REGISTER_RAW_SIZE (i));
- gdb_assert (descr->sizeof_register[i] == REGISTER_VIRTUAL_SIZE (i));
+ gdb_assert (descr->sizeof_register[i] == DEPRECATED_REGISTER_RAW_SIZE (i));
+ gdb_assert (descr->sizeof_register[i] == DEPRECATED_REGISTER_VIRTUAL_SIZE (i));
#endif
}
/* gdb_assert (descr->sizeof_raw_registers == DEPRECATED_REGISTER_BYTES (i)); */
int size;
gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
size = descr->sizeof_register[regnum];
- /* NB: The deprecated REGISTER_RAW_SIZE, if not provided, defaults
+ /* NB: The deprecated DEPRECATED_REGISTER_RAW_SIZE, if not provided, defaults
to the size of the register's type. */
- gdb_assert (size == REGISTER_RAW_SIZE (regnum)); /* OK */
+ gdb_assert (size == DEPRECATED_REGISTER_RAW_SIZE (regnum)); /* OK */
/* NB: Don't check the register's virtual size. It, in say the case
of the MIPS, may not match the raw size! */
return size;
gdb_assert (src->descr->gdbarch == dst->descr->gdbarch);
/* NOTE: cagney/2002-05-17: Don't let the caller do a no-passthrough
move of data into the current_regcache(). Doing this would be
- silly - it would mean that valid_p would be completly invalid. */
+ silly - it would mean that valid_p would be completely invalid. */
gdb_assert (dst != current_regcache);
memcpy (dst->registers, src->registers, dst->descr->sizeof_raw_registers);
memcpy (dst->register_valid_p, src->register_valid_p,
int byte;
reg_start = DEPRECATED_REGISTER_BYTE (regnum);
- reg_len = REGISTER_RAW_SIZE (regnum);
+ reg_len = DEPRECATED_REGISTER_RAW_SIZE (regnum);
reg_end = reg_start + reg_len;
if (reg_end <= in_start || in_end <= reg_start)
target_fetch_registers (regnum);
memcpy (myaddr, register_buffer (current_regcache, regnum),
- REGISTER_RAW_SIZE (regnum));
+ DEPRECATED_REGISTER_RAW_SIZE (regnum));
}
void
registers_ptid = inferior_ptid;
}
- size = REGISTER_RAW_SIZE (regnum);
+ size = DEPRECATED_REGISTER_RAW_SIZE (regnum);
if (real_register (regnum))
{
int regstart, regend;
regstart = DEPRECATED_REGISTER_BYTE (regnum);
- regend = regstart + REGISTER_RAW_SIZE (regnum);
+ regend = regstart + DEPRECATED_REGISTER_RAW_SIZE (regnum);
/* Is this register completely outside the range the user is writing? */
if (myregend <= regstart || regend <= myregstart)
ULONGEST
read_register (int regnum)
{
- char *buf = alloca (REGISTER_RAW_SIZE (regnum));
+ char *buf = alloca (DEPRECATED_REGISTER_RAW_SIZE (regnum));
deprecated_read_register_gen (regnum, buf);
- return (extract_unsigned_integer (buf, REGISTER_RAW_SIZE (regnum)));
+ return (extract_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (regnum)));
}
ULONGEST
{
void *buf;
int size;
- size = REGISTER_RAW_SIZE (regnum);
+ size = DEPRECATED_REGISTER_RAW_SIZE (regnum);
buf = alloca (size);
store_signed_integer (buf, size, (LONGEST) val);
deprecated_write_register_gen (regnum, buf);
void
generic_target_write_pc (CORE_ADDR pc, ptid_t ptid)
{
-#ifdef PC_REGNUM
if (PC_REGNUM >= 0)
write_register_pid (PC_REGNUM, pc, ptid);
- if (DEPRECATED_NPC_REGNUM >= 0)
- write_register_pid (DEPRECATED_NPC_REGNUM, pc + 4, ptid);
-#else
- internal_error (__FILE__, __LINE__,
- "generic_target_write_pc");
-#endif
+ else
+ internal_error (__FILE__, __LINE__,
+ "generic_target_write_pc");
}
void
fprintf_unfiltered (file, " %5ld",
regcache->descr->sizeof_register[regnum]);
if ((regcache->descr->sizeof_register[regnum]
- != REGISTER_RAW_SIZE (regnum))
+ != DEPRECATED_REGISTER_RAW_SIZE (regnum))
|| (regcache->descr->sizeof_register[regnum]
- != REGISTER_VIRTUAL_SIZE (regnum))
+ != DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum))
|| (regcache->descr->sizeof_register[regnum]
!= TYPE_LENGTH (register_type (regcache->descr->gdbarch,
regnum)))
regcache_raw_read (regcache, regnum, buf);
fprintf_unfiltered (file, "0x");
dump_endian_bytes (file, TARGET_BYTE_ORDER, buf,
- REGISTER_RAW_SIZE (regnum));
+ DEPRECATED_REGISTER_RAW_SIZE (regnum));
}
}
regcache_cooked_read (regcache, regnum, buf);
fprintf_unfiltered (file, "0x");
dump_endian_bytes (file, TARGET_BYTE_ORDER, buf,
- REGISTER_VIRTUAL_SIZE (regnum));
+ DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum));
}
}
_initialize_regcache (void)
{
regcache_descr_handle = register_gdbarch_data (init_regcache_descr);
- REGISTER_GDBARCH_SWAP (current_regcache);
- register_gdbarch_swap (&deprecated_registers, sizeof (deprecated_registers), NULL);
- register_gdbarch_swap (&deprecated_register_valid, sizeof (deprecated_register_valid), NULL);
- register_gdbarch_swap (NULL, 0, build_regcache);
+ DEPRECATED_REGISTER_GDBARCH_SWAP (current_regcache);
+ DEPRECATED_REGISTER_GDBARCH_SWAP (deprecated_registers);
+ DEPRECATED_REGISTER_GDBARCH_SWAP (deprecated_register_valid);
+ deprecated_register_gdbarch_swap (NULL, 0, build_regcache);
add_com ("flushregs", class_maintenance, reg_flush_command,
"Force gdb to flush its register cache (maintainer command)");