aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2004-08-03 00:57:27 +0000
committerAndrew Cagney <cagney@redhat.com>2004-08-03 00:57:27 +0000
commit3acba3392386891d5e2c630fbe92871f8fa35838 (patch)
treed2802e74f1be1f7e45ad090dfbf04b42aaf5339e
parent8b060787673f88ceba3abedadca26d4bd7ce89db (diff)
downloadgdb-3acba3392386891d5e2c630fbe92871f8fa35838.zip
gdb-3acba3392386891d5e2c630fbe92871f8fa35838.tar.gz
gdb-3acba3392386891d5e2c630fbe92871f8fa35838.tar.bz2
2004-08-02 Andrew Cagney <cagney@gnu.org>
Replace DEPRECATED_REGISTER_RAW_SIZE with register_size. * rs6000-tdep.c (rs6000_push_dummy_call) (rs6000_extract_return_value): Use register_size. * xstormy16-tdep.c (xstormy16_get_saved_register) (xstormy16_extract_return_value): Ditto. * valops.c (value_assign): Ditto. * v850ice.c (v850ice_fetch_registers, v850ice_store_registers): * v850-tdep.c (v850_extract_return_value): Ditto. * tracepoint.c (collect_symbol): Ditto. * target.c (debug_print_register): Ditto. * stack.c (frame_info): Ditto. * rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto. * rom68k-rom.c (rom68k_supply_one_register): Ditto. * remote.c (struct packet_reg, remote_wait, remote_async_wait) (store_register_using_P): Ditto. * remote-vxmips.c (vx_read_register, vx_write_register): Ditto. * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto. * remote-mips.c (mips_wait, mips_fetch_registers): Ditto. * remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto. * regcache.c (deprecated_read_register_bytes) (deprecated_write_register_bytes, read_register) (write_register): Ditto. * ppc-linux-nat.c (fetch_altivec_register, fetch_register) (supply_vrregset, store_altivec_register, fill_vrregset): Ditto. * monitor.c (monitor_supply_register, monitor_fetch_register) (monitor_store_register): Ditto. * mn10300-tdep.c (mn10300_pop_frame_regular) (mn10300_print_register): Ditto. * mipsv4-nat.c (fill_fpregset): Ditto. * mips-linux-tdep.c (supply_32bit_reg, fill_fpregset) (mips64_fill_fpregset): Ditto. * mi/mi-main.c (register_changed_p, get_register) (mi_cmd_data_write_register_values): Ditto. * lynx-nat.c (fetch_inferior_registers, store_inferior_registers): * irix5-nat.c (fill_gregset, fetch_core_registers): * infrun.c (write_inferior_status_register): Ditto. * infptrace.c (fetch_register, store_register): Ditto. * infcmd.c (default_print_registers_info): Ditto. * ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto. * ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto. * i386gnu-nat.c (gnu_store_registers, fill): Ditto. * hpux-thread.c (hpux_thread_fetch_registers) (hpux_thread_store_registers): Ditto. * hppah-nat.c (store_inferior_registers, fetch_register): * findvar.c (value_from_register): Ditto. * dve3900-rom.c (fetch_bitmapped_register): * cris-tdep.c (cris_gdbarch_init): Ditto. * alpha-tdep.h: Ditto. * aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto.
-rw-r--r--gdb/ChangeLog50
-rw-r--r--gdb/aix-thread.c6
-rw-r--r--gdb/alpha-tdep.h5
-rw-r--r--gdb/cris-tdep.c4
-rw-r--r--gdb/dve3900-rom.c2
-rw-r--r--gdb/findvar.c6
-rw-r--r--gdb/hppah-nat.c21
-rw-r--r--gdb/hpux-thread.c14
-rw-r--r--gdb/i386gnu-nat.c4
-rw-r--r--gdb/ia64-aix-nat.c8
-rw-r--r--gdb/ia64-linux-nat.c4
-rw-r--r--gdb/infcmd.c4
-rw-r--r--gdb/infptrace.c4
-rw-r--r--gdb/infrun.c2
-rw-r--r--gdb/irix5-nat.c14
-rw-r--r--gdb/lynx-nat.c4
-rw-r--r--gdb/mi/mi-main.c10
-rw-r--r--gdb/mips-linux-tdep.c10
-rw-r--r--gdb/mipsv4-nat.c2
-rw-r--r--gdb/mn10300-tdep.c6
-rw-r--r--gdb/monitor.c6
-rw-r--r--gdb/ppc-linux-nat.c18
-rw-r--r--gdb/regcache.c10
-rw-r--r--gdb/remote-e7000.c4
-rw-r--r--gdb/remote-mips.c10
-rw-r--r--gdb/remote-sim.c14
-rw-r--r--gdb/remote-vxmips.c12
-rw-r--r--gdb/remote.c12
-rw-r--r--gdb/rom68k-rom.c2
-rw-r--r--gdb/rs6000-nat.c6
-rw-r--r--gdb/rs6000-tdep.c6
-rw-r--r--gdb/stack.c2
-rw-r--r--gdb/target.c4
-rw-r--r--gdb/tracepoint.c2
-rw-r--r--gdb/v850-tdep.c4
-rw-r--r--gdb/v850ice.c4
-rw-r--r--gdb/valops.c6
-rw-r--r--gdb/xstormy16-tdep.c8
38 files changed, 179 insertions, 131 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2b66268..1898200 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,55 @@
2004-08-02 Andrew Cagney <cagney@gnu.org>
+ Replace DEPRECATED_REGISTER_RAW_SIZE with register_size.
+ * rs6000-tdep.c (rs6000_push_dummy_call)
+ (rs6000_extract_return_value): Use register_size.
+ * xstormy16-tdep.c (xstormy16_get_saved_register)
+ (xstormy16_extract_return_value): Ditto.
+ * valops.c (value_assign): Ditto.
+ * v850ice.c (v850ice_fetch_registers, v850ice_store_registers):
+ * v850-tdep.c (v850_extract_return_value): Ditto.
+ * tracepoint.c (collect_symbol): Ditto.
+ * target.c (debug_print_register): Ditto.
+ * stack.c (frame_info): Ditto.
+ * rs6000-nat.c (ARCH64, fetch_register, store_register): Ditto.
+ * rom68k-rom.c (rom68k_supply_one_register): Ditto.
+ * remote.c (struct packet_reg, remote_wait, remote_async_wait)
+ (store_register_using_P): Ditto.
+ * remote-vxmips.c (vx_read_register, vx_write_register): Ditto.
+ * remote-sim.c (gdbsim_fetch_register, gdbsim_store_register): Ditto.
+ * remote-mips.c (mips_wait, mips_fetch_registers): Ditto.
+ * remote-e7000.c (fetch_regs_from_dump, sub2_from_pc): Ditto.
+ * regcache.c (deprecated_read_register_bytes)
+ (deprecated_write_register_bytes, read_register)
+ (write_register): Ditto.
+ * ppc-linux-nat.c (fetch_altivec_register, fetch_register)
+ (supply_vrregset, store_altivec_register, fill_vrregset): Ditto.
+ * monitor.c (monitor_supply_register, monitor_fetch_register)
+ (monitor_store_register): Ditto.
+ * mn10300-tdep.c (mn10300_pop_frame_regular)
+ (mn10300_print_register): Ditto.
+ * mipsv4-nat.c (fill_fpregset): Ditto.
+ * mips-linux-tdep.c (supply_32bit_reg, fill_fpregset)
+ (mips64_fill_fpregset): Ditto.
+ * mi/mi-main.c (register_changed_p, get_register)
+ (mi_cmd_data_write_register_values): Ditto.
+ * lynx-nat.c (fetch_inferior_registers, store_inferior_registers):
+ * irix5-nat.c (fill_gregset, fetch_core_registers):
+ * infrun.c (write_inferior_status_register): Ditto.
+ * infptrace.c (fetch_register, store_register): Ditto.
+ * infcmd.c (default_print_registers_info): Ditto.
+ * ia64-linux-nat.c (COPY_REG, fill_fpregset): Ditto.
+ * ia64-aix-nat.c (COPY_REG, fill_gregset): Ditto.
+ * i386gnu-nat.c (gnu_store_registers, fill): Ditto.
+ * hpux-thread.c (hpux_thread_fetch_registers)
+ (hpux_thread_store_registers): Ditto.
+ * hppah-nat.c (store_inferior_registers, fetch_register):
+ * findvar.c (value_from_register): Ditto.
+ * dve3900-rom.c (fetch_bitmapped_register):
+ * cris-tdep.c (cris_gdbarch_init): Ditto.
+ * alpha-tdep.h: Ditto.
+ * aix-thread.c (pd_enable, fill_sprs64, fill_sprs32): Ditto.
+
* regcache.h: Delete DEPRECATED_REGISTER_VIRTUAL_SIZE and
DEPRECATED_REGISTER_RAW_SIZE from comments.
* regcache.c (init_regcache_descr, regcache_dump): Do not check or
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 32c67c5..07599c7 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -854,7 +854,7 @@ pd_enable (void)
return;
/* Check application word size. */
- arch64 = DEPRECATED_REGISTER_RAW_SIZE (0) == 8;
+ arch64 = register_size (current_gdbarch, 0) == 8;
/* Check whether the application is pthreaded. */
stub_name = NULL;
@@ -1315,7 +1315,7 @@ fill_sprs64 (uint64_t *iar, uint64_t *msr, uint32_t *cr,
they're not, then either GDB has been built incorrectly, or
there's some other kind of internal error. To be really safe,
we should check all of the sizes. */
- gdb_assert (sizeof (*iar) == DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM));
+ gdb_assert (sizeof (*iar) == register_size (current_gdbarch, PC_REGNUM));
if (register_cached (PC_REGNUM))
regcache_raw_collect (current_regcache, PC_REGNUM, iar);
@@ -1351,7 +1351,7 @@ fill_sprs32 (unsigned long *iar, unsigned long *msr, unsigned long *cr,
built incorrectly. In order to make use of many of the header
files in /usr/include/sys, GDB needs to be configured so that
sizeof (long) == 4). */
- gdb_assert (sizeof (*iar) == DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM));
+ gdb_assert (sizeof (*iar) == register_size (current_gdbarch, PC_REGNUM));
if (register_cached (PC_REGNUM))
regcache_raw_collect (current_regcache, PC_REGNUM, iar);
diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h
index b1b8516..60cea0a 100644
--- a/gdb/alpha-tdep.h
+++ b/gdb/alpha-tdep.h
@@ -23,9 +23,8 @@
#define ALPHA_TDEP_H
/* Say how long (ordinary) registers are. This is a piece of bogosity
- used in push_word and a few other places;
- DEPRECATED_REGISTER_RAW_SIZE is the real way to know how big a
- register is. */
+ used in push_word and a few other places; register_size() is the
+ real way to know how big a register is. */
#define ALPHA_REGISTER_SIZE 8
/* Number of machine registers. */
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 329e185..0d1123d 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -3806,8 +3806,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_register_name (gdbarch, cris_register_name);
/* Length of ordinary registers used in push_word and a few other
- places. DEPRECATED_REGISTER_RAW_SIZE is the real way to know how
- big a register is. */
+ places. register_size() is the real way to know how big a
+ register is. */
set_gdbarch_deprecated_register_size (gdbarch, 4);
set_gdbarch_double_bit (gdbarch, 64);
/* The default definition of a long double is 2 * TARGET_DOUBLE_BIT,
diff --git a/gdb/dve3900-rom.c b/gdb/dve3900-rom.c
index 82da6ec..a7cfb22 100644
--- a/gdb/dve3900-rom.c
+++ b/gdb/dve3900-rom.c
@@ -472,7 +472,7 @@ fetch_bitmapped_register (int regno, struct bit_field *bf)
/* supply register stores in target byte order, so swap here */
- store_unsigned_integer (regbuf, DEPRECATED_REGISTER_RAW_SIZE (regno), val);
+ store_unsigned_integer (regbuf, register_size (current_gdbarch, regno), val);
regcache_raw_supply (current_regcache, regno, regbuf);
}
diff --git a/gdb/findvar.c b/gdb/findvar.c
index 9c300b4..3d5d3f3 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -655,7 +655,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
/* Copy all of the data out, whereever it may be. */
for (local_regnum = regnum, value_bytes_copied = 0;
value_bytes_copied < len;
- (value_bytes_copied += DEPRECATED_REGISTER_RAW_SIZE (local_regnum),
+ (value_bytes_copied += register_size (current_gdbarch, local_regnum),
++local_regnum))
{
int realnum;
@@ -721,9 +721,9 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
some fiddling with the last register copied here for little
endian machines. */
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- && len < DEPRECATED_REGISTER_RAW_SIZE (regnum))
+ && len < register_size (current_gdbarch, regnum))
/* Big-endian, and we want less than full size. */
- VALUE_OFFSET (v) = DEPRECATED_REGISTER_RAW_SIZE (regnum) - len;
+ VALUE_OFFSET (v) = register_size (current_gdbarch, regnum) - len;
else
VALUE_OFFSET (v) = 0;
memcpy (VALUE_CONTENTS_RAW (v), value_bytes + VALUE_OFFSET (v), len);
diff --git a/gdb/hppah-nat.c b/gdb/hppah-nat.c
index f9d4585..60e2889 100644
--- a/gdb/hppah-nat.c
+++ b/gdb/hppah-nat.c
@@ -95,7 +95,7 @@ store_inferior_registers (int regno)
return;
offset = 0;
- len = DEPRECATED_REGISTER_RAW_SIZE (regno);
+ len = register_size (current_gdbarch, regno);
/* Requests for register zero actually want the save_state's
ss_flags member. As RM says: "Oh, what a hack!" */
@@ -106,11 +106,10 @@ store_inferior_registers (int regno)
len = sizeof (ss.ss_flags);
/* Note that ss_flags is always an int, no matter what
- DEPRECATED_REGISTER_RAW_SIZE(0) says. Assuming all HP-UX
- PA machines are big-endian, put it at the least
- significant end of the value, and zap the rest of the
- buffer. */
- offset = DEPRECATED_REGISTER_RAW_SIZE (0) - len;
+ register_size (0) says. Assuming all HP-UX PA machines
+ are big-endian, put it at the least significant end of
+ the value, and zap the rest of the buffer. */
+ offset = register_size (current_gdbarch, 0) - len;
}
/* Floating-point registers come from the ss_fpblock area. */
@@ -213,7 +212,7 @@ fetch_register (int regno)
int i;
offset = 0;
- len = DEPRECATED_REGISTER_RAW_SIZE (regno);
+ len = register_size (current_gdbarch, regno);
/* Requests for register zero actually want the save_state's
ss_flags member. As RM says: "Oh, what a hack!" */
@@ -224,10 +223,10 @@ fetch_register (int regno)
len = sizeof (ss.ss_flags);
/* Note that ss_flags is always an int, no matter what
- DEPRECATED_REGISTER_RAW_SIZE(0) says. Assuming all HP-UX PA
- machines are big-endian, put it at the least significant end
- of the value, and zap the rest of the buffer. */
- offset = DEPRECATED_REGISTER_RAW_SIZE (0) - len;
+ register_size (0) says. Assuming all HP-UX PA machines are
+ big-endian, put it at the least significant end of the value,
+ and zap the rest of the buffer. */
+ offset = register_size (current_gdbarch, 0) - len;
memset (buf, 0, sizeof (buf));
}
diff --git a/gdb/hpux-thread.c b/gdb/hpux-thread.c
index c0614dc..5664314 100644
--- a/gdb/hpux-thread.c
+++ b/gdb/hpux-thread.c
@@ -291,13 +291,13 @@ hpux_thread_fetch_registers (int regno)
if (regno == FLAGS_REGNUM)
/* Flags must be 0 to avoid bogus value for SS_INSYSCALL */
- memset (buf, '\000', DEPRECATED_REGISTER_RAW_SIZE (regno));
+ memset (buf, '\000', register_size (current_gdbarch, regno));
else if (regno == SP_REGNUM)
store_unsigned_integer (buf, sizeof sp, sp);
else if (regno == PC_REGNUM)
- read_memory (sp - 20, buf, DEPRECATED_REGISTER_RAW_SIZE (regno));
+ read_memory (sp - 20, buf, register_size (current_gdbarch, regno));
else
- read_memory (sp + regmap[regno], buf, DEPRECATED_REGISTER_RAW_SIZE (regno));
+ read_memory (sp + regmap[regno], buf, register_size (current_gdbarch, regno));
regcache_raw_supply (current_regcache, regno, buf);
}
@@ -357,19 +357,19 @@ hpux_thread_store_registers (int regno)
{
write_memory ((CORE_ADDR) & tcb_ptr->static_ctx.sp,
&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_RAW_SIZE (regno));
+ register_size (current_gdbarch, regno));
tcb_ptr->static_ctx.sp = (cma__t_hppa_regs *)
(extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_RAW_SIZE (regno)) + 160);
+ register_size (current_gdbarch, regno)) + 160);
}
else if (regno == PC_REGNUM)
write_memory (sp - 20,
&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_RAW_SIZE (regno));
+ register_size (current_gdbarch, regno));
else
write_memory (sp + regmap[regno],
&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_RAW_SIZE (regno));
+ register_size (current_gdbarch, regno));
}
}
diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c
index dcc89bd..e038d9c 100644
--- a/gdb/i386gnu-nat.c
+++ b/gdb/i386gnu-nat.c
@@ -243,7 +243,7 @@ gnu_store_registers (int regno)
if ((thread->fetched_regs & (1 << check_regno))
&& memcpy (REG_ADDR (&old_state, check_regno),
REG_ADDR (state, check_regno),
- DEPRECATED_REGISTER_RAW_SIZE (check_regno)))
+ register_size (current_gdbarch, check_regno)))
/* Register CHECK_REGNO has changed! Ack! */
{
warning ("Register %s changed after the thread was aborted",
@@ -259,7 +259,7 @@ gnu_store_registers (int regno)
#define fill(state, regno) \
memcpy (REG_ADDR(state, regno), &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)], \
- DEPRECATED_REGISTER_RAW_SIZE (regno))
+ register_size (current_gdbarch, regno))
if (regno == -1)
{
diff --git a/gdb/ia64-aix-nat.c b/gdb/ia64-aix-nat.c
index 893f095..9f37f8f 100644
--- a/gdb/ia64-aix-nat.c
+++ b/gdb/ia64-aix-nat.c
@@ -101,7 +101,7 @@ fill_gregset (prgregset_t *gregsetp, int regno)
#define COPY_REG(_fld_,_regi_) \
if ((regno == -1) || regno == _regi_) \
memcpy (&(gregsetp->_fld_), &deprecated_registers[DEPRECATED_REGISTER_BYTE (_regi_)], \
- DEPRECATED_REGISTER_RAW_SIZE (_regi_))
+ register_size (current_gdbarch, _regi_))
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
{
@@ -124,10 +124,10 @@ fill_gregset (prgregset_t *gregsetp, int regno)
{
memcpy (&(gregsetp->__bspstore),
&deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSP_REGNUM)],
- DEPRECATED_REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
+ register_size (current_gdbarch, IA64_BSP_REGNUM));
memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSPSTORE_REGNUM)],
&deprecated_registers[DEPRECATED_REGISTER_BYTE (IA64_BSP_REGNUM)],
- DEPRECATED_REGISTER_RAW_SIZE (IA64_BSP_REGNUM));
+ register_size (current_gdbarch, IA64_BSP_REGNUM));
}
#if 0
@@ -170,7 +170,7 @@ fill_fpregset (prfpregset_t *fpregsetp, int regno)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->__fpr[regi - IA64_FR0_REGNUM]);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi));
+ memcpy (to, from, register_size (current_gdbarch, regi));
}
}
}
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index c556098..3ae88ac 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -419,7 +419,7 @@ fill_gregset (gregset_t *gregsetp, int regno)
#define COPY_REG(_idx_,_regi_) \
if ((regno == -1) || regno == _regi_) \
memcpy (regp + _idx_, &deprecated_registers[DEPRECATED_REGISTER_BYTE (_regi_)], \
- DEPRECATED_REGISTER_RAW_SIZE (_regi_))
+ register_size (current_gdbarch, _regi_))
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
{
@@ -485,7 +485,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi));
+ memcpy (to, from, register_size (current_gdbarch, regi));
}
}
}
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 3c84605..b529d8b 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1568,13 +1568,13 @@ default_print_registers_info (struct gdbarch *gdbarch,
file, 0, 1, 0, Val_pretty_default);
fprintf_filtered (file, "\t(raw 0x");
- for (j = 0; j < DEPRECATED_REGISTER_RAW_SIZE (i); j++)
+ for (j = 0; j < register_size (current_gdbarch, i); j++)
{
int idx;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
idx = j;
else
- idx = DEPRECATED_REGISTER_RAW_SIZE (i) - 1 - j;
+ idx = register_size (current_gdbarch, i) - 1 - j;
fprintf_filtered (file, "%02x", (unsigned char) buffer[idx]);
}
fprintf_filtered (file, ")");
diff --git a/gdb/infptrace.c b/gdb/infptrace.c
index 3b83fc7..c3b1856 100644
--- a/gdb/infptrace.c
+++ b/gdb/infptrace.c
@@ -385,7 +385,7 @@ fetch_register (int regno)
offset = U_REGS_OFFSET;
regaddr = register_addr (regno, offset);
- for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ for (i = 0; i < register_size (current_gdbarch, regno); i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
*(PTRACE_XFER_TYPE *) & buf[i] = ptrace (PT_READ_U, tid,
@@ -452,7 +452,7 @@ store_register (int regno)
regcache_raw_collect (current_regcache, regno, buf);
/* Store the local buffer into the inferior a chunk at the time. */
- for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (PTRACE_XFER_TYPE))
+ for (i = 0; i < register_size (current_gdbarch, regno); i += sizeof (PTRACE_XFER_TYPE))
{
errno = 0;
ptrace (PT_WRITE_U, tid, (PTRACE_ARG3_TYPE) regaddr,
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 38d5df0..d44dd0d 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3491,7 +3491,7 @@ void
write_inferior_status_register (struct inferior_status *inf_status, int regno,
LONGEST val)
{
- int size = DEPRECATED_REGISTER_RAW_SIZE (regno);
+ int size = register_size (current_gdbarch, regno);
void *buf = alloca (size);
store_signed_integer (buf, size, val);
regcache_raw_write (inf_status->registers, regno, buf);
diff --git a/gdb/irix5-nat.c b/gdb/irix5-nat.c
index 8ad7e98..129742f 100644
--- a/gdb/irix5-nat.c
+++ b/gdb/irix5-nat.c
@@ -92,28 +92,28 @@ fill_gregset (gregset_t *gregsetp, int regno)
if ((regno == -1) || (regno == regi))
*(regp + regi) =
extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)],
- DEPRECATED_REGISTER_RAW_SIZE (regi));
+ register_size (current_gdbarch, regi));
if ((regno == -1) || (regno == PC_REGNUM))
*(regp + CTX_EPC) =
extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->pc)],
- DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->pc));
+ register_size (current_gdbarch, mips_regnum (current_gdbarch)->pc));
if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->cause))
*(regp + CTX_CAUSE) =
extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->cause)],
- DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->cause));
+ register_size (current_gdbarch, mips_regnum (current_gdbarch)->cause));
if ((regno == -1)
|| (regno == mips_regnum (current_gdbarch)->hi))
*(regp + CTX_MDHI) =
extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->hi)],
- DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->hi));
+ register_size (current_gdbarch, mips_regnum (current_gdbarch)->hi));
if ((regno == -1) || (regno == mips_regnum (current_gdbarch)->lo))
*(regp + CTX_MDLO) =
extract_signed_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->lo)],
- DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->lo));
+ register_size (current_gdbarch, mips_regnum (current_gdbarch)->lo));
}
/*
@@ -160,7 +160,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->fp_r.fp_regs[regi - FP0_REGNUM]);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi));
+ memcpy (to, from, register_size (current_gdbarch, regi));
}
}
@@ -233,7 +233,7 @@ fetch_core_registers (char *core_reg_sect, unsigned core_reg_size,
*dstp++ = *srcp++;
*dstp++ = *srcp++;
*dstp++ = *srcp++;
- if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 4)
+ if (register_size (current_gdbarch, regno) == 4)
{
/* copying 4 bytes from eight bytes?
I don't see how this can be right... */
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index dab47d4..1517cb5 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -313,7 +313,7 @@ fetch_inferior_registers (int regno)
ptrace_fun = regno == SP_REGNUM ? PTRACE_PEEKUSP : PTRACE_PEEKTHREAD;
#endif
- for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (int))
+ for (i = 0; i < register_size (current_gdbarch, regno); i += sizeof (int))
{
unsigned int reg;
@@ -362,7 +362,7 @@ store_inferior_registers (int regno)
ptrace_fun = regno == SP_REGNUM ? PTRACE_POKEUSP : PTRACE_POKEUSER;
#endif
- for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i += sizeof (int))
+ for (i = 0; i < register_size (current_gdbarch, regno); i += sizeof (int))
{
unsigned int reg;
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 3fc1586..e373554 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -392,13 +392,13 @@ register_changed_p (int regnum)
return -1;
if (memcmp (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer,
- DEPRECATED_REGISTER_RAW_SIZE (regnum)) == 0)
+ register_size (current_gdbarch, regnum)) == 0)
return 0;
/* Found a changed register. Return 1. */
memcpy (&old_regs[DEPRECATED_REGISTER_BYTE (regnum)], raw_buffer,
- DEPRECATED_REGISTER_RAW_SIZE (regnum));
+ register_size (current_gdbarch, regnum));
return 1;
}
@@ -525,10 +525,10 @@ get_register (int regnum, int format)
strcpy (buf, "0x");
ptr = buf + 2;
- for (j = 0; j < DEPRECATED_REGISTER_RAW_SIZE (regnum); j++)
+ for (j = 0; j < register_size (current_gdbarch, regnum); j++)
{
int idx = TARGET_BYTE_ORDER == BFD_ENDIAN_BIG ? j
- : DEPRECATED_REGISTER_RAW_SIZE (regnum) - 1 - j;
+ : register_size (current_gdbarch, regnum) - 1 - j;
sprintf (ptr, "%02x", (unsigned char) buffer[idx]);
ptr += 2;
}
@@ -610,7 +610,7 @@ mi_cmd_data_write_register_values (char *command, char **argv, int argc)
old_chain = make_cleanup (xfree, buffer);
store_signed_integer (buffer, DEPRECATED_REGISTER_SIZE, value);
/* Write it down */
- deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (regnum), buffer, DEPRECATED_REGISTER_RAW_SIZE (regnum));
+ deprecated_write_register_bytes (DEPRECATED_REGISTER_BYTE (regnum), buffer, register_size (current_gdbarch, regnum));
/* Free the buffer. */
do_cleanups (old_chain);
}
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 77db3de..dce507f 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -96,7 +96,7 @@ static void
supply_32bit_reg (int regnum, const void *addr)
{
char buf[MAX_REGISTER_SIZE];
- store_signed_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (regnum),
+ store_signed_integer (buf, register_size (current_gdbarch, regnum),
extract_signed_integer (addr, 4));
regcache_raw_supply (current_regcache, regnum, buf);
}
@@ -223,13 +223,13 @@ fill_fpregset (elf_fpregset_t *fpregsetp, int regno)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + regno - FP0_REGNUM);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regno - FP0_REGNUM));
+ memcpy (to, from, register_size (current_gdbarch, regno - FP0_REGNUM));
}
else if (regno == mips_regnum (current_gdbarch)->fp_control_status)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + 32);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regno));
+ memcpy (to, from, register_size (current_gdbarch, regno));
}
else if (regno == -1)
{
@@ -502,13 +502,13 @@ mips64_fill_fpregset (mips64_elf_fpregset_t *fpregsetp, int regno)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + regno - FP0_REGNUM);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regno - FP0_REGNUM));
+ memcpy (to, from, register_size (current_gdbarch, regno - FP0_REGNUM));
}
else if (regno == mips_regnum (current_gdbarch)->fp_control_status)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)];
to = (char *) (*fpregsetp + 32);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regno));
+ memcpy (to, from, register_size (current_gdbarch, regno));
}
else if (regno == -1)
{
diff --git a/gdb/mipsv4-nat.c b/gdb/mipsv4-nat.c
index 645ad4d..53e286a 100644
--- a/gdb/mipsv4-nat.c
+++ b/gdb/mipsv4-nat.c
@@ -139,7 +139,7 @@ fill_fpregset (fpregset_t *fpregsetp, int regno)
{
from = (char *) &deprecated_registers[DEPRECATED_REGISTER_BYTE (regi)];
to = (char *) &(fpregsetp->fp_r.fp_regs[regi - mips_regnum (current_gdbarch)->fp0]);
- memcpy (to, from, DEPRECATED_REGISTER_RAW_SIZE (regi));
+ memcpy (to, from, register_size (current_gdbarch, regi));
}
}
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index dce5cb3..624ce67 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -872,7 +872,7 @@ mn10300_pop_frame_regular (struct frame_info *frame)
ULONGEST value;
value = read_memory_unsigned_integer (deprecated_get_frame_saved_regs (frame)[regnum],
- DEPRECATED_REGISTER_RAW_SIZE (regnum));
+ register_size (current_gdbarch, regnum));
write_register (regnum, value);
}
@@ -1164,8 +1164,8 @@ mn10300_print_register (const char *name, int regnum, int reg_width)
int byte;
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG)
{
- for (byte = DEPRECATED_REGISTER_RAW_SIZE (regnum) - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
- byte < DEPRECATED_REGISTER_RAW_SIZE (regnum);
+ for (byte = register_size (current_gdbarch, regnum) - DEPRECATED_REGISTER_VIRTUAL_SIZE (regnum);
+ byte < register_size (current_gdbarch, regnum);
byte++)
printf_filtered ("%02x", (unsigned char) raw_buffer[byte]);
}
diff --git a/gdb/monitor.c b/gdb/monitor.c
index 18927d8..0fb44a1 100644
--- a/gdb/monitor.c
+++ b/gdb/monitor.c
@@ -921,7 +921,7 @@ monitor_supply_register (int regno, char *valstr)
/* supply register stores in target byte order, so swap here */
- store_unsigned_integer (regbuf, DEPRECATED_REGISTER_RAW_SIZE (regno), val);
+ store_unsigned_integer (regbuf, register_size (current_gdbarch, regno), val);
regcache_raw_supply (current_regcache, regno, regbuf);
@@ -1227,7 +1227,7 @@ monitor_fetch_register (int regno)
spaces, but stop reading if something else is seen. Some monitors
like to drop leading zeros. */
- for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno) * 2; i++)
+ for (i = 0; i < register_size (current_gdbarch, regno) * 2; i++)
{
int c;
c = readchar (timeout);
@@ -1344,7 +1344,7 @@ monitor_store_register (int regno)
val = read_register (regno);
monitor_debug ("MON storeg %d %s\n", regno,
- phex (val, DEPRECATED_REGISTER_RAW_SIZE (regno)));
+ phex (val, register_size (current_gdbarch, regno)));
/* send the register deposit command */
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 61b0440..c3ea712 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -229,7 +229,7 @@ fetch_altivec_register (int tid, int regno)
int offset = 0;
gdb_vrregset_t regs;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- int vrregsize = DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
+ int vrregsize = register_size (current_gdbarch, tdep->ppc_vr0_regnum);
ret = ptrace (PTRACE_GETVRREGS, tid, 0, &regs);
if (ret < 0)
@@ -247,7 +247,7 @@ fetch_altivec_register (int tid, int regno)
vector. VRSAVE is at the end of the array in a 4 bytes slot, so
there is no need to define an offset for it. */
if (regno == (tdep->ppc_vrsave_regnum - 1))
- offset = vrregsize - DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+ offset = vrregsize - register_size (current_gdbarch, tdep->ppc_vrsave_regnum);
regcache_raw_supply (current_regcache, regno,
regs + (regno - tdep->ppc_vr0_regnum) * vrregsize + offset);
@@ -423,7 +423,7 @@ fetch_register (int tid, int regno)
if (regaddr == -1)
{
- memset (buf, '\0', DEPRECATED_REGISTER_RAW_SIZE (regno)); /* Supply zeroes */
+ memset (buf, '\0', register_size (current_gdbarch, regno)); /* Supply zeroes */
regcache_raw_supply (current_regcache, regno, buf);
return;
}
@@ -475,8 +475,8 @@ supply_vrregset (gdb_vrregset_t *vrregsetp)
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int num_of_vrregs = tdep->ppc_vrsave_regnum - tdep->ppc_vr0_regnum + 1;
- int vrregsize = DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
- int offset = vrregsize - DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+ int vrregsize = register_size (current_gdbarch, tdep->ppc_vr0_regnum);
+ int offset = vrregsize - register_size (current_gdbarch, tdep->ppc_vrsave_regnum);
for (i = 0; i < num_of_vrregs; i++)
{
@@ -600,7 +600,7 @@ store_altivec_register (int tid, int regno)
int offset = 0;
gdb_vrregset_t regs;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
- int vrregsize = DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
+ int vrregsize = register_size (current_gdbarch, tdep->ppc_vr0_regnum);
ret = ptrace (PTRACE_GETVRREGS, tid, 0, &regs);
if (ret < 0)
@@ -616,7 +616,7 @@ store_altivec_register (int tid, int regno)
/* VSCR is fetched as a 16 bytes quantity, but it is really 4 bytes
long on the hardware. */
if (regno == (tdep->ppc_vrsave_regnum - 1))
- offset = vrregsize - DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+ offset = vrregsize - register_size (current_gdbarch, tdep->ppc_vrsave_regnum);
regcache_raw_collect (current_regcache, regno,
regs + (regno - tdep->ppc_vr0_regnum) * vrregsize + offset);
@@ -835,8 +835,8 @@ fill_vrregset (gdb_vrregset_t *vrregsetp)
int i;
struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch);
int num_of_vrregs = tdep->ppc_vrsave_regnum - tdep->ppc_vr0_regnum + 1;
- int vrregsize = DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vr0_regnum);
- int offset = vrregsize - DEPRECATED_REGISTER_RAW_SIZE (tdep->ppc_vrsave_regnum);
+ int vrregsize = register_size (current_gdbarch, tdep->ppc_vr0_regnum);
+ int offset = vrregsize - register_size (current_gdbarch, tdep->ppc_vrsave_regnum);
for (i = 0; i < num_of_vrregs; i++)
{
diff --git a/gdb/regcache.c b/gdb/regcache.c
index dee37c3..ccc82a3 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -549,7 +549,7 @@ deprecated_read_register_bytes (int in_start, char *in_buf, int in_len)
int byte;
reg_start = DEPRECATED_REGISTER_BYTE (regnum);
- reg_len = DEPRECATED_REGISTER_RAW_SIZE (regnum);
+ reg_len = register_size (current_gdbarch, regnum);
reg_end = reg_start + reg_len;
if (reg_end <= in_start || in_end <= reg_start)
@@ -819,7 +819,7 @@ deprecated_write_register_bytes (int myregstart, char *myaddr, int inlen)
int regstart, regend;
regstart = DEPRECATED_REGISTER_BYTE (regnum);
- regend = regstart + DEPRECATED_REGISTER_RAW_SIZE (regnum);
+ regend = regstart + register_size (current_gdbarch, regnum);
/* Is this register completely outside the range the user is writing? */
if (myregend <= regstart || regend <= myregstart)
@@ -948,9 +948,9 @@ register_offset_hack (struct gdbarch *gdbarch, int regnum)
ULONGEST
read_register (int regnum)
{
- char *buf = alloca (DEPRECATED_REGISTER_RAW_SIZE (regnum));
+ char *buf = alloca (register_size (current_gdbarch, regnum));
deprecated_read_register_gen (regnum, buf);
- return (extract_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (regnum)));
+ return (extract_unsigned_integer (buf, register_size (current_gdbarch, regnum)));
}
ULONGEST
@@ -981,7 +981,7 @@ write_register (int regnum, LONGEST val)
{
void *buf;
int size;
- size = DEPRECATED_REGISTER_RAW_SIZE (regnum);
+ size = register_size (current_gdbarch, regnum);
buf = alloca (size);
store_signed_integer (buf, size, (LONGEST) val);
deprecated_write_register_gen (regnum, buf);
diff --git a/gdb/remote-e7000.c b/gdb/remote-e7000.c
index c186381..965ea97 100644
--- a/gdb/remote-e7000.c
+++ b/gdb/remote-e7000.c
@@ -879,7 +879,7 @@ fetch_regs_from_dump (int (*nextchar) (), char *want)
internal_error (__FILE__, __LINE__, "failed internal consistency check");
}
store_signed_integer (buf,
- DEPRECATED_REGISTER_RAW_SIZE (regno),
+ register_size (current_gdbarch, regno),
(LONGEST) get_hex (&thischar));
regcache_raw_supply (current_regcache, regno, buf);
break;
@@ -1964,7 +1964,7 @@ sub2_from_pc (void)
char buf2[200];
store_signed_integer (buf,
- DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM),
+ register_size (current_gdbarch, PC_REGNUM),
read_register (PC_REGNUM) - 2);
regcache_raw_supply (current_regcache, PC_REGNUM, buf);
sprintf (buf2, ".PC %s\r", phex_nz (read_register (PC_REGNUM), 0));
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index ae54df9..b7dc35e 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -1757,16 +1757,16 @@ mips_wait (ptid_t ptid, struct target_waitstatus *status)
{
char buf[MAX_REGISTER_SIZE];
- store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM), rpc);
+ store_unsigned_integer (buf, register_size (current_gdbarch, PC_REGNUM), rpc);
regcache_raw_supply (current_regcache, PC_REGNUM, buf);
- store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (PC_REGNUM), rfp);
+ store_unsigned_integer (buf, register_size (current_gdbarch, PC_REGNUM), rfp);
regcache_raw_supply (current_regcache, 30, buf); /* This register they are avoiding and so it is unnamed */
- store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (SP_REGNUM), rsp);
+ store_unsigned_integer (buf, register_size (current_gdbarch, SP_REGNUM), rsp);
regcache_raw_supply (current_regcache, SP_REGNUM, buf);
- store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (DEPRECATED_FP_REGNUM), 0);
+ store_unsigned_integer (buf, register_size (current_gdbarch, DEPRECATED_FP_REGNUM), 0);
regcache_raw_supply (current_regcache, DEPRECATED_FP_REGNUM, buf);
if (nfields == 9)
@@ -1938,7 +1938,7 @@ mips_fetch_registers (int regno)
/* We got the number the register holds, but gdb expects to see a
value in the target byte ordering. */
- store_unsigned_integer (buf, DEPRECATED_REGISTER_RAW_SIZE (regno), val);
+ store_unsigned_integer (buf, register_size (current_gdbarch, regno), val);
regcache_raw_supply (current_regcache, regno, buf);
}
}
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index b3da582..7a5c7b0 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -317,14 +317,14 @@ gdbsim_fetch_register (int regno)
memset (buf, 0, MAX_REGISTER_SIZE);
nr_bytes = sim_fetch_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
- buf, DEPRECATED_REGISTER_RAW_SIZE (regno));
- if (nr_bytes > 0 && nr_bytes != DEPRECATED_REGISTER_RAW_SIZE (regno) && warn_user)
+ buf, register_size (current_gdbarch, regno));
+ if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno) && warn_user)
{
fprintf_unfiltered (gdb_stderr,
"Size of register %s (%d/%d) incorrect (%d instead of %d))",
REGISTER_NAME (regno),
regno, REGISTER_SIM_REGNO (regno),
- nr_bytes, DEPRECATED_REGISTER_RAW_SIZE (regno));
+ nr_bytes, register_size (current_gdbarch, regno));
warn_user = 0;
}
/* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
@@ -337,7 +337,7 @@ gdbsim_fetch_register (int regno)
{
printf_filtered ("gdbsim_fetch_register: %d", regno);
/* FIXME: We could print something more intelligible. */
- dump_mem (buf, DEPRECATED_REGISTER_RAW_SIZE (regno));
+ dump_mem (buf, register_size (current_gdbarch, regno));
}
break;
}
@@ -361,8 +361,8 @@ gdbsim_store_register (int regno)
deprecated_read_register_gen (regno, tmp);
nr_bytes = sim_store_register (gdbsim_desc,
REGISTER_SIM_REGNO (regno),
- tmp, DEPRECATED_REGISTER_RAW_SIZE (regno));
- if (nr_bytes > 0 && nr_bytes != DEPRECATED_REGISTER_RAW_SIZE (regno))
+ tmp, register_size (current_gdbarch, regno));
+ if (nr_bytes > 0 && nr_bytes != register_size (current_gdbarch, regno))
internal_error (__FILE__, __LINE__,
"Register size different to expected");
/* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
@@ -372,7 +372,7 @@ gdbsim_store_register (int regno)
{
printf_filtered ("gdbsim_store_register: %d", regno);
/* FIXME: We could print something more intelligible. */
- dump_mem (tmp, DEPRECATED_REGISTER_RAW_SIZE (regno));
+ dump_mem (tmp, register_size (current_gdbarch, regno));
}
}
}
diff --git a/gdb/remote-vxmips.c b/gdb/remote-vxmips.c
index 617bce0..84e6c7d 100644
--- a/gdb/remote-vxmips.c
+++ b/gdb/remote-vxmips.c
@@ -135,20 +135,20 @@ vx_read_register (int regno)
memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
&mips_fpreg_packet[MIPS_R_FP0],
- DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
+ register_size (current_gdbarch, FP0_REGNUM) * 32);
/* Copy the floating point control/status register (fpcsr). */
memcpy (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
&mips_fpreg_packet[MIPS_R_FPCSR],
- DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status));
+ register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status));
}
else
{
memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- 0, DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
+ 0, register_size (current_gdbarch, FP0_REGNUM) * 32);
memset (&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
- 0, DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status));
+ 0, register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status));
}
/* Mark the register cache valid. */
@@ -195,13 +195,13 @@ vx_write_register (int regno)
memcpy (&mips_fpreg_packet[MIPS_R_FP0],
&deprecated_registers[DEPRECATED_REGISTER_BYTE (FP0_REGNUM)],
- DEPRECATED_REGISTER_RAW_SIZE (FP0_REGNUM) * 32);
+ register_size (current_gdbarch, FP0_REGNUM) * 32);
/* Copy the floating point control/status register (fpcsr). */
memcpy (&mips_fpreg_packet[MIPS_R_FPCSR],
&deprecated_registers[DEPRECATED_REGISTER_BYTE (mips_regnum (current_gdbarch)->fp_control_status)],
- DEPRECATED_REGISTER_RAW_SIZE (mips_regnum (current_gdbarch)->fp_control_status));
+ register_size (current_gdbarch, mips_regnum (current_gdbarch)->fp_control_status));
net_write_registers (mips_fpreg_packet, MIPS_FPREG_PLEN,
PTRACE_SETFPREGS);
diff --git a/gdb/remote.c b/gdb/remote.c
index 7dedc8d..95b0bde 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -208,7 +208,7 @@ struct packet_reg
long regnum; /* GDB's internal register number. */
LONGEST pnum; /* Remote protocol register number. */
int in_g_packet; /* Always part of G packet. */
- /* long size in bytes; == DEPRECATED_REGISTER_RAW_SIZE (regnum); at present. */
+ /* long size in bytes; == register_size (current_gdbarch, regnum); at present. */
/* char *name; == REGISTER_NAME (regnum); at present. */
};
@@ -2884,9 +2884,9 @@ Packet: '%s'\n",
error ("Remote sent bad register number %s: %s\nPacket: '%s'\n",
phex_nz (pnum, 0), p, buf);
- fieldsize = hex2bin (p, regs, DEPRECATED_REGISTER_RAW_SIZE (reg->regnum));
+ fieldsize = hex2bin (p, regs, register_size (current_gdbarch, reg->regnum));
p += 2 * fieldsize;
- if (fieldsize < DEPRECATED_REGISTER_RAW_SIZE (reg->regnum))
+ if (fieldsize < register_size (current_gdbarch, reg->regnum))
warning ("Remote reply is too short: %s", buf);
regcache_raw_supply (current_regcache, reg->regnum, regs);
}
@@ -3072,9 +3072,9 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
error ("Remote sent bad register number %ld: %s\nPacket: '%s'\n",
pnum, p, buf);
- fieldsize = hex2bin (p, regs, DEPRECATED_REGISTER_RAW_SIZE (reg->regnum));
+ fieldsize = hex2bin (p, regs, register_size (current_gdbarch, reg->regnum));
p += 2 * fieldsize;
- if (fieldsize < DEPRECATED_REGISTER_RAW_SIZE (reg->regnum))
+ if (fieldsize < register_size (current_gdbarch, reg->regnum))
warning ("Remote reply is too short: %s", buf);
regcache_raw_supply (current_regcache, reg->regnum, regs);
}
@@ -3303,7 +3303,7 @@ store_register_using_P (int regnum)
sprintf (buf, "P%s=", phex_nz (reg->pnum, 0));
p = buf + strlen (buf);
regcache_raw_collect (current_regcache, reg->regnum, regp);
- bin2hex (regp, p, DEPRECATED_REGISTER_RAW_SIZE (reg->regnum));
+ bin2hex (regp, p, register_size (current_gdbarch, reg->regnum));
remote_send (buf, rs->remote_packet_size);
return buf[0] != '\0';
diff --git a/gdb/rom68k-rom.c b/gdb/rom68k-rom.c
index cf10ac1..01422a6 100644
--- a/gdb/rom68k-rom.c
+++ b/gdb/rom68k-rom.c
@@ -101,7 +101,7 @@ rom68k_supply_one_register (int regno, unsigned char *hex)
while (is_whitespace (*hex))
hex++;
- store_unsigned_integer (regbuf, DEPRECATED_REGISTER_RAW_SIZE (regno), value);
+ store_unsigned_integer (regbuf, register_size (current_gdbarch, regno), value);
regcache_raw_supply (current_regcache, regno, regbuf);
return hex;
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 1c25a59..5f71850 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -73,7 +73,7 @@
#ifndef ARCH3264
# define ARCH64() 0
#else
-# define ARCH64() (DEPRECATED_REGISTER_RAW_SIZE (0) == 8)
+# define ARCH64() (register_size (current_gdbarch, 0) == 8)
#endif
/* Union of 32-bit and 64-bit ".reg" core file sections. */
@@ -255,7 +255,7 @@ fetch_register (int regno)
even if the register is really only 32 bits. */
long long buf;
rs6000_ptrace64 (PT_READ_GPR, PIDGET (inferior_ptid), nr, 0, (int *)&buf);
- if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8)
+ if (register_size (current_gdbarch, regno) == 8)
memcpy (addr, &buf, 8);
else
*addr = buf;
@@ -324,7 +324,7 @@ store_register (int regno)
/* PT_WRITE_GPR requires the buffer parameter to point to an 8-byte
area, even if the register is really only 32 bits. */
long long buf;
- if (DEPRECATED_REGISTER_RAW_SIZE (regno) == 8)
+ if (register_size (current_gdbarch, regno) == 8)
memcpy (&buf, addr, 8);
else
buf = *addr;
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 18e9da6..42a1bcd 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -1336,7 +1336,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii)
{
- int reg_size = DEPRECATED_REGISTER_RAW_SIZE (ii + 3);
+ int reg_size = register_size (current_gdbarch, ii + 3);
arg = args[argno];
type = check_typedef (VALUE_TYPE (arg));
@@ -1557,8 +1557,8 @@ rs6000_extract_return_value (struct type *valtype, char *regbuf, char *valbuf)
{
/* return value is copied starting from r3. */
if (TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
- && TYPE_LENGTH (valtype) < DEPRECATED_REGISTER_RAW_SIZE (3))
- offset = DEPRECATED_REGISTER_RAW_SIZE (3) - TYPE_LENGTH (valtype);
+ && TYPE_LENGTH (valtype) < register_size (current_gdbarch, 3))
+ offset = register_size (current_gdbarch, 3) - TYPE_LENGTH (valtype);
memcpy (valbuf,
regbuf + DEPRECATED_REGISTER_BYTE (3) + offset,
diff --git a/gdb/stack.c b/gdb/stack.c
index 0bd2c25..5d7af0a 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1034,7 +1034,7 @@ frame_info (char *addr_exp, int from_tty)
/* NOTE: cagney/2003-05-22: This is assuming that the
stack pointer was packed as an unsigned integer. That
may or may not be valid. */
- sp = extract_unsigned_integer (value, DEPRECATED_REGISTER_RAW_SIZE (SP_REGNUM));
+ sp = extract_unsigned_integer (value, register_size (current_gdbarch, SP_REGNUM));
printf_filtered (" Previous frame's sp is ");
print_address_numeric (sp, 1, gdb_stdout);
printf_filtered ("\n");
diff --git a/gdb/target.c b/gdb/target.c
index cfbbd17..d577055 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -1762,11 +1762,11 @@ debug_print_register (const char * func, int regno)
unsigned char buf[MAX_REGISTER_SIZE];
deprecated_read_register_gen (regno, buf);
fprintf_unfiltered (gdb_stdlog, " = ");
- for (i = 0; i < DEPRECATED_REGISTER_RAW_SIZE (regno); i++)
+ for (i = 0; i < register_size (current_gdbarch, regno); i++)
{
fprintf_unfiltered (gdb_stdlog, "%02x", buf[i]);
}
- if (DEPRECATED_REGISTER_RAW_SIZE (regno) <= sizeof (LONGEST))
+ if (register_size (current_gdbarch, regno) <= sizeof (LONGEST))
{
fprintf_unfiltered (gdb_stdlog, " 0x%s %s",
paddr_nz (read_register (regno)),
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index a6d700d..61fd5f1 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -1219,7 +1219,7 @@ collect_symbol (struct collection_list *collect, struct symbol *sym,
/* check for doubles stored in two registers */
/* FIXME: how about larger types stored in 3 or more regs? */
if (TYPE_CODE (SYMBOL_TYPE (sym)) == TYPE_CODE_FLT &&
- len > DEPRECATED_REGISTER_RAW_SIZE (reg))
+ len > register_size (current_gdbarch, reg))
add_register (collect, reg + 1);
break;
case LOC_REF_ARG:
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 4ca2624..a06d75d 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1040,7 +1040,7 @@ v850_extract_return_value (struct type *type, char *regbuf, char *valbuf)
pointed to by R6. */
return_buffer =
extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (E_V0_REGNUM),
- DEPRECATED_REGISTER_RAW_SIZE (E_V0_REGNUM));
+ register_size (current_gdbarch, E_V0_REGNUM));
read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
}
@@ -1193,7 +1193,7 @@ v850_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
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 (gdbarch, v850_register_raw_size);
+ 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_deprecated_register_virtual_type (gdbarch, v850_reg_virtual_type);
diff --git a/gdb/v850ice.c b/gdb/v850ice.c
index ec7caa2..21daeea 100644
--- a/gdb/v850ice.c
+++ b/gdb/v850ice.c
@@ -532,7 +532,7 @@ v850ice_fetch_registers (int regno)
error ("v850ice_fetch_registers (%d): bad value from ICE: %s.",
regno, val);
- store_unsigned_integer (val, DEPRECATED_REGISTER_RAW_SIZE (regno), regval);
+ store_unsigned_integer (val, register_size (current_gdbarch, regno), regval);
regcache_raw_supply (current_regcache, regno, val);
}
@@ -558,7 +558,7 @@ v850ice_store_registers (int regno)
}
regval = extract_unsigned_integer (&deprecated_registers[DEPRECATED_REGISTER_BYTE (regno)],
- DEPRECATED_REGISTER_RAW_SIZE (regno));
+ register_size (current_gdbarch, regno));
strcpy (cmd, "reg ");
if (!convert_register (regno, &cmd[4]))
return;
diff --git a/gdb/valops.c b/gdb/valops.c
index 57e5d84..ac50d23 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -657,7 +657,7 @@ value_assign (struct value *toval, struct value *fromval)
{
int offset;
for (reg_offset = value_reg, offset = 0;
- offset + DEPRECATED_REGISTER_RAW_SIZE (reg_offset) <= VALUE_OFFSET (toval);
+ offset + register_size (current_gdbarch, reg_offset) <= VALUE_OFFSET (toval);
reg_offset++);
byte_offset = VALUE_OFFSET (toval) - offset;
}
@@ -675,7 +675,7 @@ value_assign (struct value *toval, struct value *fromval)
/* Copy it in. */
for (regno = reg_offset, amount_copied = 0;
amount_copied < amount_to_copy;
- amount_copied += DEPRECATED_REGISTER_RAW_SIZE (regno), regno++)
+ amount_copied += register_size (current_gdbarch, regno), regno++)
frame_register_read (frame, regno, buffer + amount_copied);
/* Modify what needs to be modified. */
@@ -692,7 +692,7 @@ value_assign (struct value *toval, struct value *fromval)
/* Copy it out. */
for (regno = reg_offset, amount_copied = 0;
amount_copied < amount_to_copy;
- amount_copied += DEPRECATED_REGISTER_RAW_SIZE (regno), regno++)
+ amount_copied += register_size (current_gdbarch, regno), regno++)
put_frame_register (frame, regno, buffer + amount_copied);
}
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 384b8f1..eb965fd 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -234,7 +234,7 @@ xstormy16_get_saved_register (char *raw_buffer, int *optimized,
get_frame_base (frame),
regnum);
store_unsigned_integer (raw_buffer,
- DEPRECATED_REGISTER_RAW_SIZE (regnum),
+ register_size (current_gdbarch, regnum),
val);
}
return;
@@ -252,7 +252,7 @@ xstormy16_get_saved_register (char *raw_buffer, int *optimized,
/* NOTE: cagney/2003-05-09: In-line store_address()
with it's body - store_unsigned_integer(). */
store_unsigned_integer (raw_buffer,
- DEPRECATED_REGISTER_RAW_SIZE (regnum),
+ register_size (current_gdbarch, regnum),
deprecated_get_frame_saved_regs (frame)[regnum]);
}
else
@@ -261,7 +261,7 @@ xstormy16_get_saved_register (char *raw_buffer, int *optimized,
*addrp = deprecated_get_frame_saved_regs (frame)[regnum];
if (raw_buffer)
read_memory (deprecated_get_frame_saved_regs (frame)[regnum], raw_buffer,
- DEPRECATED_REGISTER_RAW_SIZE (regnum));
+ register_size (current_gdbarch, regnum));
}
return;
}
@@ -319,7 +319,7 @@ xstormy16_extract_return_value (struct type *type, char *regbuf, char *valbuf)
pointed to by R2. */
return_buffer =
extract_unsigned_integer (regbuf + DEPRECATED_REGISTER_BYTE (E_PTR_RET_REGNUM),
- DEPRECATED_REGISTER_RAW_SIZE (E_PTR_RET_REGNUM));
+ register_size (current_gdbarch, E_PTR_RET_REGNUM));
read_memory (return_buffer, valbuf, TYPE_LENGTH (type));
}