* gdbarch.sh (deprecated_register_bytes): Delete.
* gdbarch.h, gdbarch.c: Re-generate.
* regcache.c (deprecated_register_bytes): New function.
* regcache.h (deprecated_register_bytes): Declare.
* xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
* v850-tdep.c (v850_gdbarch_init): Update.
* sh64-tdep.c (sh64_gdbarch_init): Update.
* ns32k-tdep.c (ns32k_gdbarch_init_32082): Update.
* mn10300-tdep.c (mn10300_gdbarch_init): Update.
* mcore-tdep.c (mcore_gdbarch_init): Update.
* cris-tdep.c (cris_gdbarch_init): Update.
* arm-tdep.c (arm_gdbarch_init): Update.
* remote.c (init_remote_state): Update.
* remote-vx.c (vx_prepare_to_store): Update.
* remote-sds.c (sds_fetch_registers, sds_prepare_to_store): Update.
* irix5-nat.c (fetch_core_registers): Update.
* cris-tdep.c (cris_register_bytes_ok): Update.
* config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update.
2004-08-02 Andrew Cagney <cagney@gnu.org>
+ * gdbarch.sh (deprecated_register_bytes): Delete.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * regcache.c (deprecated_register_bytes): New function.
+ * regcache.h (deprecated_register_bytes): Declare.
+ * xstormy16-tdep.c (xstormy16_gdbarch_init): Update.
+ * v850-tdep.c (v850_gdbarch_init): Update.
+ * sh64-tdep.c (sh64_gdbarch_init): Update.
+ * ns32k-tdep.c (ns32k_gdbarch_init_32082): Update.
+ * mn10300-tdep.c (mn10300_gdbarch_init): Update.
+ * mcore-tdep.c (mcore_gdbarch_init): Update.
+ * cris-tdep.c (cris_gdbarch_init): Update.
+ * arm-tdep.c (arm_gdbarch_init): Update.
+ * remote.c (init_remote_state): Update.
+ * remote-vx.c (vx_prepare_to_store): Update.
+ * remote-sds.c (sds_fetch_registers, sds_prepare_to_store): Update.
+ * irix5-nat.c (fetch_core_registers): Update.
+ * cris-tdep.c (cris_register_bytes_ok): Update.
+ * config/nm-gnu.h (CHILD_PREPARE_TO_STORE): Update.
+
* mips-tdep.c (mips_gdbarch_init, mips_insn16_frame_cache)
(mips_insn16_frame_this_id, mips_insn16_frame_prev_register)
(mips_insn16_frame_unwind, mips_insn16_frame_sniffer)
set_gdbarch_sp_regnum (gdbarch, ARM_SP_REGNUM);
set_gdbarch_pc_regnum (gdbarch, ARM_PC_REGNUM);
set_gdbarch_deprecated_register_byte (gdbarch, arm_register_byte);
- set_gdbarch_deprecated_register_bytes (gdbarch,
- (NUM_GREGS * INT_REGISTER_SIZE
- + NUM_FREGS * FP_REGISTER_SIZE
- + NUM_SREGS * STATUS_REGISTER_SIZE));
set_gdbarch_num_regs (gdbarch, NUM_GREGS + NUM_FREGS + NUM_SREGS);
set_gdbarch_register_type (gdbarch, arm_register_type);
extern char *gnu_target_pid_to_str (int pid);
/* Before storing, we need to read all the registers. */
-#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES)
+#define CHILD_PREPARE_TO_STORE() deprecated_read_register_bytes (0, NULL, deprecated_register_bytes ())
/* Don't do wait_for_inferior on attach. */
#define ATTACH_NO_WAIT
static int
cris_register_bytes_ok (long bytes)
{
- return (bytes == DEPRECATED_REGISTER_BYTES);
+ return (bytes == deprecated_register_bytes ());
}
/* Extract from an array regbuf containing the raw register state a function
internal_error (__FILE__, __LINE__, "cris_gdbarch_init: unknown CRIS version");
}
- set_gdbarch_deprecated_register_bytes (gdbarch, register_bytes);
-
/* Returns the register offset for the first byte of register regno's space
in the saved register state. */
set_gdbarch_deprecated_register_byte (gdbarch, cris_register_offset);
+2004-08-02 Andrew Cagney <cagney@gnu.org>
+
+ * gdbint.texinfo (Target Architecture Definition): Delete
+ description of DEPRECATED_REGISTER_BYTES.
+
2004-07-30 Baurjan Ismagulov <ibr@ata.cs.hun.edu.tr>
* gdb.texinfo (Source Path): Document the new behavior of
@page
@tex
\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
-\xdef\manvers{\$Revision: 1.214 $} % For use in headers, footers too
+\xdef\manvers{\$Revision: 1.215 $} % For use in headers, footers too
{\parskip=0pt
\hfill Cygnus Solutions\par
\hfill \manvers\par
This method replaces @code{CALL_DUMMY_LOCATION},
@code{DEPRECATED_REGISTER_SIZE}.
-@item DEPRECATED_REGISTER_BYTES
-@findex DEPRECATED_REGISTER_BYTES
-The total amount of space needed to store @value{GDBN}'s copy of the
-machine's register state.
-
-This is no longer needed. @value{GDBN} instead computes the size of the
-register buffer at run-time.
-
@item REGISTER_NAME(@var{i})
@findex REGISTER_NAME
Return the name of register @var{i} as a string. May return @code{NULL}
gdbarch_register_name_ftype *register_name;
gdbarch_register_type_ftype *register_type;
gdbarch_deprecated_register_virtual_type_ftype *deprecated_register_virtual_type;
- int deprecated_register_bytes;
gdbarch_deprecated_register_byte_ftype *deprecated_register_byte;
gdbarch_deprecated_register_raw_size_ftype *deprecated_register_raw_size;
gdbarch_deprecated_register_virtual_size_ftype *deprecated_register_virtual_size;
0, /* register_name */
0, /* register_type */
0, /* deprecated_register_virtual_type */
- 0, /* deprecated_register_bytes */
generic_register_byte, /* deprecated_register_byte */
generic_register_size, /* deprecated_register_raw_size */
generic_register_size, /* deprecated_register_virtual_size */
fprintf_unfiltered (file,
"gdbarch_dump: deprecated_register_byte = <0x%lx>\n",
(long) current_gdbarch->deprecated_register_byte);
-#ifdef DEPRECATED_REGISTER_BYTES
- fprintf_unfiltered (file,
- "gdbarch_dump: DEPRECATED_REGISTER_BYTES # %s\n",
- XSTRING (DEPRECATED_REGISTER_BYTES));
-#endif
- fprintf_unfiltered (file,
- "gdbarch_dump: deprecated_register_bytes = %s\n",
- paddr_d (current_gdbarch->deprecated_register_bytes));
#ifdef DEPRECATED_REGISTER_RAW_SIZE_P
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
}
int
-gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch)
-{
- gdb_assert (gdbarch != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_deprecated_register_bytes called\n");
- return gdbarch->deprecated_register_bytes;
-}
-
-void
-set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch,
- int deprecated_register_bytes)
-{
- gdbarch->deprecated_register_bytes = deprecated_register_bytes;
-}
-
-int
gdbarch_deprecated_register_byte_p (struct gdbarch *gdbarch)
{
gdb_assert (gdbarch != NULL);
#define DEPRECATED_REGISTER_VIRTUAL_TYPE(reg_nr) (gdbarch_deprecated_register_virtual_type (current_gdbarch, reg_nr))
#endif
-/* DEPRECATED_REGISTER_BYTES can be deleted. The value is computed
- from REGISTER_TYPE. */
-
-extern int gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch);
-extern void set_gdbarch_deprecated_register_bytes (struct gdbarch *gdbarch, int deprecated_register_bytes);
-#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (DEPRECATED_REGISTER_BYTES)
-#error "Non multi-arch definition of DEPRECATED_REGISTER_BYTES"
-#endif
-#if !defined (DEPRECATED_REGISTER_BYTES)
-#define DEPRECATED_REGISTER_BYTES (gdbarch_deprecated_register_bytes (current_gdbarch))
-#endif
-
/* If the value returned by DEPRECATED_REGISTER_BYTE agrees with the
register offsets computed using just REGISTER_TYPE, this can be
deleted. See: maint print registers. NOTE: cagney/2002-05-02: This
M::struct type *:register_type:int reg_nr:reg_nr
# REGISTER_TYPE is a direct replacement for DEPRECATED_REGISTER_VIRTUAL_TYPE.
F:=:struct type *:deprecated_register_virtual_type:int reg_nr:reg_nr
-# DEPRECATED_REGISTER_BYTES can be deleted. The value is computed
-# from REGISTER_TYPE.
-v:=:int:deprecated_register_bytes
# If the value returned by DEPRECATED_REGISTER_BYTE agrees with the
# register offsets computed using just REGISTER_TYPE, this can be
# deleted. See: maint print registers. NOTE: cagney/2002-05-02: This
fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
int which, CORE_ADDR reg_addr)
{
- if (core_reg_size == DEPRECATED_REGISTER_BYTES)
+ if (core_reg_size == deprecated_register_bytes ())
{
memcpy ((char *) deprecated_registers, core_reg_sect, core_reg_size);
}
set_gdbarch_deprecated_register_virtual_size (gdbarch, mcore_register_size);
set_gdbarch_deprecated_register_raw_size (gdbarch, mcore_register_size);
set_gdbarch_deprecated_register_byte (gdbarch, mcore_register_byte);
- set_gdbarch_deprecated_register_bytes (gdbarch, MCORE_REG_SIZE * MCORE_NUM_REGS);
set_gdbarch_num_regs (gdbarch, MCORE_NUM_REGS);
set_gdbarch_pc_regnum (gdbarch, 64);
set_gdbarch_sp_regnum (gdbarch, 0);
set_gdbarch_num_regs (gdbarch, num_regs);
set_gdbarch_register_name (gdbarch, register_name);
set_gdbarch_deprecated_register_size (gdbarch, 4);
- set_gdbarch_deprecated_register_bytes (gdbarch, num_regs * gdbarch_deprecated_register_size (gdbarch));
set_gdbarch_deprecated_register_raw_size (gdbarch, mn10300_register_raw_size);
set_gdbarch_deprecated_register_byte (gdbarch, mn10300_register_byte);
set_gdbarch_deprecated_register_virtual_size (gdbarch, mn10300_register_virtual_size);
set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32082);
set_gdbarch_register_name (gdbarch, ns32k_register_name_32082);
- set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32082);
set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32082);
}
set_gdbarch_num_regs (gdbarch, NS32K_NUM_REGS_32382);
set_gdbarch_register_name (gdbarch, ns32k_register_name_32382);
- set_gdbarch_deprecated_register_bytes (gdbarch, NS32K_REGISTER_BYTES_32382);
set_gdbarch_deprecated_register_byte (gdbarch, ns32k_register_byte_32382);
}
return descr->register_offset[regnum];
}
+/* Hack to keep code using register_bytes working. */
+
+int
+deprecated_register_bytes (void)
+{
+ return current_regcache->descr->sizeof_raw_registers;
+}
+
/* Return the contents of register REGNUM as an unsigned integer. */
ULONGEST
extern int register_offset_hack (struct gdbarch *gdbarch, int regnum);
+/* Similar. The total number of bytes occupied by a regcache. */
+
+extern int deprecated_register_bytes (void );
+
/* The type of a register. This function is slightly more efficient
then its gdbarch vector counterpart since it returns a precomputed
{
unsigned char buf[PBUFSIZ];
int i, retlen;
- char *regs = alloca (DEPRECATED_REGISTER_BYTES);
+ char *regs = alloca (deprecated_register_bytes ());
/* Unimplemented registers read as all bits zero. */
- memset (regs, 0, DEPRECATED_REGISTER_BYTES);
+ memset (regs, 0, deprecated_register_bytes ());
buf[0] = 18;
buf[1] = 1;
sds_prepare_to_store (void)
{
/* Make sure the entire registers array is valid. */
- deprecated_read_register_bytes (0, (char *) NULL, DEPRECATED_REGISTER_BYTES);
+ deprecated_read_register_bytes (0, (char *) NULL, deprecated_register_bytes ());
}
/* Store register REGNO, or all registers if REGNO == -1, from the contents
vx_prepare_to_store (void)
{
/* Fetch all registers, if any of them are not yet fetched. */
- deprecated_read_register_bytes (0, NULL, DEPRECATED_REGISTER_BYTES);
+ deprecated_read_register_bytes (0, NULL, deprecated_register_bytes ());
}
/* Copy LEN bytes to or from remote inferior's memory starting at MEMADDR
int regnum;
struct remote_state *rs = GDBARCH_OBSTACK_ZALLOC (gdbarch, struct remote_state);
- if (DEPRECATED_REGISTER_BYTES != 0)
- rs->sizeof_g_packet = DEPRECATED_REGISTER_BYTES;
+ if (deprecated_register_bytes () != 0)
+ rs->sizeof_g_packet = deprecated_register_bytes ();
else
rs->sizeof_g_packet = 0;
/* ...name = REGISTER_NAME (regnum); */
/* Compute packet size by accumulating the size of all registers. */
- if (DEPRECATED_REGISTER_BYTES == 0)
+ if (deprecated_register_bytes () == 0)
rs->sizeof_g_packet += register_size (current_gdbarch, regnum);
}
/* The number of real registers is the same whether we are in
ISA16(compact) or ISA32(media). */
set_gdbarch_num_regs (gdbarch, SIM_SH64_NR_REGS);
- set_gdbarch_deprecated_register_bytes (gdbarch,
- ((SIM_SH64_NR_FP_REGS + 1) * 4)
- + (SIM_SH64_NR_REGS - SIM_SH64_NR_FP_REGS -1) * 8);
set_gdbarch_register_name (gdbarch, sh64_register_name);
set_gdbarch_register_type (gdbarch, sh64_register_type);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, v850_register_name);
set_gdbarch_deprecated_register_size (gdbarch, v850_reg_size);
- set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_deprecated_register_byte (gdbarch, v850_register_byte);
set_gdbarch_deprecated_register_raw_size (current_gdbarch, gdbarch, v850_register_raw_size);
set_gdbarch_deprecated_register_virtual_size (gdbarch, v850_register_raw_size);
set_gdbarch_pc_regnum (gdbarch, E_PC_REGNUM);
set_gdbarch_register_name (gdbarch, xstormy16_register_name);
set_gdbarch_deprecated_register_size (gdbarch, xstormy16_reg_size);
- set_gdbarch_deprecated_register_bytes (gdbarch, E_ALL_REGS_SIZE);
set_gdbarch_deprecated_register_byte (gdbarch, xstormy16_register_byte);
set_gdbarch_deprecated_register_raw_size (gdbarch, xstormy16_register_raw_size);
set_gdbarch_deprecated_register_virtual_size (gdbarch, xstormy16_register_raw_size);