* [pushed 10/15] Remove regcache_cooked_write
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
@ 2018-05-30 19:04 ` Simon Marchi
2018-05-30 19:05 ` [pushed 13/15] Remove regcache_cooked_write_part Simon Marchi
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:04 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_cooked_write, update callers to use
regcache::cooked_write.
gdb/ChangeLog:
* regcache.h (regcache_cooked_write): Remove, update callers to
use regcache::cooked_write.
* regcache.c (regcache_cooked_write): Remove.
---
gdb/ChangeLog | 6 ++
gdb/aarch64-tdep.c | 14 ++--
gdb/alpha-tdep.c | 18 ++---
gdb/amd64-tdep.c | 6 +-
gdb/amd64-windows-tdep.c | 8 +--
gdb/arc-tdep.c | 2 +-
gdb/arm-tdep.c | 19 +++--
gdb/avr-tdep.c | 2 +-
gdb/bfin-tdep.c | 2 +-
gdb/cris-tdep.c | 4 +-
gdb/frame.c | 2 +-
gdb/frv-tdep.c | 6 +-
gdb/hppa-tdep.c | 14 ++--
gdb/i386-darwin-tdep.c | 4 +-
gdb/i386-tdep.c | 4 +-
gdb/ia64-tdep.c | 4 +-
gdb/m32c-tdep.c | 26 +++----
gdb/m68k-tdep.c | 6 +-
gdb/microblaze-tdep.c | 4 +-
gdb/nds32-tdep.c | 16 ++---
gdb/nios2-tdep.c | 6 +-
gdb/or1k-tdep.c | 6 +-
gdb/ppc-sysv-tdep.c | 180 +++++++++++++++++++---------------------------
gdb/record-full.c | 3 +-
gdb/regcache.c | 7 --
gdb/regcache.h | 13 +---
gdb/riscv-tdep.c | 14 ++--
gdb/rs6000-aix-tdep.c | 22 +++---
gdb/rs6000-lynx178-tdep.c | 22 +++---
gdb/s390-tdep.c | 15 ++--
gdb/sparc-tdep.c | 24 +++----
gdb/sparc64-tdep.c | 35 +++++----
gdb/spu-tdep.c | 8 +--
gdb/tic6x-tdep.c | 18 +++--
gdb/vax-tdep.c | 10 +--
gdb/xtensa-tdep.c | 6 +-
36 files changed, 246 insertions(+), 310 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d0cc45a..2d1dfb6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_cooked_write): Remove, update callers to
+ use regcache::cooked_write.
+ * regcache.c (regcache_cooked_write): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_invalidate): Remove, update callers to
use detached_regcache::invalidate instead.
* regcache.c (regcache_invalidate): Remove.
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 6f4878a..ef9b71c 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1271,7 +1271,7 @@ pass_in_v (struct gdbarch *gdbarch,
/* PCS C.1, the argument is allocated to the least significant
bits of V register. */
memcpy (reg, buf, len);
- regcache_cooked_write (regcache, regnum, reg);
+ regcache->cooked_write (regnum, reg);
if (aarch64_debug)
{
@@ -1931,7 +1931,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
int len = TYPE_LENGTH (type);
memcpy (buf, valbuf, len > V_REGISTER_SIZE ? V_REGISTER_SIZE : len);
- regcache_cooked_write (regs, AARCH64_V0_REGNUM, buf);
+ regs->cooked_write (AARCH64_V0_REGNUM, buf);
}
else if (TYPE_CODE (type) == TYPE_CODE_INT
|| TYPE_CODE (type) == TYPE_CODE_CHAR
@@ -1948,7 +1948,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
LONGEST val = unpack_long (type, valbuf);
store_signed_integer (tmpbuf, X_REGISTER_SIZE, byte_order, val);
- regcache_cooked_write (regs, AARCH64_X0_REGNUM, tmpbuf);
+ regs->cooked_write (AARCH64_X0_REGNUM, tmpbuf);
}
else
{
@@ -1960,7 +1960,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
while (len > 0)
{
- regcache_cooked_write (regs, regno++, valbuf);
+ regs->cooked_write (regno++, valbuf);
len -= X_REGISTER_SIZE;
valbuf += X_REGISTER_SIZE;
}
@@ -1986,7 +1986,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
}
memcpy (tmpbuf, valbuf, len);
- regcache_cooked_write (regs, regno, tmpbuf);
+ regs->cooked_write (regno, tmpbuf);
valbuf += len;
}
}
@@ -1997,7 +1997,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
gdb_byte buf[V_REGISTER_SIZE];
memcpy (buf, valbuf, TYPE_LENGTH (type));
- regcache_cooked_write (regs, AARCH64_V0_REGNUM, buf);
+ regs->cooked_write (AARCH64_V0_REGNUM, buf);
}
else
{
@@ -2012,7 +2012,7 @@ aarch64_store_return_value (struct type *type, struct regcache *regs,
{
memcpy (tmpbuf, valbuf,
len > X_REGISTER_SIZE ? X_REGISTER_SIZE : len);
- regcache_cooked_write (regs, regno++, tmpbuf);
+ regs->cooked_write (regno++, tmpbuf);
len -= X_REGISTER_SIZE;
valbuf += X_REGISTER_SIZE;
}
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index d55f3c6..408bedc 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -453,10 +453,10 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Load the argument registers. */
for (i = 0; i < required_arg_regs; i++)
{
- regcache_cooked_write (regcache, ALPHA_A0_REGNUM + i,
- arg_reg_buffer + i*ALPHA_REGISTER_SIZE);
- regcache_cooked_write (regcache, ALPHA_FPA0_REGNUM + i,
- arg_reg_buffer + i*ALPHA_REGISTER_SIZE);
+ regcache->cooked_write (ALPHA_A0_REGNUM + i,
+ arg_reg_buffer + i * ALPHA_REGISTER_SIZE);
+ regcache->cooked_write (ALPHA_FPA0_REGNUM + i,
+ arg_reg_buffer + i * ALPHA_REGISTER_SIZE);
}
/* Finally, update the stack pointer. */
@@ -552,11 +552,11 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
{
case 4:
alpha_lds (gdbarch, raw_buffer, valbuf);
- regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, raw_buffer);
+ regcache->cooked_write (ALPHA_FP0_REGNUM, raw_buffer);
break;
case 8:
- regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf);
+ regcache->cooked_write (ALPHA_FP0_REGNUM, valbuf);
break;
case 16:
@@ -576,12 +576,12 @@ alpha_store_return_value (struct type *valtype, struct regcache *regcache,
{
case 8:
/* ??? This isn't correct wrt the ABI, but it's what GCC does. */
- regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf);
+ regcache->cooked_write (ALPHA_FP0_REGNUM, valbuf);
break;
case 16:
- regcache_cooked_write (regcache, ALPHA_FP0_REGNUM, valbuf);
- regcache_cooked_write (regcache, ALPHA_FP0_REGNUM + 1, valbuf + 8);
+ regcache->cooked_write (ALPHA_FP0_REGNUM, valbuf);
+ regcache->cooked_write (ALPHA_FP0_REGNUM + 1, valbuf + 8);
break;
case 32:
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 9a1e68e..975c907 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -1010,7 +1010,7 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (struct_return)
{
store_unsigned_integer (buf, 8, byte_order, struct_addr);
- regcache_cooked_write (regcache, AMD64_RDI_REGNUM, buf);
+ regcache->cooked_write (AMD64_RDI_REGNUM, buf);
}
/* Store return address. */
@@ -1020,10 +1020,10 @@ amd64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Finally, update the stack pointer... */
store_unsigned_integer (buf, 8, byte_order, sp);
- regcache_cooked_write (regcache, AMD64_RSP_REGNUM, buf);
+ regcache->cooked_write (AMD64_RSP_REGNUM, buf);
/* ...and fake a frame pointer. */
- regcache_cooked_write (regcache, AMD64_RBP_REGNUM, buf);
+ regcache->cooked_write (AMD64_RBP_REGNUM, buf);
return sp + 16;
}
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index 7e0c086..83a7f2f 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -145,7 +145,7 @@ amd64_windows_store_arg_in_reg (struct regcache *regcache,
gdb_assert (TYPE_LENGTH (type) <= 8);
memset (buf, 0, sizeof buf);
memcpy (buf, valbuf, std::min (TYPE_LENGTH (type), (unsigned int) 8));
- regcache_cooked_write (regcache, regno, buf);
+ regcache->cooked_write (regno, buf);
}
/* Push the arguments for an inferior function call, and return
@@ -262,7 +262,7 @@ amd64_windows_push_dummy_call
const int arg_regnum = amd64_windows_dummy_call_integer_regs[0];
store_unsigned_integer (buf, 8, byte_order, struct_addr);
- regcache_cooked_write (regcache, arg_regnum, buf);
+ regcache->cooked_write (arg_regnum, buf);
}
/* Reserve some memory on the stack for the integer-parameter
@@ -276,10 +276,10 @@ amd64_windows_push_dummy_call
/* Update the stack pointer... */
store_unsigned_integer (buf, 8, byte_order, sp);
- regcache_cooked_write (regcache, AMD64_RSP_REGNUM, buf);
+ regcache->cooked_write (AMD64_RSP_REGNUM, buf);
/* ...and fake a frame pointer. */
- regcache_cooked_write (regcache, AMD64_RBP_REGNUM, buf);
+ regcache->cooked_write (AMD64_RBP_REGNUM, buf);
return sp + 16;
}
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 286a289..fad9170 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -664,7 +664,7 @@ arc_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Note we don't use write_unsigned here, since that would convert
the byte order, but we are already in the correct byte order. */
- regcache_cooked_write (regcache, arg_reg, data);
+ regcache->cooked_write (arg_reg, data);
data += ARC_REGISTER_SIZE;
total_space -= ARC_REGISTER_SIZE;
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index abb1a88..3ea0e79 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -3804,8 +3804,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
reg_char, reg_scaled + i);
regnum = user_reg_map_name_to_regnum (gdbarch, name_buf,
strlen (name_buf));
- regcache_cooked_write (regcache, regnum,
- val + i * unit_length);
+ regcache->cooked_write (regnum, val + i * unit_length);
}
}
continue;
@@ -8099,7 +8098,7 @@ arm_store_return_value (struct type *type, struct regcache *regs,
case ARM_FLOAT_FPA:
target_float_convert (valbuf, type, buf, arm_ext_type (gdbarch));
- regcache_cooked_write (regs, ARM_F0_REGNUM, buf);
+ regs->cooked_write (ARM_F0_REGNUM, buf);
break;
case ARM_FLOAT_SOFT_FPA:
@@ -8107,10 +8106,9 @@ arm_store_return_value (struct type *type, struct regcache *regs,
/* ARM_FLOAT_VFP can arise if this is a variadic function so
not using the VFP ABI code. */
case ARM_FLOAT_VFP:
- regcache_cooked_write (regs, ARM_A1_REGNUM, valbuf);
+ regs->cooked_write (ARM_A1_REGNUM, valbuf);
if (TYPE_LENGTH (type) > 4)
- regcache_cooked_write (regs, ARM_A1_REGNUM + 1,
- valbuf + INT_REGISTER_SIZE);
+ regs->cooked_write (ARM_A1_REGNUM + 1, valbuf + INT_REGISTER_SIZE);
break;
default:
@@ -8135,7 +8133,7 @@ arm_store_return_value (struct type *type, struct regcache *regs,
LONGEST val = unpack_long (type, valbuf);
store_signed_integer (tmpbuf, INT_REGISTER_SIZE, byte_order, val);
- regcache_cooked_write (regs, ARM_A1_REGNUM, tmpbuf);
+ regs->cooked_write (ARM_A1_REGNUM, tmpbuf);
}
else
{
@@ -8147,7 +8145,7 @@ arm_store_return_value (struct type *type, struct regcache *regs,
while (len > 0)
{
- regcache_cooked_write (regs, regno++, valbuf);
+ regs->cooked_write (regno++, valbuf);
len -= INT_REGISTER_SIZE;
valbuf += INT_REGISTER_SIZE;
}
@@ -8166,7 +8164,7 @@ arm_store_return_value (struct type *type, struct regcache *regs,
{
memcpy (tmpbuf, valbuf,
len > INT_REGISTER_SIZE ? INT_REGISTER_SIZE : len);
- regcache_cooked_write (regs, regno++, tmpbuf);
+ regs->cooked_write (regno++, tmpbuf);
len -= INT_REGISTER_SIZE;
valbuf += INT_REGISTER_SIZE;
}
@@ -8213,8 +8211,7 @@ arm_return_value (struct gdbarch *gdbarch, struct value *function,
regnum = user_reg_map_name_to_regnum (gdbarch, name_buf,
strlen (name_buf));
if (writebuf)
- regcache_cooked_write (regcache, regnum,
- writebuf + i * unit_length);
+ regcache->cooked_write (regnum, writebuf + i * unit_length);
if (readbuf)
regcache->cooked_read (regnum, readbuf + i * unit_length);
}
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 2629d54..d7895af 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -953,7 +953,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function,
if (writebuf != NULL)
{
for (i = 0; i < TYPE_LENGTH (valtype); i++)
- regcache_cooked_write (regcache, lsb_reg + i, writebuf + i);
+ regcache->cooked_write (lsb_reg + i, writebuf + i);
}
if (readbuf != NULL)
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index a2b3464..da62130 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -647,7 +647,7 @@ bfin_store_return_value (struct type *type,
while (len > 0)
{
- regcache_cooked_write (regs, regno++, valbuf);
+ regs->cooked_write (regno++, valbuf);
len -= 4;
valbuf += 4;
}
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index 5fa79ef..a0fb3b2 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -849,7 +849,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Data passed by value. Fits in available register(s). */
for (i = 0; i < reg_demand; i++)
{
- regcache_cooked_write (regcache, argreg, val);
+ regcache->cooked_write (argreg, val);
argreg++;
val += 4;
}
@@ -862,7 +862,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
if (argreg <= ARG4_REGNUM)
{
- regcache_cooked_write (regcache, argreg, val);
+ regcache->cooked_write (argreg, val);
argreg++;
val += 4;
}
diff --git a/gdb/frame.c b/gdb/frame.c
index c0f6e64..89f48ae 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1365,7 +1365,7 @@ put_frame_register (struct frame_info *frame, int regnum,
break;
}
case lval_register:
- regcache_cooked_write (get_current_regcache (), realnum, buf);
+ get_current_regcache ()->cooked_write (realnum, buf);
break;
default:
error (_("Attempt to assign to an unmodifiable value."));
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 7adffc4..1eed441 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -1327,12 +1327,12 @@ frv_store_return_value (struct type *type, struct regcache *regcache,
bfd_byte val[4];
memset (val, 0, sizeof (val));
memcpy (val + (4 - len), valbuf, len);
- regcache_cooked_write (regcache, 8, val);
+ regcache->cooked_write (8, val);
}
else if (len == 8)
{
- regcache_cooked_write (regcache, 8, valbuf);
- regcache_cooked_write (regcache, 9, (bfd_byte *) valbuf + 4);
+ regcache->cooked_write (8, valbuf);
+ regcache->cooked_write (9, (bfd_byte *) valbuf + 4);
}
else
internal_error (__FILE__, __LINE__,
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 5fe7851..1f3581e 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -820,17 +820,15 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
int fpLreg = 72 + (param_ptr - 36) / 4 * 2;
int fpreg = 74 + (param_ptr - 32) / 8 * 4;
- regcache_cooked_write (regcache, grreg, param_val);
- regcache_cooked_write (regcache, fpLreg, param_val);
+ regcache->cooked_write (grreg, param_val);
+ regcache->cooked_write (fpLreg, param_val);
if (param_len > 4)
{
- regcache_cooked_write (regcache, grreg + 1,
- param_val + 4);
+ regcache->cooked_write (grreg + 1, param_val + 4);
- regcache_cooked_write (regcache, fpreg, param_val);
- regcache_cooked_write (regcache, fpreg + 1,
- param_val + 4);
+ regcache->cooked_write (fpreg, param_val);
+ regcache->cooked_write (fpreg + 1, param_val + 4);
}
}
}
@@ -1167,7 +1165,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf != NULL)
regcache->cooked_read (reg, readbuf + b);
if (writebuf != NULL)
- regcache_cooked_write (regcache, reg, writebuf + b);
+ regcache->cooked_write (reg, writebuf + b);
reg++;
}
return RETURN_VALUE_REGISTER_CONVENTION;
diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c
index 21f0a4c..5a1807a 100644
--- a/gdb/i386-darwin-tdep.c
+++ b/gdb/i386-darwin-tdep.c
@@ -227,10 +227,10 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Finally, update the stack pointer... */
store_unsigned_integer (buf, 4, byte_order, sp);
- regcache_cooked_write (regcache, I386_ESP_REGNUM, buf);
+ regcache->cooked_write (I386_ESP_REGNUM, buf);
/* ...and fake a frame pointer. */
- regcache_cooked_write (regcache, I386_EBP_REGNUM, buf);
+ regcache->cooked_write (I386_EBP_REGNUM, buf);
/* MarkK wrote: This "+ 8" is all over the place:
(i386_frame_this_id, i386_sigtramp_frame_this_id,
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index cdb5fc8..158344f 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2755,10 +2755,10 @@ i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Finally, update the stack pointer... */
store_unsigned_integer (buf, 4, byte_order, sp);
- regcache_cooked_write (regcache, I386_ESP_REGNUM, buf);
+ regcache->cooked_write (I386_ESP_REGNUM, buf);
/* ...and fake a frame pointer. */
- regcache_cooked_write (regcache, I386_EBP_REGNUM, buf);
+ regcache->cooked_write (I386_EBP_REGNUM, buf);
/* MarkK wrote: This "+ 8" is all over the place:
(i386_frame_this_id, i386_sigtramp_frame_this_id,
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 7eb84ff..a24e5cb 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -3277,7 +3277,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache,
{
target_float_convert (valbuf + offset, float_elt_type,
to, ia64_ext_type (gdbarch));
- regcache_cooked_write (regcache, regnum, to);
+ regcache->cooked_write (regnum, to);
offset += TYPE_LENGTH (float_elt_type);
regnum++;
}
@@ -3834,7 +3834,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
target_float_convert (value_contents (arg) + argoffset,
float_elt_type, to,
ia64_ext_type (gdbarch));
- regcache_cooked_write (regcache, floatreg, to);
+ regcache->cooked_write (floatreg, to);
floatreg++;
argoffset += TYPE_LENGTH (float_elt_type);
len -= TYPE_LENGTH (float_elt_type);
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 2825efb..b7cba1c 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -511,13 +511,13 @@ m32c_cat_write (struct m32c_reg *reg, struct regcache *cache,
if (gdbarch_byte_order (reg->arch) == BFD_ENDIAN_BIG)
{
- regcache_cooked_write (cache, reg->rx->num, buf);
- regcache_cooked_write (cache, reg->ry->num, buf + high_bytes);
+ cache->cooked_write (reg->rx->num, buf);
+ cache->cooked_write (reg->ry->num, buf + high_bytes);
}
else
{
- regcache_cooked_write (cache, reg->rx->num, buf + low_bytes);
- regcache_cooked_write (cache, reg->ry->num, buf);
+ cache->cooked_write (reg->rx->num, buf + low_bytes);
+ cache->cooked_write (reg->ry->num, buf);
}
return REG_VALID;
@@ -571,17 +571,17 @@ m32c_r3r2r1r0_write (struct m32c_reg *reg, struct regcache *cache,
if (gdbarch_byte_order (reg->arch) == BFD_ENDIAN_BIG)
{
- regcache_cooked_write (cache, tdep->r0->num, buf + len * 3);
- regcache_cooked_write (cache, tdep->r1->num, buf + len * 2);
- regcache_cooked_write (cache, tdep->r2->num, buf + len * 1);
- regcache_cooked_write (cache, tdep->r3->num, buf);
+ cache->cooked_write (tdep->r0->num, buf + len * 3);
+ cache->cooked_write (tdep->r1->num, buf + len * 2);
+ cache->cooked_write (tdep->r2->num, buf + len * 1);
+ cache->cooked_write (tdep->r3->num, buf);
}
else
{
- regcache_cooked_write (cache, tdep->r0->num, buf);
- regcache_cooked_write (cache, tdep->r1->num, buf + len * 1);
- regcache_cooked_write (cache, tdep->r2->num, buf + len * 2);
- regcache_cooked_write (cache, tdep->r3->num, buf + len * 3);
+ cache->cooked_write (tdep->r0->num, buf);
+ cache->cooked_write (tdep->r1->num, buf + len * 1);
+ cache->cooked_write (tdep->r2->num, buf + len * 2);
+ cache->cooked_write (tdep->r3->num, buf + len * 3);
}
return REG_VALID;
@@ -2092,7 +2092,7 @@ m32c_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
&& arg_size == 2
&& i < num_prototyped_args
&& m32c_reg_arg_type (arg_type))
- regcache_cooked_write (regcache, tdep->r2->num, arg_bits);
+ regcache->cooked_write (tdep->r2->num, arg_bits);
/* Everything else goes on the stack. */
else
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 432c37c..a6e9b58 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -525,7 +525,7 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (struct_return)
{
store_unsigned_integer (buf, 4, byte_order, struct_addr);
- regcache_cooked_write (regcache, tdep->struct_value_regnum, buf);
+ regcache->cooked_write (tdep->struct_value_regnum, buf);
}
/* Store return address. */
@@ -535,10 +535,10 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Finally, update the stack pointer... */
store_unsigned_integer (buf, 4, byte_order, sp);
- regcache_cooked_write (regcache, M68K_SP_REGNUM, buf);
+ regcache->cooked_write (M68K_SP_REGNUM, buf);
/* ...and fake a frame pointer. */
- regcache_cooked_write (regcache, M68K_FP_REGNUM, buf);
+ regcache->cooked_write (M68K_FP_REGNUM, buf);
/* DWARF2/GCC uses the stack address *before* the function call as a
frame's CFA. */
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index f503590..9bac864 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -573,13 +573,13 @@ microblaze_store_return_value (struct type *type, struct regcache *regcache,
{
gdb_assert (len == 8);
memcpy (buf, valbuf, 8);
- regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf + 4);
+ regcache->cooked_write (MICROBLAZE_RETVAL_REGNUM+1, buf + 4);
}
else
/* ??? Do we need to do any sign-extension here? */
memcpy (buf + 4 - len, valbuf, len);
- regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
+ regcache->cooked_write (MICROBLAZE_RETVAL_REGNUM, buf);
}
static enum return_value_convention
diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
index 35375fb..b616cc9 100644
--- a/gdb/nds32-tdep.c
+++ b/gdb/nds32-tdep.c
@@ -1587,13 +1587,11 @@ nds32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
switch (len)
{
case 4:
- regcache_cooked_write (regcache,
- tdep->fs0_regnum + foff, val);
+ regcache->cooked_write (tdep->fs0_regnum + foff, val);
foff++;
break;
case 8:
- regcache_cooked_write (regcache,
- NDS32_FD0_REGNUM + (foff >> 1), val);
+ regcache->cooked_write (NDS32_FD0_REGNUM + (foff >> 1), val);
foff += 2;
break;
default:
@@ -1830,9 +1828,9 @@ nds32_store_return_value (struct gdbarch *gdbarch, struct type *type,
if (abi_use_fpr && calling_use_fpr)
{
if (len == 4)
- regcache_cooked_write (regcache, tdep->fs0_regnum, valbuf);
+ regcache->cooked_write (tdep->fs0_regnum, valbuf);
else if (len == 8)
- regcache_cooked_write (regcache, NDS32_FD0_REGNUM, valbuf);
+ regcache->cooked_write (NDS32_FD0_REGNUM, valbuf);
else
internal_error (__FILE__, __LINE__,
_("Cannot store return value of %d bytes "
@@ -1849,7 +1847,7 @@ nds32_store_return_value (struct gdbarch *gdbarch, struct type *type,
}
else if (len == 4)
{
- regcache_cooked_write (regcache, NDS32_R0_REGNUM, valbuf);
+ regcache->cooked_write (NDS32_R0_REGNUM, valbuf);
}
else if (len < 8)
{
@@ -1867,8 +1865,8 @@ nds32_store_return_value (struct gdbarch *gdbarch, struct type *type,
}
else
{
- regcache_cooked_write (regcache, NDS32_R0_REGNUM, valbuf);
- regcache_cooked_write (regcache, NDS32_R0_REGNUM + 1, valbuf + 4);
+ regcache->cooked_write (NDS32_R0_REGNUM, valbuf);
+ regcache->cooked_write (NDS32_R0_REGNUM + 1, valbuf + 4);
}
}
}
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index e1cbd97..91b4381 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -228,13 +228,13 @@ nios2_store_return_value (struct gdbarch *gdbarch, struct type *valtype,
/* Return values of up to 8 bytes are returned in $r2 $r3. */
if (len <= register_size (gdbarch, NIOS2_R2_REGNUM))
- regcache_cooked_write (regcache, NIOS2_R2_REGNUM, valbuf);
+ regcache->cooked_write (NIOS2_R2_REGNUM, valbuf);
else
{
gdb_assert (len <= (register_size (gdbarch, NIOS2_R2_REGNUM)
+ register_size (gdbarch, NIOS2_R3_REGNUM)));
- regcache_cooked_write (regcache, NIOS2_R2_REGNUM, valbuf);
- regcache_cooked_write (regcache, NIOS2_R3_REGNUM, valbuf + 4);
+ regcache->cooked_write (NIOS2_R2_REGNUM, valbuf);
+ regcache->cooked_write (NIOS2_R3_REGNUM, valbuf + 4);
}
}
diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c
index 329615f..c5104e3 100644
--- a/gdb/or1k-tdep.c
+++ b/gdb/or1k-tdep.c
@@ -297,7 +297,7 @@ or1k_return_value (struct gdbarch *gdbarch, struct value *functype,
else
memcpy (buf, writebuf, rv_size);
- regcache_cooked_write (regcache, OR1K_RV_REGNUM, buf);
+ regcache->cooked_write (OR1K_RV_REGNUM, buf);
free (buf);
}
@@ -330,8 +330,8 @@ or1k_return_value (struct gdbarch *gdbarch, struct value *functype,
memcpy (buf_hi, writebuf, rv_size - bpw);
memcpy (buf_lo, writebuf + bpw, bpw);
- regcache_cooked_write (regcache, OR1K_RV_REGNUM, buf_hi);
- regcache_cooked_write (regcache, OR1K_RV_REGNUM + 1, buf_lo);
+ regcache->cooked_write (OR1K_RV_REGNUM, buf_hi);
+ regcache->cooked_write (OR1K_RV_REGNUM + 1, buf_lo);
free (buf_lo);
free (buf_hi);
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 04f9447..42dc63c 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -139,9 +139,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct type *regtype
= register_type (gdbarch, tdep->ppc_fp0_regnum + freg);
target_float_convert (val, type, regval, regtype);
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + freg,
- regval);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + freg,
+ regval);
}
freg++;
}
@@ -176,12 +175,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
if (write_pass)
{
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + freg,
- val);
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + freg + 1,
- val + 8);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + freg, val);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + freg + 1,
+ val + 8);
}
freg += 2;
}
@@ -221,12 +217,10 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
greg++;
if (write_pass)
{
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg + 0,
- val + 0);
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg + 1,
- val + 4);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 0,
+ val + 0);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 1,
+ val + 4);
}
greg += 2;
}
@@ -253,18 +247,14 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
if (write_pass)
{
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg + 0,
- val + 0);
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg + 1,
- val + 4);
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg + 2,
- val + 8);
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg + 3,
- val + 12);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 0,
+ val + 0);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 1,
+ val + 4);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 2,
+ val + 8);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg + 3,
+ val + 12);
}
greg += 4;
}
@@ -292,8 +282,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
else
p = val;
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + freg, p);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + freg, p);
}
freg++;
@@ -322,10 +311,9 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (write_pass)
{
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + freg, val);
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + freg + 1, val + 8);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + freg, val);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + freg + 1,
+ val + 8);
}
}
else
@@ -370,7 +358,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
= register_type (gdbarch, regnum);
target_float_convert (elval, eltype,
regval, regtype);
- regcache_cooked_write (regcache, regnum, regval);
+ regcache->cooked_write (regnum, regval);
}
freg++;
}
@@ -402,10 +390,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (write_pass)
{
int regnum = tdep->ppc_gp0_regnum + greg;
- regcache_cooked_write (regcache,
- regnum + 0, elval + 0);
- regcache_cooked_write (regcache,
- regnum + 1, elval + 4);
+ regcache->cooked_write (regnum + 0, elval + 0);
+ regcache->cooked_write (regnum + 1, elval + 4);
}
greg += 2;
}
@@ -419,9 +405,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (greg <= 10)
{
if (write_pass)
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg,
- word);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg,
+ word);
greg++;
}
else
@@ -450,9 +435,8 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (vreg <= 13)
{
if (write_pass)
- regcache_cooked_write (regcache,
- tdep->ppc_vr0_regnum + vreg,
- elval);
+ regcache->cooked_write (tdep->ppc_vr0_regnum + vreg,
+ elval);
vreg++;
}
else
@@ -474,8 +458,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (vreg <= 13)
{
if (write_pass)
- regcache_cooked_write (regcache,
- tdep->ppc_vr0_regnum + vreg, val);
+ regcache->cooked_write (tdep->ppc_vr0_regnum + vreg, val);
vreg++;
}
else
@@ -501,8 +484,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (greg <= 10)
{
if (write_pass)
- regcache_cooked_write (regcache,
- tdep->ppc_ev0_regnum + greg, val);
+ regcache->cooked_write (tdep->ppc_ev0_regnum + greg, val);
greg++;
}
else
@@ -552,8 +534,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (greg <= 10)
{
if (write_pass)
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + greg, word);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + greg, word);
greg++;
}
else
@@ -636,7 +617,7 @@ get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype,
else
p = writebuf;
- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, p);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 1, p);
}
if (readbuf != NULL)
{
@@ -657,8 +638,8 @@ get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype,
for (i = 0; i < 2; i++)
{
if (writebuf != NULL)
- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2 + i,
- writebuf + i * 8);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 2 + i,
+ writebuf + i * 8);
if (readbuf != NULL)
regcache->cooked_read (tdep->ppc_fp0_regnum + 2 + i,
readbuf + i * 8);
@@ -720,7 +701,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
struct type *regtype = register_type (gdbarch, tdep->ppc_fp0_regnum);
target_float_convert (writebuf, type, regval, regtype);
- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -738,9 +719,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
}
if (writebuf)
{
- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, writebuf);
- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2,
- writebuf + 8);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 1, writebuf);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 2, writebuf + 8);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -761,13 +741,10 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
}
if (writebuf)
{
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
- writebuf + 4);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 5,
- writebuf + 8);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 6,
- writebuf + 12);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 5, writebuf + 8);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 6, writebuf + 12);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -787,10 +764,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
{
/* A long long, double or _Decimal64 stored in the 32 bit
r3/r4. */
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
- writebuf + 0);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
- writebuf + 4);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf + 0);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -849,7 +824,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
{
target_float_convert (writebuf + offset, eltype,
regval, regtype);
- regcache_cooked_write (regcache, regnum, regval);
+ regcache->cooked_write (regnum, regval);
}
if (readbuf != NULL)
{
@@ -895,7 +870,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
int regnum = tdep->ppc_vr0_regnum + 2 + i;
if (writebuf != NULL)
- regcache_cooked_write (regcache, regnum, writebuf + offset);
+ regcache->cooked_write (regnum, writebuf + offset);
if (readbuf != NULL)
regcache->cooked_read (regnum, readbuf + offset);
}
@@ -915,7 +890,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
if (writebuf)
{
/* Altivec places the return value in "v2". */
- regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+ regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -936,14 +911,10 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
}
if (writebuf)
{
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
- writebuf + 0);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
- writebuf + 4);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 5,
- writebuf + 8);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 6,
- writebuf + 12);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf + 0);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 5, writebuf + 8);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 6, writebuf + 12);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -960,7 +931,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
if (readbuf)
regcache->cooked_read (tdep->ppc_ev0_regnum + 3, readbuf);
if (writebuf)
- regcache_cooked_write (regcache, tdep->ppc_ev0_regnum + 3, writebuf);
+ regcache->cooked_write (tdep->ppc_ev0_regnum + 3, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
if (broken_gcc && TYPE_LENGTH (type) <= 8)
@@ -985,11 +956,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
{
memset (regvals, 0, sizeof regvals);
memcpy (regvals + offset, writebuf, len);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
- regvals + 0 * tdep->wordsize);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3,
+ regvals + 0 * tdep->wordsize);
if (len > tdep->wordsize)
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
- regvals + 1 * tdep->wordsize);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 4,
+ regvals + 1 * tdep->wordsize);
}
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -1017,11 +988,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
gdb_byte regvals[PPC_MAX_REGISTER_SIZE * 2];
memset (regvals, 0, sizeof regvals);
memcpy (regvals, writebuf, TYPE_LENGTH (type));
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3,
- regvals + 0 * tdep->wordsize);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3,
+ regvals + 0 * tdep->wordsize);
if (TYPE_LENGTH (type) > tdep->wordsize)
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
- regvals + 1 * tdep->wordsize);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 4,
+ regvals + 1 * tdep->wordsize);
}
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -1305,8 +1276,8 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
while (len >= tdep->wordsize)
{
if (argpos->regcache && argpos->greg <= 10)
- regcache_cooked_write (argpos->regcache,
- tdep->ppc_gp0_regnum + argpos->greg, val);
+ argpos->regcache->cooked_write (tdep->ppc_gp0_regnum + argpos->greg,
+ val);
argpos->greg++;
len -= tdep->wordsize;
val += tdep->wordsize;
@@ -1363,7 +1334,7 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch,
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
target_float_convert (val, type, regval, regtype);
- regcache_cooked_write (argpos->regcache, regnum, regval);
+ argpos->regcache->cooked_write (regnum, regval);
}
argpos->freg++;
@@ -1397,9 +1368,9 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch,
{
int regnum = tdep->ppc_fp0_regnum + argpos->freg;
- regcache_cooked_write (argpos->regcache, regnum, val);
+ argpos->regcache->cooked_write (regnum, val);
if (argpos->freg <= 12)
- regcache_cooked_write (argpos->regcache, regnum + 1, val + 8);
+ argpos->regcache->cooked_write (regnum + 1, val + 8);
}
argpos->freg += 2;
@@ -1417,8 +1388,8 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch,
int lopart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 8 : 0;
int hipart = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8;
- regcache_cooked_write (argpos->regcache, regnum, val + hipart);
- regcache_cooked_write (argpos->regcache, regnum + 1, val + lopart);
+ argpos->regcache->cooked_write (regnum, val + hipart);
+ argpos->regcache->cooked_write (regnum + 1, val + lopart);
}
argpos->freg += 2;
@@ -1435,8 +1406,7 @@ ppc64_sysv_abi_push_vreg (struct gdbarch *gdbarch, const bfd_byte *val,
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (argpos->regcache && argpos->vreg <= 13)
- regcache_cooked_write (argpos->regcache,
- tdep->ppc_vr0_regnum + argpos->vreg, val);
+ argpos->regcache->cooked_write (tdep->ppc_vr0_regnum + argpos->vreg, val);
argpos->vreg++;
}
@@ -1810,7 +1780,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
if (writebuf != NULL)
{
target_float_convert (writebuf, valtype, regval, regtype);
- regcache_cooked_write (regcache, regnum, regval);
+ regcache->cooked_write (regnum, regval);
}
if (readbuf != NULL)
{
@@ -1850,8 +1820,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
if (writebuf != NULL)
{
- regcache_cooked_write (regcache, regnum, writebuf);
- regcache_cooked_write (regcache, regnum + 1, writebuf + 8);
+ regcache->cooked_write (regnum, writebuf);
+ regcache->cooked_write (regnum + 1, writebuf + 8);
}
if (readbuf != NULL)
{
@@ -1872,8 +1842,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
if (writebuf != NULL)
{
- regcache_cooked_write (regcache, regnum, writebuf + hipart);
- regcache_cooked_write (regcache, regnum + 1, writebuf + lopart);
+ regcache->cooked_write (regnum, writebuf + hipart);
+ regcache->cooked_write (regnum + 1, writebuf + lopart);
}
if (readbuf != NULL)
{
@@ -1891,7 +1861,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
int regnum = tdep->ppc_vr0_regnum + 2 + index;
if (writebuf != NULL)
- regcache_cooked_write (regcache, regnum, writebuf);
+ regcache->cooked_write (regnum, writebuf);
if (readbuf != NULL)
regcache->cooked_read (regnum, readbuf);
return 1;
@@ -1996,7 +1966,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
int regnum = tdep->ppc_gp0_regnum + 3;
if (writebuf != NULL)
- regcache_cooked_write (regcache, regnum, writebuf);
+ regcache->cooked_write (regnum, writebuf);
if (readbuf != NULL)
regcache->cooked_read (regnum, readbuf);
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -2078,7 +2048,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
memcpy (regval + tdep->wordsize - len, writebuf, len);
else
memcpy (regval, writebuf + offset, len);
- regcache_cooked_write (regcache, regnum, regval);
+ regcache->cooked_write (regnum, regval);
}
if (readbuf != NULL)
{
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 8c0534e..bf65701 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -834,8 +834,7 @@ record_full_exec_insn (struct regcache *regcache,
entry->u.reg.num);
regcache->cooked_read (entry->u.reg.num, reg.data ());
- regcache_cooked_write (regcache, entry->u.reg.num,
- record_full_get_loc (entry));
+ regcache->cooked_write (entry->u.reg.num, record_full_get_loc (entry));
memcpy (record_full_get_loc (entry), reg.data (), entry->u.reg.len);
}
break;
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 4dce978..0e2d040 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -772,13 +772,6 @@ regcache::raw_write (int regnum, const gdb_byte *buf)
}
void
-regcache_cooked_write (struct regcache *regcache, int regnum,
- const gdb_byte *buf)
-{
- regcache->cooked_write (regnum, buf);
-}
-
-void
regcache::cooked_write (int regnum, const gdb_byte *buf)
{
gdb_assert (regnum >= 0);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 64e4cd7..4be1ae1 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -50,14 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache,
extern LONGEST regcache_raw_get_signed (struct regcache *regcache,
int regnum);
-/* Transfer of pseudo-registers. The read variants return a register
- status, as an indication of when a ``cooked'' register was
- constructed from valid, invalid or unavailable ``raw''
- registers. */
-
-void regcache_cooked_write (struct regcache *regcache, int rawnum,
- const gdb_byte *buf);
-
/* Read register REGNUM from REGCACHE and return a new value. This
will call mark_value_bytes_unavailable as appropriate. */
@@ -304,8 +296,6 @@ public:
read-only register cache. */
void restore (readonly_detached_regcache *src);
- void cooked_write (int regnum, const gdb_byte *buf);
-
/* Update the value of raw register REGNUM (in the range [0..NUM_REGS)) and
transfer its value to core-gdb. */
@@ -314,6 +304,9 @@ public:
template<typename T, typename = RequireLongest<T>>
void raw_write (int regnum, T val);
+ /* Transfer of pseudo-registers. */
+ void cooked_write (int regnum, const gdb_byte *buf);
+
template<typename T, typename = RequireLongest<T>>
void cooked_write (int regnum, T val);
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 6943121..1545671 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -2103,7 +2103,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch,
gdb_byte buf[sizeof (LONGEST)];
store_unsigned_integer (buf, call_info.xlen, byte_order, struct_addr);
- regcache_cooked_write (regcache, RISCV_A0_REGNUM, buf);
+ regcache->cooked_write (RISCV_A0_REGNUM, buf);
}
for (i = 0; i < nargs; ++i)
@@ -2124,9 +2124,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch,
gdb_assert (info->argloc[0].c_length <= info->length);
memset (tmp, 0, sizeof (tmp));
memcpy (tmp, info->contents, info->argloc[0].c_length);
- regcache_cooked_write (regcache,
- info->argloc[0].loc_data.regno,
- tmp);
+ regcache->cooked_write (info->argloc[0].loc_data.regno, tmp);
second_arg_length =
((info->argloc[0].c_length < info->length)
? info->argloc[1].c_length : 0);
@@ -2163,9 +2161,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch,
gdb_assert (second_arg_length <= call_info.xlen);
memset (tmp, 0, sizeof (tmp));
memcpy (tmp, second_arg_data, second_arg_length);
- regcache_cooked_write (regcache,
- info->argloc[1].loc_data.regno,
- tmp);
+ regcache->cooked_write (info->argloc[1].loc_data.regno, tmp);
}
break;
@@ -2251,7 +2247,7 @@ riscv_return_value (struct gdbarch *gdbarch,
regcache->cooked_read (regnum, readbuf);
if (writebuf)
- regcache_cooked_write (regcache, regnum, writebuf);
+ regcache->cooked_write (regnum, writebuf);
/* A return value in register can have a second part in a
second register. */
@@ -2271,7 +2267,7 @@ riscv_return_value (struct gdbarch *gdbarch,
if (writebuf)
{
writebuf += info.argloc[1].c_offset;
- regcache_cooked_write (regcache, regnum, writebuf);
+ regcache->cooked_write (regnum, writebuf);
}
break;
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index bb9e6be..8e69c46 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -250,7 +250,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
gdb_assert (len <= 8);
target_float_convert (value_contents (arg), type, reg_val, reg_type);
- regcache_cooked_write (regcache, fp_regnum, reg_val);
+ regcache->cooked_write (fp_regnum, reg_val);
++f_argno;
}
@@ -266,9 +266,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
((char *) value_contents (arg)) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + 3 + ii,
- word);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
++ii, argbytes += reg_size;
if (ii >= 8)
@@ -284,7 +282,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
memset (word, 0, reg_size);
memcpy (word, value_contents (arg), len);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
}
++argno;
}
@@ -366,9 +364,8 @@ ran_out_of_registers_for_arguments:
gdb_assert (len <= 8);
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + 1 + f_argno,
- value_contents (arg));
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
+ value_contents (arg));
++f_argno;
}
@@ -422,7 +419,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf)
regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf);
if (writebuf)
- regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+ regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -458,7 +455,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function,
if (writebuf)
{
target_float_convert (writebuf, valtype, regval, regtype);
- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval);
}
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -510,9 +507,8 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function,
}
if (writebuf)
{
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
- writebuf + 4);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4);
}
return RETURN_VALUE_REGISTER_CONVENTION;
diff --git a/gdb/rs6000-lynx178-tdep.c b/gdb/rs6000-lynx178-tdep.c
index 37ac617..13eed3a 100644
--- a/gdb/rs6000-lynx178-tdep.c
+++ b/gdb/rs6000-lynx178-tdep.c
@@ -112,7 +112,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
gdb_assert (len <= 8);
target_float_convert (value_contents (arg), type, reg_val, reg_type);
- regcache_cooked_write (regcache, fp_regnum, reg_val);
+ regcache->cooked_write (fp_regnum, reg_val);
++f_argno;
}
@@ -128,9 +128,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
((char *) value_contents (arg)) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
- regcache_cooked_write (regcache,
- tdep->ppc_gp0_regnum + 3 + ii,
- word);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
++ii, argbytes += reg_size;
if (ii >= 8)
@@ -146,7 +144,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
memset (word, 0, reg_size);
memcpy (word, value_contents (arg), len);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3 +ii, word);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
}
++argno;
}
@@ -229,9 +227,8 @@ ran_out_of_registers_for_arguments:
gdb_assert (len <= 8);
- regcache_cooked_write (regcache,
- tdep->ppc_fp0_regnum + 1 + f_argno,
- value_contents (arg));
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
+ value_contents (arg));
++f_argno;
}
@@ -283,7 +280,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf)
regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf);
if (writebuf)
- regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
+ regcache->cooked_write (tdep->ppc_vr0_regnum + 2, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -319,7 +316,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
if (writebuf)
{
target_float_convert (writebuf, valtype, regval, regtype);
- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, regval);
+ regcache->cooked_write (tdep->ppc_fp0_regnum + 1, regval);
}
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -371,9 +368,8 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
}
if (writebuf)
{
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 3, writebuf);
- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + 4,
- writebuf + 4);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 3, writebuf);
+ regcache->cooked_write (tdep->ppc_gp0_regnum + 4, writebuf + 4);
}
return RETURN_VALUE_REGISTER_CONVENTION;
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 8a82fb9..eaf1550 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1800,12 +1800,10 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
{
if (write_mode)
{
- regcache_cooked_write (as->regcache,
- S390_R0_REGNUM + as->gr,
- value_contents (arg));
- regcache_cooked_write (as->regcache,
- S390_R0_REGNUM + as->gr + 1,
- value_contents (arg) + word_size);
+ as->regcache->cooked_write (S390_R0_REGNUM + as->gr,
+ value_contents (arg));
+ as->regcache->cooked_write (S390_R0_REGNUM + as->gr + 1,
+ value_contents (arg) + word_size);
}
as->gr += 2;
}
@@ -2018,9 +2016,8 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
/* Double word: in r2 and r3. */
if (in != NULL)
{
- regcache_cooked_write (regcache, S390_R2_REGNUM, in);
- regcache_cooked_write (regcache, S390_R3_REGNUM,
- in + word_size);
+ regcache->cooked_write (S390_R2_REGNUM, in);
+ regcache->cooked_write (S390_R3_REGNUM, in + word_size);
}
else
{
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index b3b3dcb..40d213f 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -685,9 +685,9 @@ sparc32_store_arguments (struct regcache *regcache, int nargs,
{
int regnum = SPARC_O0_REGNUM + element;
- regcache_cooked_write (regcache, regnum, valbuf);
+ regcache->cooked_write (regnum, valbuf);
if (len > 4 && element < 5)
- regcache_cooked_write (regcache, regnum + 1, valbuf + 4);
+ regcache->cooked_write (regnum + 1, valbuf + 4);
}
/* Always store the argument in memory. */
@@ -1463,20 +1463,20 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache,
{
/* Floating return values. */
memcpy (buf, valbuf, len);
- regcache_cooked_write (regcache, SPARC_F0_REGNUM, buf);
+ regcache->cooked_write (SPARC_F0_REGNUM, buf);
if (len > 4)
- regcache_cooked_write (regcache, SPARC_F1_REGNUM, buf + 4);
+ regcache->cooked_write (SPARC_F1_REGNUM, buf + 4);
if (len > 8)
{
- regcache_cooked_write (regcache, SPARC_F2_REGNUM, buf + 8);
- regcache_cooked_write (regcache, SPARC_F3_REGNUM, buf + 12);
+ regcache->cooked_write (SPARC_F2_REGNUM, buf + 8);
+ regcache->cooked_write (SPARC_F3_REGNUM, buf + 12);
}
if (len > 16)
{
- regcache_cooked_write (regcache, SPARC_F4_REGNUM, buf + 16);
- regcache_cooked_write (regcache, SPARC_F5_REGNUM, buf + 20);
- regcache_cooked_write (regcache, SPARC_F6_REGNUM, buf + 24);
- regcache_cooked_write (regcache, SPARC_F7_REGNUM, buf + 28);
+ regcache->cooked_write (SPARC_F4_REGNUM, buf + 16);
+ regcache->cooked_write (SPARC_F5_REGNUM, buf + 20);
+ regcache->cooked_write (SPARC_F6_REGNUM, buf + 24);
+ regcache->cooked_write (SPARC_F7_REGNUM, buf + 28);
}
}
else
@@ -1488,14 +1488,14 @@ sparc32_store_return_value (struct type *type, struct regcache *regcache,
{
gdb_assert (len == 8);
memcpy (buf, valbuf, 8);
- regcache_cooked_write (regcache, SPARC_O1_REGNUM, buf + 4);
+ regcache->cooked_write (SPARC_O1_REGNUM, buf + 4);
}
else
{
/* ??? Do we need to do any sign-extension here? */
memcpy (buf + 4 - len, valbuf, len);
}
- regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf);
+ regcache->cooked_write (SPARC_O0_REGNUM, buf);
}
}
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index ed1aaff..dea8e4d 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -1226,7 +1226,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
len = 8;
}
for (int n = 0; n < (len + 3) / 4; n++)
- regcache_cooked_write (regcache, regnum + n, valbuf + n * 4);
+ regcache->cooked_write (regnum + n, valbuf + n * 4);
}
else if (sparc64_floating_p (type)
|| (sparc64_complex_floating_p (type) && len <= 16))
@@ -1239,7 +1239,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
gdb_assert ((element % 2) == 0);
regnum = gdbarch_num_regs (gdbarch) + SPARC64_Q0_REGNUM + element / 2;
- regcache_cooked_write (regcache, regnum, valbuf);
+ regcache->cooked_write (regnum, valbuf);
}
else if (len == 8)
{
@@ -1247,7 +1247,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
regnum = gdbarch_num_regs (gdbarch) + SPARC64_D0_REGNUM
+ element + bitpos / 64;
- regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8));
+ regcache->cooked_write (regnum, valbuf + (bitpos / 8));
}
else
{
@@ -1255,7 +1255,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 128);
regnum = SPARC_F0_REGNUM + element * 2 + bitpos / 32;
- regcache_cooked_write (regcache, regnum, valbuf + (bitpos / 8));
+ regcache->cooked_write (regnum, valbuf + (bitpos / 8));
}
}
else if (sparc64_structure_or_union_p (type))
@@ -1285,7 +1285,7 @@ sparc64_store_floating_fields (struct regcache *regcache, struct type *type,
struct type *subtype = check_typedef (TYPE_FIELD_TYPE (type, 0));
if (sparc64_floating_p (subtype) && TYPE_LENGTH (subtype) == 4)
- regcache_cooked_write (regcache, SPARC_F1_REGNUM, valbuf);
+ regcache->cooked_write (SPARC_F1_REGNUM, valbuf);
}
}
}
@@ -1506,7 +1506,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
{
regnum = SPARC_O0_REGNUM + element;
if (len > 8 && element < 5)
- regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
+ regcache->cooked_write (regnum + 1, valbuf + 8);
}
if (element < 16)
@@ -1522,11 +1522,10 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
if (len == 16)
{
if (regnum < gdbarch_num_regs (gdbarch) + SPARC64_D30_REGNUM)
- regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
+ regcache->cooked_write (regnum + 1, valbuf + 8);
if (regnum < gdbarch_num_regs (gdbarch) + SPARC64_D10_REGNUM)
- regcache_cooked_write (regcache,
- SPARC_O0_REGNUM + element + 1,
- valbuf + 8);
+ regcache->cooked_write (SPARC_O0_REGNUM + element + 1,
+ valbuf + 8);
}
}
}
@@ -1574,7 +1573,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
if (regnum != -1)
{
- regcache_cooked_write (regcache, regnum, valbuf);
+ regcache->cooked_write (regnum, valbuf);
/* If we're storing the value in a floating-point register,
also store it in the corresponding %0 register(s). */
@@ -1586,14 +1585,14 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
{
gdb_assert (element < 6);
regnum = SPARC_O0_REGNUM + element;
- regcache_cooked_write (regcache, regnum, valbuf);
+ regcache->cooked_write (regnum, valbuf);
}
else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q8_REGNUM)
{
gdb_assert (element < 5);
regnum = SPARC_O0_REGNUM + element;
- regcache_cooked_write (regcache, regnum, valbuf);
- regcache_cooked_write (regcache, regnum + 1, valbuf + 8);
+ regcache->cooked_write (regnum, valbuf);
+ regcache->cooked_write (regnum + 1, valbuf + 8);
}
}
}
@@ -1715,7 +1714,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache,
memset (buf, 0, sizeof (buf));
memcpy (buf, valbuf, len);
for (i = 0; i < ((len + 7) / 8); i++)
- regcache_cooked_write (regcache, SPARC_O0_REGNUM + i, buf + i * 8);
+ regcache->cooked_write (SPARC_O0_REGNUM + i, buf + i * 8);
if (TYPE_CODE (type) != TYPE_CODE_UNION)
sparc64_store_floating_fields (regcache, type, buf, 0, 0);
}
@@ -1724,7 +1723,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache,
/* Floating return values. */
memcpy (buf, valbuf, len);
for (i = 0; i < len / 4; i++)
- regcache_cooked_write (regcache, SPARC_F0_REGNUM + i, buf + i * 4);
+ regcache->cooked_write (SPARC_F0_REGNUM + i, buf + i * 4);
}
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
@@ -1734,7 +1733,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache,
memset (buf, 0, sizeof (buf));
memcpy (buf, valbuf, len);
for (i = 0; i < ((len + 7) / 8); i++)
- regcache_cooked_write (regcache, SPARC_O0_REGNUM + i, buf + i * 8);
+ regcache->cooked_write (SPARC_O0_REGNUM + i, buf + i * 8);
}
else
{
@@ -1744,7 +1743,7 @@ sparc64_store_return_value (struct type *type, struct regcache *regcache,
/* ??? Do we need to do any sign-extension here? */
memset (buf, 0, 8);
memcpy (buf + 8 - len, valbuf, len);
- regcache_cooked_write (regcache, SPARC_O0_REGNUM, buf);
+ regcache->cooked_write (SPARC_O0_REGNUM, buf);
}
}
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 1d0766e..d8a2107 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1362,7 +1362,7 @@ spu_value_to_regcache (struct regcache *regcache, int regnum,
{
while (len >= 16)
{
- regcache_cooked_write (regcache, regnum++, in);
+ regcache->cooked_write (regnum++, in);
in += 16;
len -= 16;
}
@@ -1413,7 +1413,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Set the return address. */
memset (buf, 0, sizeof buf);
store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (bp_addr));
- regcache_cooked_write (regcache, SPU_LR_REGNUM, buf);
+ regcache->cooked_write (SPU_LR_REGNUM, buf);
/* If STRUCT_RETURN is true, then the struct return address (in
STRUCT_ADDR) will consume the first argument-passing register.
@@ -1422,7 +1422,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
{
memset (buf, 0, sizeof buf);
store_unsigned_integer (buf, 4, byte_order, SPUADDR_ADDR (struct_addr));
- regcache_cooked_write (regcache, regnum++, buf);
+ regcache->cooked_write (regnum++, buf);
}
/* Fill in argument registers. */
@@ -1490,7 +1490,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
CORE_ADDR sp_slot = extract_unsigned_integer (buf + 4*i, 4, byte_order);
store_unsigned_integer (buf + 4*i, 4, byte_order, sp_slot + sp_delta);
}
- regcache_cooked_write (regcache, SPU_RAW_SP_REGNUM, buf);
+ regcache->cooked_write (SPU_RAW_SP_REGNUM, buf);
return sp;
}
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index b2db026..842fe3f 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -764,19 +764,19 @@ tic6x_store_return_value (struct type *valtype, struct regcache *regcache,
regcache_cooked_write_part (regcache, TIC6X_A4_REGNUM, 4 - len, len,
valbuf);
else
- regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf);
+ regcache->cooked_write (TIC6X_A4_REGNUM, valbuf);
}
else if (len <= 8)
{
if (byte_order == BFD_ENDIAN_BIG)
{
- regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf + 4);
- regcache_cooked_write (regcache, TIC6X_A5_REGNUM, valbuf);
+ regcache->cooked_write (TIC6X_A4_REGNUM, valbuf + 4);
+ regcache->cooked_write (TIC6X_A5_REGNUM, valbuf);
}
else
{
- regcache_cooked_write (regcache, TIC6X_A4_REGNUM, valbuf);
- regcache_cooked_write (regcache, TIC6X_A5_REGNUM, valbuf + 4);
+ regcache->cooked_write (TIC6X_A4_REGNUM, valbuf);
+ regcache->cooked_write (TIC6X_A5_REGNUM, valbuf + 4);
}
}
}
@@ -961,7 +961,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
regcache_cooked_write_part (regcache, arg_regs[argreg],
4 - len, len, val);
else
- regcache_cooked_write (regcache, arg_regs[argreg], val);
+ regcache->cooked_write (arg_regs[argreg], val);
}
else
{
@@ -988,16 +988,14 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
padding in the LSBs of the lower (even) register. */
if (byte_order == BFD_ENDIAN_BIG)
{
- regcache_cooked_write (regcache,
- arg_regs[argreg] + 1, val);
+ regcache->cooked_write (arg_regs[argreg] + 1, val);
regcache_cooked_write_part (regcache,
arg_regs[argreg], 0,
len - 4, val + 4);
}
else
{
- regcache_cooked_write (regcache, arg_regs[argreg],
- val);
+ regcache->cooked_write (arg_regs[argreg], val);
regcache_cooked_write_part (regcache,
arg_regs[argreg] + 1, 0,
len - 4, val + 4);
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index a1783ec..de07fdb 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -133,7 +133,7 @@ vax_store_arguments (struct regcache *regcache, int nargs,
/* Update the argument pointer. */
store_unsigned_integer (buf, 4, byte_order, sp);
- regcache_cooked_write (regcache, VAX_AP_REGNUM, buf);
+ regcache->cooked_write (VAX_AP_REGNUM, buf);
return sp;
}
@@ -180,8 +180,8 @@ vax_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
/* Update the stack pointer and frame pointer. */
store_unsigned_integer (buf, 4, byte_order, sp);
- regcache_cooked_write (regcache, VAX_SP_REGNUM, buf);
- regcache_cooked_write (regcache, VAX_FP_REGNUM, buf);
+ regcache->cooked_write (VAX_SP_REGNUM, buf);
+ regcache->cooked_write (VAX_FP_REGNUM, buf);
/* Return the saved (fake) frame pointer. */
return fp;
@@ -236,9 +236,9 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function,
{
/* Read the contents to R0 and (if necessary) R1. */
memcpy (buf, writebuf, len);
- regcache_cooked_write (regcache, VAX_R0_REGNUM, buf);
+ regcache->cooked_write (VAX_R0_REGNUM, buf);
if (len > 4)
- regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4);
+ regcache->cooked_write (VAX_R1_REGNUM, buf + 4);
}
return RETURN_VALUE_REGISTER_CONVENTION;
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index 3785c44..1f87b9c 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -1846,7 +1846,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
if (struct_return)
{
store_unsigned_integer (buf, REGISTER_SIZE, byte_order, struct_addr);
- regcache_cooked_write (regcache, ARG_1ST (gdbarch), buf);
+ regcache->cooked_write (ARG_1ST (gdbarch), buf);
}
for (i = 0; i < nargs; i++)
@@ -1888,7 +1888,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
v = v >> ((REGISTER_SIZE - n) * TARGET_CHAR_BIT);
store_unsigned_integer (buf, REGISTER_SIZE, byte_order, v);
- regcache_cooked_write (regcache, r, buf);
+ regcache->cooked_write (r, buf);
cp += REGISTER_SIZE;
n -= REGISTER_SIZE;
@@ -1897,7 +1897,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
else
while (n > 0)
{
- regcache_cooked_write (regcache, r, cp);
+ regcache->cooked_write (r, cp);
cp += REGISTER_SIZE;
n -= REGISTER_SIZE;
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 00/15] Remove some regcache functions
@ 2018-05-30 19:04 Simon Marchi
2018-05-30 19:04 ` [pushed 10/15] Remove regcache_cooked_write Simon Marchi
` (14 more replies)
0 siblings, 15 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:04 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Since regcache has been C++ified/made into a class, most regcache_* functions
are simple trivial wrappers around the corresponding method. This series of
patches gets rid of them. There should not be any behavior change. I built
tested by cross-compiling for as many targets as I can with crosstool-ng and
used grep to try to catch all usages.
Some functions are not as trivial to remove so I'm keeping them for later. For
example, regcache_raw_write_signed could be replaced by regcache::raw_write
directly, but there may be some subtle behavior changes due to the fact that
raw_write is a templated method. So I'll send it for review later.
Simon Marchi (15):
Remove regcache_get_ptid
Remove regcache_register_status
Remove regcache_raw_update
Remove regcache_raw_read
Remove regcache_raw_write
Remove regcache_cooked_read
Remove regcache_raw_read_part
Remove regcache_raw_write_part
Remove regcache_invalidate
Remove regcache_cooked_write
Remove regcache_cooked_read_value
Remove regcache_cooked_read_part
Remove regcache_cooked_write_part
Remove regcache_raw_supply
Remove regcache_raw_collect
gdb/ChangeLog | 90 +++++++++++++
gdb/aarch32-linux-nat.c | 27 ++--
gdb/aarch64-fbsd-nat.c | 4 +-
gdb/aarch64-linux-nat.c | 40 +++---
gdb/aarch64-linux-tdep.c | 2 +-
gdb/aarch64-tdep.c | 36 +++---
gdb/aix-thread.c | 166 +++++++++++-------------
gdb/alpha-bsd-nat.c | 19 ++-
gdb/alpha-nbsd-tdep.c | 12 +-
gdb/alpha-tdep.c | 52 ++++----
gdb/amd64-bsd-nat.c | 12 +-
gdb/amd64-fbsd-nat.c | 24 ++--
gdb/amd64-linux-nat.c | 16 +--
gdb/amd64-linux-tdep.c | 2 +-
gdb/amd64-nat.c | 4 +-
gdb/amd64-obsd-nat.c | 18 +--
gdb/amd64-obsd-tdep.c | 8 +-
gdb/amd64-tdep.c | 56 ++++----
gdb/amd64-windows-tdep.c | 12 +-
gdb/arc-tdep.c | 2 +-
gdb/arch-utils.c | 2 +-
gdb/arm-bsd-tdep.c | 6 +-
gdb/arm-fbsd-nat.c | 4 +-
gdb/arm-linux-nat.c | 56 ++++----
gdb/arm-linux-tdep.c | 41 +++---
gdb/arm-nbsd-nat.c | 132 ++++++++-----------
gdb/arm-tdep.c | 39 +++---
gdb/avr-tdep.c | 4 +-
gdb/bfin-linux-tdep.c | 2 +-
gdb/bfin-tdep.c | 6 +-
gdb/bsd-uthread.c | 4 +-
gdb/corelow.c | 4 +-
gdb/cris-tdep.c | 10 +-
gdb/ctf.c | 6 +-
gdb/frame.c | 2 +-
gdb/frv-tdep.c | 14 +-
gdb/go32-nat.c | 8 +-
gdb/h8300-tdep.c | 2 +-
gdb/hppa-linux-nat.c | 22 ++--
gdb/hppa-nbsd-nat.c | 68 +++++-----
gdb/hppa-nbsd-tdep.c | 2 +-
gdb/hppa-obsd-nat.c | 92 +++++++-------
gdb/hppa-obsd-tdep.c | 44 +++----
gdb/hppa-tdep.c | 38 +++---
gdb/i386-bsd-nat.c | 8 +-
gdb/i386-darwin-nat.c | 16 +--
gdb/i386-darwin-tdep.c | 7 +-
gdb/i386-fbsd-nat.c | 14 +-
gdb/i386-gnu-nat.c | 21 ++-
gdb/i386-linux-nat.c | 30 ++---
gdb/i386-linux-tdep.c | 2 +-
gdb/i386-nbsd-nat.c | 12 +-
gdb/i386-nto-tdep.c | 2 +-
gdb/i386-obsd-nat.c | 14 +-
gdb/i386-obsd-tdep.c | 8 +-
gdb/i386-tdep.c | 92 +++++---------
gdb/i386-v4-nat.c | 4 +-
gdb/i387-tdep.c | 176 ++++++++++++--------------
gdb/ia64-linux-nat.c | 60 +++++----
gdb/ia64-linux-tdep.c | 4 +-
gdb/ia64-tdep.c | 8 +-
gdb/iq2000-tdep.c | 8 +-
gdb/linux-nat-trad.c | 10 +-
gdb/m32c-tdep.c | 32 ++---
gdb/m32r-linux-nat.c | 16 +--
gdb/m32r-linux-tdep.c | 11 +-
gdb/m68hc11-tdep.c | 13 +-
gdb/m68k-bsd-nat.c | 23 ++--
gdb/m68k-bsd-tdep.c | 5 +-
gdb/m68k-linux-nat.c | 41 +++---
gdb/m68k-tdep.c | 29 ++---
gdb/mep-tdep.c | 16 +--
gdb/microblaze-tdep.c | 12 +-
gdb/mips-fbsd-nat.c | 4 +-
gdb/mips-linux-nat.c | 4 +-
gdb/mips-linux-tdep.c | 23 ++--
gdb/mips-nbsd-nat.c | 4 +-
gdb/mips-nbsd-tdep.c | 26 ++--
gdb/mips-tdep.c | 10 +-
gdb/mips64-obsd-nat.c | 12 +-
gdb/mips64-obsd-tdep.c | 2 +-
gdb/mn10300-linux-tdep.c | 220 ++++++++++++++++----------------
gdb/mn10300-tdep.c | 13 +-
gdb/moxie-tdep.c | 25 ++--
gdb/nds32-tdep.c | 30 ++---
gdb/nios2-linux-tdep.c | 8 +-
gdb/nios2-tdep.c | 12 +-
gdb/nto-procfs.c | 6 +-
gdb/or1k-tdep.c | 6 +-
gdb/ppc-fbsd-nat.c | 12 +-
gdb/ppc-linux-nat.c | 45 +++----
gdb/ppc-linux-tdep.c | 2 +-
gdb/ppc-nbsd-nat.c | 21 ++-
gdb/ppc-obsd-nat.c | 18 +--
gdb/ppc-ravenscar-thread.c | 4 +-
gdb/ppc-sysv-tdep.c | 295 +++++++++++++++++++------------------------
gdb/procfs.c | 4 +-
gdb/ravenscar-thread.c | 6 +-
gdb/record-btrace.c | 8 +-
gdb/record-full.c | 11 +-
gdb/regcache.c | 116 +----------------
gdb/regcache.h | 93 ++++----------
gdb/remote-sim.c | 4 +-
gdb/remote.c | 25 ++--
gdb/riscv-tdep.c | 18 +--
gdb/rl78-tdep.c | 22 ++--
gdb/rs6000-aix-tdep.c | 31 ++---
gdb/rs6000-lynx178-tdep.c | 31 ++---
gdb/rs6000-nat.c | 8 +-
gdb/rs6000-tdep.c | 29 ++---
gdb/s390-linux-nat.c | 12 +-
gdb/s390-linux-tdep.c | 10 +-
gdb/s390-tdep.c | 59 ++++-----
gdb/score-tdep.c | 13 +-
gdb/sentinel-frame.c | 2 +-
gdb/sh-nbsd-nat.c | 4 +-
gdb/sh-tdep.c | 26 ++--
gdb/sol-thread.c | 4 +-
gdb/sparc-linux-tdep.c | 2 +-
gdb/sparc-nat.c | 6 +-
gdb/sparc-nbsd-nat.c | 10 +-
gdb/sparc-obsd-tdep.c | 12 +-
gdb/sparc-ravenscar-thread.c | 4 +-
gdb/sparc-tdep.c | 105 +++++++--------
gdb/sparc64-fbsd-nat.c | 6 +-
gdb/sparc64-linux-tdep.c | 2 +-
gdb/sparc64-nbsd-nat.c | 6 +-
gdb/sparc64-obsd-nat.c | 6 +-
gdb/sparc64-obsd-tdep.c | 12 +-
gdb/sparc64-tdep.c | 175 +++++++++++++------------
gdb/spu-linux-nat.c | 14 +-
gdb/spu-multiarch.c | 14 +-
gdb/spu-tdep.c | 30 ++---
gdb/tic6x-tdep.c | 48 +++----
gdb/tilegx-linux-nat.c | 8 +-
gdb/tilegx-tdep.c | 6 +-
gdb/tracefile-tfile.c | 6 +-
gdb/tracefile.c | 2 +-
gdb/v850-tdep.c | 4 +-
gdb/vax-bsd-nat.c | 20 +--
gdb/vax-tdep.c | 16 +--
gdb/windows-nat.c | 15 +--
gdb/xstormy16-tdep.c | 6 +-
gdb/xtensa-linux-nat.c | 118 +++++++----------
gdb/xtensa-tdep.c | 57 ++++-----
145 files changed, 1816 insertions(+), 2136 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 06/15] Remove regcache_cooked_read
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (4 preceding siblings ...)
2018-05-30 19:05 ` [pushed 15/15] Remove regcache_raw_collect Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 11/15] Remove regcache_cooked_read_value Simon Marchi
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_cooked_read, update callers to use
readable_regcache::cooked_read instead.
gdb/ChangeLog:
* regcache.h (regcache_cooked_read): Remove, update callers to
use readable_regcache::cooked_read instead.
* regcache.c (regcache_cooked_read): Remove.
---
gdb/ChangeLog | 6 ++++
gdb/aarch64-linux-tdep.c | 2 +-
gdb/aarch64-tdep.c | 12 +++----
gdb/alpha-tdep.c | 10 +++---
gdb/amd64-linux-tdep.c | 2 +-
gdb/arm-tdep.c | 12 +++----
gdb/avr-tdep.c | 2 +-
gdb/bfin-linux-tdep.c | 2 +-
gdb/hppa-tdep.c | 2 +-
gdb/i386-linux-tdep.c | 2 +-
gdb/ia64-tdep.c | 4 +--
gdb/microblaze-tdep.c | 8 ++---
gdb/mips-linux-tdep.c | 2 +-
gdb/nds32-tdep.c | 10 +++---
gdb/nios2-tdep.c | 6 ++--
gdb/ppc-linux-tdep.c | 2 +-
gdb/ppc-sysv-tdep.c | 82 +++++++++++++++++++++--------------------------
gdb/record-full.c | 2 +-
gdb/regcache.c | 8 +----
gdb/regcache.h | 5 ++-
gdb/riscv-tdep.c | 4 +--
gdb/rs6000-aix-tdep.c | 9 +++---
gdb/rs6000-lynx178-tdep.c | 9 +++---
gdb/s390-tdep.c | 7 ++--
gdb/sparc-linux-tdep.c | 2 +-
gdb/sparc-tdep.c | 20 ++++++------
gdb/sparc64-linux-tdep.c | 2 +-
gdb/sparc64-tdep.c | 18 +++++------
gdb/spu-tdep.c | 4 +--
gdb/tic6x-tdep.c | 10 +++---
gdb/vax-tdep.c | 4 +--
31 files changed, 127 insertions(+), 143 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7142237..98b80d3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_cooked_read): Remove, update callers to
+ use readable_regcache::cooked_read instead.
+ * regcache.c (regcache_cooked_read): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_raw_write): Remove, update callers to use
regcache::raw_write instead.
* regcache.c (regcache_raw_write): Remove.
diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index ba5757d..eccefd9 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -376,7 +376,7 @@ aarch64_linux_get_syscall_number (struct gdbarch *gdbarch,
LONGEST ret;
/* Getting the system call number from the register x8. */
- regcache_cooked_read (regs, AARCH64_DWARF_X0 + 8, buf);
+ regs->cooked_read (AARCH64_DWARF_X0 + 8, buf);
ret = extract_signed_integer (buf, X_REGISTER_SIZE, byte_order);
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index 8e16e3d..6f4878a 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -1792,7 +1792,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
bfd_byte buf[V_REGISTER_SIZE];
int len = TYPE_LENGTH (type);
- regcache_cooked_read (regs, AARCH64_V0_REGNUM, buf);
+ regs->cooked_read (AARCH64_V0_REGNUM, buf);
memcpy (valbuf, buf, len);
}
else if (TYPE_CODE (type) == TYPE_CODE_INT
@@ -1828,10 +1828,10 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type));
int len = TYPE_LENGTH (target_type);
- regcache_cooked_read (regs, regno, buf);
+ regs->cooked_read (regno, buf);
memcpy (valbuf, buf, len);
valbuf += len;
- regcache_cooked_read (regs, regno + 1, buf);
+ regs->cooked_read (regno + 1, buf);
memcpy (valbuf, buf, len);
valbuf += len;
}
@@ -1853,7 +1853,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
i + 1,
gdbarch_register_name (gdbarch, regno));
}
- regcache_cooked_read (regs, regno, buf);
+ regs->cooked_read (regno, buf);
memcpy (valbuf, buf, len);
valbuf += len;
@@ -1865,7 +1865,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
/* Short vector is returned in V register. */
gdb_byte buf[V_REGISTER_SIZE];
- regcache_cooked_read (regs, AARCH64_V0_REGNUM, buf);
+ regs->cooked_read (AARCH64_V0_REGNUM, buf);
memcpy (valbuf, buf, TYPE_LENGTH (type));
}
else
@@ -1879,7 +1879,7 @@ aarch64_extract_return_value (struct type *type, struct regcache *regs,
while (len > 0)
{
- regcache_cooked_read (regs, regno++, buf);
+ regs->cooked_read (regno++, buf);
memcpy (valbuf, buf, len > X_REGISTER_SIZE ? X_REGISTER_SIZE : len);
len -= X_REGISTER_SIZE;
valbuf += X_REGISTER_SIZE;
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 78422fa..d55f3c6 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -483,12 +483,12 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
switch (TYPE_LENGTH (valtype))
{
case 4:
- regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, raw_buffer);
+ regcache->cooked_read (ALPHA_FP0_REGNUM, raw_buffer);
alpha_sts (gdbarch, valbuf, raw_buffer);
break;
case 8:
- regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, valbuf);
+ regcache->cooked_read (ALPHA_FP0_REGNUM, valbuf);
break;
case 16:
@@ -507,12 +507,12 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache,
{
case 8:
/* ??? This isn't correct wrt the ABI, but it's what GCC does. */
- regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, valbuf);
+ regcache->cooked_read (ALPHA_FP0_REGNUM, valbuf);
break;
case 16:
- regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, valbuf);
- regcache_cooked_read (regcache, ALPHA_FP0_REGNUM + 1, valbuf + 8);
+ regcache->cooked_read (ALPHA_FP0_REGNUM, valbuf);
+ regcache->cooked_read (ALPHA_FP0_REGNUM + 1, valbuf + 8);
break;
case 32:
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 2bd3d31..521e32a 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -234,7 +234,7 @@ amd64_linux_get_syscall_number (struct gdbarch *gdbarch,
/* Getting the system call number from the register.
When dealing with x86_64 architecture, this information
is stored at %rax register. */
- regcache_cooked_read (regcache, AMD64_LINUX_ORIG_RAX_REGNUM, buf);
+ regcache->cooked_read (AMD64_LINUX_ORIG_RAX_REGNUM, buf);
ret = extract_signed_integer (buf, 8, byte_order);
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 4eeb6ea..abb1a88 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -7893,7 +7893,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
internal type. */
bfd_byte tmpbuf[FP_REGISTER_SIZE];
- regcache_cooked_read (regs, ARM_F0_REGNUM, tmpbuf);
+ regs->cooked_read (ARM_F0_REGNUM, tmpbuf);
target_float_convert (tmpbuf, arm_ext_type (gdbarch),
valbuf, type);
}
@@ -7904,10 +7904,9 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
/* ARM_FLOAT_VFP can arise if this is a variadic function so
not using the VFP ABI code. */
case ARM_FLOAT_VFP:
- regcache_cooked_read (regs, ARM_A1_REGNUM, valbuf);
+ regs->cooked_read (ARM_A1_REGNUM, valbuf);
if (TYPE_LENGTH (type) > 4)
- regcache_cooked_read (regs, ARM_A1_REGNUM + 1,
- valbuf + INT_REGISTER_SIZE);
+ regs->cooked_read (ARM_A1_REGNUM + 1, valbuf + INT_REGISTER_SIZE);
break;
default:
@@ -7955,7 +7954,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs,
while (len > 0)
{
- regcache_cooked_read (regs, regno++, tmpbuf);
+ regs->cooked_read (regno++, tmpbuf);
memcpy (valbuf, tmpbuf,
len > INT_REGISTER_SIZE ? INT_REGISTER_SIZE : len);
len -= INT_REGISTER_SIZE;
@@ -8217,8 +8216,7 @@ arm_return_value (struct gdbarch *gdbarch, struct value *function,
regcache_cooked_write (regcache, regnum,
writebuf + i * unit_length);
if (readbuf)
- regcache_cooked_read (regcache, regnum,
- readbuf + i * unit_length);
+ regcache->cooked_read (regnum, readbuf + i * unit_length);
}
}
return RETURN_VALUE_REGISTER_CONVENTION;
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 5aa61ba..2629d54 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -959,7 +959,7 @@ avr_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf != NULL)
{
for (i = 0; i < TYPE_LENGTH (valtype); i++)
- regcache_cooked_read (regcache, lsb_reg + i, readbuf + i);
+ regcache->cooked_read (lsb_reg + i, readbuf + i);
}
return RETURN_VALUE_REGISTER_CONVENTION;
diff --git a/gdb/bfin-linux-tdep.c b/gdb/bfin-linux-tdep.c
index 9b9f3be..f84e2e0 100644
--- a/gdb/bfin-linux-tdep.c
+++ b/gdb/bfin-linux-tdep.c
@@ -140,7 +140,7 @@ bfin_linux_get_syscall_number (struct gdbarch *gdbarch,
/* Getting the system call number from the register.
When dealing with Blackfin architecture, this information
is stored at %p0 register. */
- regcache_cooked_read (regcache, BFIN_P0_REGNUM, buf);
+ regcache->cooked_read (BFIN_P0_REGNUM, buf);
ret = extract_signed_integer (buf, 4, byte_order);
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 9692b33..5fe7851 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1165,7 +1165,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
for (b = part; b < TYPE_LENGTH (type); b += 4)
{
if (readbuf != NULL)
- regcache_cooked_read (regcache, reg, readbuf + b);
+ regcache->cooked_read (reg, readbuf + b);
if (writebuf != NULL)
regcache_cooked_write (regcache, reg, writebuf + b);
reg++;
diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
index c7b6d52..1919c8b 100644
--- a/gdb/i386-linux-tdep.c
+++ b/gdb/i386-linux-tdep.c
@@ -547,7 +547,7 @@ i386_linux_get_syscall_number_from_regcache (struct regcache *regcache)
/* Getting the system call number from the register.
When dealing with x86 architecture, this information
is stored at %eax register. */
- regcache_cooked_read (regcache, I386_LINUX_ORIG_EAX_REGNUM, buf);
+ regcache->cooked_read (I386_LINUX_ORIG_EAX_REGNUM, buf);
ret = extract_signed_integer (buf, 4, byte_order);
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
index 26e112e..7eb84ff 100644
--- a/gdb/ia64-tdep.c
+++ b/gdb/ia64-tdep.c
@@ -2616,7 +2616,7 @@ ia64_access_rse_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum,
/* We never call any libunwind routines that need to write registers. */
gdb_assert (!write);
- regcache_cooked_read (regcache, regnum, (gdb_byte *) val);
+ regcache->cooked_read (regnum, (gdb_byte *) val);
return 0;
}
@@ -3210,7 +3210,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache,
while (n-- > 0)
{
- regcache_cooked_read (regcache, regnum, from);
+ regcache->cooked_read (regnum, from);
target_float_convert (from, ia64_ext_type (gdbarch),
valbuf + offset, float_elt_type);
offset += TYPE_LENGTH (float_elt_type);
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 0cb9633..f503590 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -529,17 +529,17 @@ microblaze_extract_return_value (struct type *type, struct regcache *regcache,
switch (TYPE_LENGTH (type))
{
case 1: /* return last byte in the register. */
- regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
+ regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 1, 1);
return;
case 2: /* return last 2 bytes in register. */
- regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
+ regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
memcpy(valbuf, buf + MICROBLAZE_REGISTER_SIZE - 2, 2);
return;
case 4: /* for sizes 4 or 8, copy the required length. */
case 8:
- regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM, buf);
- regcache_cooked_read (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf+4);
+ regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM, buf);
+ regcache->cooked_read (MICROBLAZE_RETVAL_REGNUM + 1, buf+4);
memcpy (valbuf, buf, TYPE_LENGTH (type));
return;
default:
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index e580424..84cc405 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -1337,7 +1337,7 @@ mips_linux_get_syscall_number (struct gdbarch *gdbarch,
/* Getting the system call number from the register.
syscall number is in v0 or $2. */
- regcache_cooked_read (regcache, MIPS_V0_REGNUM, buf);
+ regcache->cooked_read (MIPS_V0_REGNUM, buf);
ret = extract_signed_integer (buf, regsize, byte_order);
diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
index 14b091c..35375fb 100644
--- a/gdb/nds32-tdep.c
+++ b/gdb/nds32-tdep.c
@@ -1740,9 +1740,9 @@ nds32_extract_return_value (struct gdbarch *gdbarch, struct type *type,
if (abi_use_fpr && calling_use_fpr)
{
if (len == 4)
- regcache_cooked_read (regcache, tdep->fs0_regnum, valbuf);
+ regcache->cooked_read (tdep->fs0_regnum, valbuf);
else if (len == 8)
- regcache_cooked_read (regcache, NDS32_FD0_REGNUM, valbuf);
+ regcache->cooked_read (NDS32_FD0_REGNUM, valbuf);
else
internal_error (__FILE__, __LINE__,
_("Cannot extract return value of %d bytes "
@@ -1788,7 +1788,7 @@ nds32_extract_return_value (struct gdbarch *gdbarch, struct type *type,
}
else if (len == 4)
{
- regcache_cooked_read (regcache, NDS32_R0_REGNUM, valbuf);
+ regcache->cooked_read (NDS32_R0_REGNUM, valbuf);
}
else if (len < 8)
{
@@ -1805,8 +1805,8 @@ nds32_extract_return_value (struct gdbarch *gdbarch, struct type *type,
}
else
{
- regcache_cooked_read (regcache, NDS32_R0_REGNUM, valbuf);
- regcache_cooked_read (regcache, NDS32_R0_REGNUM + 1, valbuf + 4);
+ regcache->cooked_read (NDS32_R0_REGNUM, valbuf);
+ regcache->cooked_read (NDS32_R0_REGNUM + 1, valbuf + 4);
}
}
}
diff --git a/gdb/nios2-tdep.c b/gdb/nios2-tdep.c
index f6088f3..e1cbd97 100644
--- a/gdb/nios2-tdep.c
+++ b/gdb/nios2-tdep.c
@@ -207,13 +207,13 @@ nios2_extract_return_value (struct gdbarch *gdbarch, struct type *valtype,
/* Return values of up to 8 bytes are returned in $r2 $r3. */
if (len <= register_size (gdbarch, NIOS2_R2_REGNUM))
- regcache_cooked_read (regcache, NIOS2_R2_REGNUM, valbuf);
+ regcache->cooked_read (NIOS2_R2_REGNUM, valbuf);
else
{
gdb_assert (len <= (register_size (gdbarch, NIOS2_R2_REGNUM)
+ register_size (gdbarch, NIOS2_R3_REGNUM)));
- regcache_cooked_read (regcache, NIOS2_R2_REGNUM, valbuf);
- regcache_cooked_read (regcache, NIOS2_R3_REGNUM, valbuf + 4);
+ regcache->cooked_read (NIOS2_R2_REGNUM, valbuf);
+ regcache->cooked_read (NIOS2_R3_REGNUM, valbuf + 4);
}
}
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 5716f82..c114bee 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -818,7 +818,7 @@ ppc_linux_get_syscall_number (struct gdbarch *gdbarch,
/* Getting the system call number from the register.
When dealing with PowerPC architecture, this information
is stored at 0th register. */
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum, buf.data ());
+ regcache->cooked_read (tdep->ppc_gp0_regnum, buf.data ());
return extract_signed_integer (buf.data (), tdep->wordsize, byte_order);
}
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index a6ba5d0..04f9447 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -640,7 +640,7 @@ get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype,
}
if (readbuf != NULL)
{
- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, readbuf);
+ regcache->cooked_read (tdep->ppc_fp0_regnum + 1, readbuf);
/* Left align 32-bit decimal float. */
if (TYPE_LENGTH (valtype) == 4)
@@ -660,8 +660,8 @@ get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype,
regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2 + i,
writebuf + i * 8);
if (readbuf != NULL)
- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 2 + i,
- readbuf + i * 8);
+ regcache->cooked_read (tdep->ppc_fp0_regnum + 2 + i,
+ readbuf + i * 8);
}
}
}
@@ -710,7 +710,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
struct type *regtype = register_type (gdbarch,
tdep->ppc_fp0_regnum + 1);
- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
+ regcache->cooked_read (tdep->ppc_fp0_regnum + 1, regval);
target_float_convert (regval, regtype, readbuf, type);
}
if (writebuf)
@@ -733,9 +733,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
/* IBM long double stored in f1 and f2. */
if (readbuf)
{
- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, readbuf);
- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 2,
- readbuf + 8);
+ regcache->cooked_read (tdep->ppc_fp0_regnum + 1, readbuf);
+ regcache->cooked_read (tdep->ppc_fp0_regnum + 2, readbuf + 8);
}
if (writebuf)
{
@@ -755,13 +754,10 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
r5, r6. */
if (readbuf)
{
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, readbuf);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
- readbuf + 4);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 5,
- readbuf + 8);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 6,
- readbuf + 12);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 3, readbuf);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 4, readbuf + 4);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 5, readbuf + 8);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 6, readbuf + 12);
}
if (writebuf)
{
@@ -784,10 +780,8 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
{
/* A long long, double or _Decimal64 stored in the 32 bit
r3/r4. */
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
- readbuf + 0);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
- readbuf + 4);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 3, readbuf + 0);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 4, readbuf + 4);
}
if (writebuf)
{
@@ -859,7 +853,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
}
if (readbuf != NULL)
{
- regcache_cooked_read (regcache, regnum, regval);
+ regcache->cooked_read (regnum, regval);
target_float_convert (regval, regtype,
readbuf + offset, eltype);
}
@@ -903,7 +897,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
if (writebuf != NULL)
regcache_cooked_write (regcache, regnum, writebuf + offset);
if (readbuf != NULL)
- regcache_cooked_read (regcache, regnum, readbuf + offset);
+ regcache->cooked_read (regnum, readbuf + offset);
}
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -916,7 +910,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
if (readbuf)
{
/* Altivec places the return value in "v2". */
- regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
+ regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf);
}
if (writebuf)
{
@@ -935,14 +929,10 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
ABI risks in that case; we don't try to support it. */
if (readbuf)
{
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
- readbuf + 0);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
- readbuf + 4);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 5,
- readbuf + 8);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 6,
- readbuf + 12);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 3, readbuf + 0);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 4, readbuf + 4);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 5, readbuf + 8);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 6, readbuf + 12);
}
if (writebuf)
{
@@ -968,7 +958,7 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
only corresponds to the least significant 32-bits. So place
the 64-bit DSP type's value in ev3. */
if (readbuf)
- regcache_cooked_read (regcache, tdep->ppc_ev0_regnum + 3, readbuf);
+ regcache->cooked_read (tdep->ppc_ev0_regnum + 3, readbuf);
if (writebuf)
regcache_cooked_write (regcache, tdep->ppc_ev0_regnum + 3, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -984,11 +974,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
if (readbuf)
{
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
- regvals + 0 * tdep->wordsize);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 3,
+ regvals + 0 * tdep->wordsize);
if (len > tdep->wordsize)
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
- regvals + 1 * tdep->wordsize);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 4,
+ regvals + 1 * tdep->wordsize);
memcpy (readbuf, regvals + offset, len);
}
if (writebuf)
@@ -1012,11 +1002,11 @@ do_ppc_sysv_return_value (struct gdbarch *gdbarch, struct type *func_type,
/* The value is right-padded to 8 bytes and then loaded, as
two "words", into r3/r4. */
gdb_byte regvals[PPC_MAX_REGISTER_SIZE * 2];
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3,
- regvals + 0 * tdep->wordsize);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 3,
+ regvals + 0 * tdep->wordsize);
if (TYPE_LENGTH (type) > tdep->wordsize)
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
- regvals + 1 * tdep->wordsize);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 4,
+ regvals + 1 * tdep->wordsize);
memcpy (readbuf, regvals, TYPE_LENGTH (type));
}
if (writebuf)
@@ -1824,7 +1814,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
}
if (readbuf != NULL)
{
- regcache_cooked_read (regcache, regnum, regval);
+ regcache->cooked_read (regnum, regval);
target_float_convert (regval, regtype, readbuf, valtype);
}
return 1;
@@ -1865,8 +1855,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
}
if (readbuf != NULL)
{
- regcache_cooked_read (regcache, regnum, readbuf);
- regcache_cooked_read (regcache, regnum + 1, readbuf + 8);
+ regcache->cooked_read (regnum, readbuf);
+ regcache->cooked_read (regnum + 1, readbuf + 8);
}
return 1;
}
@@ -1887,8 +1877,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
}
if (readbuf != NULL)
{
- regcache_cooked_read (regcache, regnum, readbuf + hipart);
- regcache_cooked_read (regcache, regnum + 1, readbuf + lopart);
+ regcache->cooked_read (regnum, readbuf + hipart);
+ regcache->cooked_read (regnum + 1, readbuf + lopart);
}
return 1;
}
@@ -1903,7 +1893,7 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
if (writebuf != NULL)
regcache_cooked_write (regcache, regnum, writebuf);
if (readbuf != NULL)
- regcache_cooked_read (regcache, regnum, readbuf);
+ regcache->cooked_read (regnum, readbuf);
return 1;
}
@@ -2008,7 +1998,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
if (writebuf != NULL)
regcache_cooked_write (regcache, regnum, writebuf);
if (readbuf != NULL)
- regcache_cooked_read (regcache, regnum, readbuf);
+ regcache->cooked_read (regnum, readbuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
@@ -2092,7 +2082,7 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
}
if (readbuf != NULL)
{
- regcache_cooked_read (regcache, regnum, regval);
+ regcache->cooked_read (regnum, regval);
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG
&& offset == 0)
memcpy (readbuf, regval + tdep->wordsize - len, len);
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 9b67007..b8460d9 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -833,7 +833,7 @@ record_full_exec_insn (struct regcache *regcache,
host_address_to_string (entry),
entry->u.reg.num);
- regcache_cooked_read (regcache, entry->u.reg.num, reg.data ());
+ regcache->cooked_read (entry->u.reg.num, reg.data ());
regcache_cooked_write (regcache, entry->u.reg.num,
record_full_get_loc (entry));
memcpy (record_full_get_loc (entry), reg.data (), entry->u.reg.len);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 470042c..ec1bfb0 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -209,7 +209,7 @@ do_cooked_read (void *src, int regnum, gdb_byte *buf)
{
struct regcache *regcache = (struct regcache *) src;
- return regcache_cooked_read (regcache, regnum, buf);
+ return regcache->cooked_read (regnum, buf);
}
readonly_detached_regcache::readonly_detached_regcache (const regcache &src)
@@ -601,12 +601,6 @@ regcache_raw_get_signed (struct regcache *regcache, int regnum)
}
enum register_status
-regcache_cooked_read (struct regcache *regcache, int regnum, gdb_byte *buf)
-{
- return regcache->cooked_read (regnum, buf);
-}
-
-enum register_status
readable_regcache::cooked_read (int regnum, gdb_byte *buf)
{
gdb_assert (regnum >= 0);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index e9cbcbe..f7228e4 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -67,9 +67,6 @@ void regcache_invalidate (struct regcache *regcache, int regnum);
constructed from valid, invalid or unavailable ``raw''
registers. */
-/* Transfer a cooked register [0..NUM_REGS+NUM_PSEUDO_REGS). */
-enum register_status regcache_cooked_read (struct regcache *regcache,
- int rawnum, gdb_byte *buf);
void regcache_cooked_write (struct regcache *regcache, int rawnum,
const gdb_byte *buf);
@@ -252,6 +249,8 @@ public:
/* Make certain that the register REGNUM is up-to-date. */
virtual void raw_update (int regnum) = 0;
+ /* Transfer a raw register [0..NUM_REGS+NUM_PSEUDO_REGS) from core-gdb to
+ this regcache, return its value in *BUF and return its availability status. */
enum register_status cooked_read (int regnum, gdb_byte *buf);
template<typename T, typename = RequireLongest<T>>
enum register_status cooked_read (int regnum, T *val);
diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
index 9fa458b..6943121 100644
--- a/gdb/riscv-tdep.c
+++ b/gdb/riscv-tdep.c
@@ -2248,7 +2248,7 @@ riscv_return_value (struct gdbarch *gdbarch,
regnum = info.argloc[0].loc_data.regno;
if (readbuf)
- regcache_cooked_read (regcache, regnum, readbuf);
+ regcache->cooked_read (regnum, readbuf);
if (writebuf)
regcache_cooked_write (regcache, regnum, writebuf);
@@ -2265,7 +2265,7 @@ riscv_return_value (struct gdbarch *gdbarch,
if (readbuf)
{
readbuf += info.argloc[1].c_offset;
- regcache_cooked_read (regcache, regnum, readbuf);
+ regcache->cooked_read (regnum, readbuf);
}
if (writebuf)
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index ecf6191..bb9e6be 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -420,7 +420,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function,
&& TYPE_LENGTH (valtype) == 16)
{
if (readbuf)
- regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
+ regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf);
if (writebuf)
regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
@@ -452,7 +452,7 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf)
{
- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
+ regcache->cooked_read (tdep->ppc_fp0_regnum + 1, regval);
target_float_convert (regval, regtype, readbuf, valtype);
}
if (writebuf)
@@ -504,9 +504,8 @@ rs6000_return_value (struct gdbarch *gdbarch, struct value *function,
{
gdb_byte regval[8];
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, regval);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
- regval + 4);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 3, regval);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 4, regval + 4);
memcpy (readbuf, regval, 8);
}
if (writebuf)
diff --git a/gdb/rs6000-lynx178-tdep.c b/gdb/rs6000-lynx178-tdep.c
index a18d9c3..37ac617 100644
--- a/gdb/rs6000-lynx178-tdep.c
+++ b/gdb/rs6000-lynx178-tdep.c
@@ -281,7 +281,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
&& TYPE_LENGTH (valtype) == 16)
{
if (readbuf)
- regcache_cooked_read (regcache, tdep->ppc_vr0_regnum + 2, readbuf);
+ regcache->cooked_read (tdep->ppc_vr0_regnum + 2, readbuf);
if (writebuf)
regcache_cooked_write (regcache, tdep->ppc_vr0_regnum + 2, writebuf);
@@ -313,7 +313,7 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf)
{
- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, regval);
+ regcache->cooked_read (tdep->ppc_fp0_regnum + 1, regval);
target_float_convert (regval, regtype, readbuf, valtype);
}
if (writebuf)
@@ -365,9 +365,8 @@ rs6000_lynx178_return_value (struct gdbarch *gdbarch, struct value *function,
{
gdb_byte regval[8];
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 3, regval);
- regcache_cooked_read (regcache, tdep->ppc_gp0_regnum + 4,
- regval + 4);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 3, regval);
+ regcache->cooked_read (tdep->ppc_gp0_regnum + 4, regval + 4);
memcpy (readbuf, regval, 8);
}
if (writebuf)
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index bbf696e..8a82fb9 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -2024,9 +2024,8 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
}
else
{
- regcache_cooked_read (regcache, S390_R2_REGNUM, out);
- regcache_cooked_read (regcache, S390_R3_REGNUM,
- out + word_size);
+ regcache->cooked_read (S390_R2_REGNUM, out);
+ regcache->cooked_read (S390_R3_REGNUM, out + word_size);
}
}
else
@@ -2814,7 +2813,7 @@ s390_record_calc_disp_vsce (struct gdbarch *gdbarch, struct regcache *regcache,
if (tdep->v0_full_regnum == -1 || el * es >= 16)
return -1;
if (vx < 16)
- regcache_cooked_read (regcache, tdep->v0_full_regnum + vx, buf);
+ regcache->cooked_read (tdep->v0_full_regnum + vx, buf);
else
regcache->raw_read (S390_V16_REGNUM + vx - 16, buf);
x = extract_unsigned_integer (buf + el * es, es, byte_order);
diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c
index f7fc8bb..00f4513 100644
--- a/gdb/sparc-linux-tdep.c
+++ b/gdb/sparc-linux-tdep.c
@@ -286,7 +286,7 @@ sparc32_linux_get_syscall_number (struct gdbarch *gdbarch,
/* Getting the system call number from the register.
When dealing with the sparc architecture, this information
is stored at the %g1 register. */
- regcache_cooked_read (regcache, SPARC_G1_REGNUM, buf);
+ regcache->cooked_read (SPARC_G1_REGNUM, buf);
ret = extract_signed_integer (buf, 4, byte_order);
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index c61fa50..b3b3dcb 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1409,20 +1409,20 @@ sparc32_extract_return_value (struct type *type, struct regcache *regcache,
|| TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
/* Floating return values. */
- regcache_cooked_read (regcache, SPARC_F0_REGNUM, buf);
+ regcache->cooked_read (SPARC_F0_REGNUM, buf);
if (len > 4)
- regcache_cooked_read (regcache, SPARC_F1_REGNUM, buf + 4);
+ regcache->cooked_read (SPARC_F1_REGNUM, buf + 4);
if (len > 8)
{
- regcache_cooked_read (regcache, SPARC_F2_REGNUM, buf + 8);
- regcache_cooked_read (regcache, SPARC_F3_REGNUM, buf + 12);
+ regcache->cooked_read (SPARC_F2_REGNUM, buf + 8);
+ regcache->cooked_read (SPARC_F3_REGNUM, buf + 12);
}
if (len > 16)
{
- regcache_cooked_read (regcache, SPARC_F4_REGNUM, buf + 16);
- regcache_cooked_read (regcache, SPARC_F5_REGNUM, buf + 20);
- regcache_cooked_read (regcache, SPARC_F6_REGNUM, buf + 24);
- regcache_cooked_read (regcache, SPARC_F7_REGNUM, buf + 28);
+ regcache->cooked_read (SPARC_F4_REGNUM, buf + 16);
+ regcache->cooked_read (SPARC_F5_REGNUM, buf + 20);
+ regcache->cooked_read (SPARC_F6_REGNUM, buf + 24);
+ regcache->cooked_read (SPARC_F7_REGNUM, buf + 28);
}
memcpy (valbuf, buf, len);
}
@@ -1431,10 +1431,10 @@ sparc32_extract_return_value (struct type *type, struct regcache *regcache,
/* Integral and pointer return values. */
gdb_assert (sparc_integral_or_pointer_p (type));
- regcache_cooked_read (regcache, SPARC_O0_REGNUM, buf);
+ regcache->cooked_read (SPARC_O0_REGNUM, buf);
if (len > 4)
{
- regcache_cooked_read (regcache, SPARC_O1_REGNUM, buf + 4);
+ regcache->cooked_read (SPARC_O1_REGNUM, buf + 4);
gdb_assert (len == 8);
memcpy (valbuf, buf, 8);
}
diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c
index a48d54c..8810c80 100644
--- a/gdb/sparc64-linux-tdep.c
+++ b/gdb/sparc64-linux-tdep.c
@@ -294,7 +294,7 @@ sparc64_linux_get_syscall_number (struct gdbarch *gdbarch,
/* Getting the system call number from the register.
When dealing with the sparc architecture, this information
is stored at the %g1 register. */
- regcache_cooked_read (regcache, SPARC_G1_REGNUM, buf);
+ regcache->cooked_read (SPARC_G1_REGNUM, buf);
ret = extract_signed_integer (buf, 8, byte_order);
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 7b1c1d5..ed1aaff 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -1310,12 +1310,12 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
if (len < 4)
{
gdb_byte buf[4];
- regcache_cooked_read (regcache, regnum, buf);
+ regcache->cooked_read (regnum, buf);
memcpy (valbuf, buf + 4 - len, len);
}
else
for (int i = 0; i < (len + 3) / 4; i++)
- regcache_cooked_read (regcache, regnum + i, valbuf + i * 4);
+ regcache->cooked_read (regnum + i, valbuf + i * 4);
}
else if (sparc64_floating_p (type))
{
@@ -1328,14 +1328,14 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
regnum = gdbarch_num_regs (gdbarch) + SPARC64_Q0_REGNUM
+ bitpos / 128;
- regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8));
+ regcache->cooked_read (regnum, valbuf + (bitpos / 8));
}
else if (len == 8)
{
gdb_assert (bitpos % 64 == 0 && bitpos >= 0 && bitpos < 256);
regnum = gdbarch_num_regs (gdbarch) + SPARC64_D0_REGNUM + bitpos / 64;
- regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8));
+ regcache->cooked_read (regnum, valbuf + (bitpos / 8));
}
else
{
@@ -1343,7 +1343,7 @@ sparc64_extract_floating_fields (struct regcache *regcache, struct type *type,
gdb_assert (bitpos % 32 == 0 && bitpos >= 0 && bitpos < 256);
regnum = SPARC_F0_REGNUM + bitpos / 32;
- regcache_cooked_read (regcache, regnum, valbuf + (bitpos / 8));
+ regcache->cooked_read (regnum, valbuf + (bitpos / 8));
}
}
else if (sparc64_structure_or_union_p (type))
@@ -1660,7 +1660,7 @@ sparc64_extract_return_value (struct type *type, struct regcache *regcache,
gdb_assert (len <= 32);
for (i = 0; i < ((len + 7) / 8); i++)
- regcache_cooked_read (regcache, SPARC_O0_REGNUM + i, buf + i * 8);
+ regcache->cooked_read (SPARC_O0_REGNUM + i, buf + i * 8);
if (TYPE_CODE (type) != TYPE_CODE_UNION)
sparc64_extract_floating_fields (regcache, type, buf, 0);
memcpy (valbuf, buf, len);
@@ -1669,7 +1669,7 @@ sparc64_extract_return_value (struct type *type, struct regcache *regcache,
{
/* Floating return values. */
for (i = 0; i < len / 4; i++)
- regcache_cooked_read (regcache, SPARC_F0_REGNUM + i, buf + i * 4);
+ regcache->cooked_read (SPARC_F0_REGNUM + i, buf + i * 4);
memcpy (valbuf, buf, len);
}
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
@@ -1678,7 +1678,7 @@ sparc64_extract_return_value (struct type *type, struct regcache *regcache,
gdb_assert (len <= 32);
for (i = 0; i < ((len + 7) / 8); i++)
- regcache_cooked_read (regcache, SPARC_O0_REGNUM + i, buf + i * 8);
+ regcache->cooked_read (SPARC_O0_REGNUM + i, buf + i * 8);
memcpy (valbuf, buf, len);
}
else
@@ -1688,7 +1688,7 @@ sparc64_extract_return_value (struct type *type, struct regcache *regcache,
/* Just stripping off any unused bytes should preserve the
signed-ness just fine. */
- regcache_cooked_read (regcache, SPARC_O0_REGNUM, buf);
+ regcache->cooked_read (SPARC_O0_REGNUM, buf);
memcpy (valbuf, buf + 8 - len, len);
}
}
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 55d262f..4628776 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1387,7 +1387,7 @@ spu_regcache_to_value (struct regcache *regcache, int regnum,
{
while (len >= 16)
{
- regcache_cooked_read (regcache, regnum++, out);
+ regcache->cooked_read (regnum++, out);
out += 16;
len -= 16;
}
@@ -1480,7 +1480,7 @@ spu_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
sp -= 32;
/* Store stack back chain. */
- regcache_cooked_read (regcache, SPU_RAW_SP_REGNUM, buf);
+ regcache->cooked_read (SPU_RAW_SP_REGNUM, buf);
target_write_memory (sp, buf, 16);
/* Finally, update all slots of the SP register. */
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index f11763d..b2db026 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -725,7 +725,7 @@ tic6x_extract_return_value (struct type *valtype, struct regcache *regcache,
regcache_cooked_read_part (regcache, TIC6X_A4_REGNUM, 4 - len, len,
valbuf);
else
- regcache_cooked_read (regcache, TIC6X_A4_REGNUM, valbuf);
+ regcache->cooked_read (TIC6X_A4_REGNUM, valbuf);
}
else if (len <= 8)
{
@@ -736,13 +736,13 @@ tic6x_extract_return_value (struct type *valtype, struct regcache *regcache,
lower (even) register. */
if (byte_order == BFD_ENDIAN_BIG)
{
- regcache_cooked_read (regcache, TIC6X_A4_REGNUM, valbuf + 4);
- regcache_cooked_read (regcache, TIC6X_A5_REGNUM, valbuf);
+ regcache->cooked_read (TIC6X_A4_REGNUM, valbuf + 4);
+ regcache->cooked_read (TIC6X_A5_REGNUM, valbuf);
}
else
{
- regcache_cooked_read (regcache, TIC6X_A4_REGNUM, valbuf);
- regcache_cooked_read (regcache, TIC6X_A5_REGNUM, valbuf + 4);
+ regcache->cooked_read (TIC6X_A4_REGNUM, valbuf);
+ regcache->cooked_read (TIC6X_A5_REGNUM, valbuf + 4);
}
}
}
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index 4c1ab2e..a1783ec 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -227,9 +227,9 @@ vax_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf)
{
/* Read the contents of R0 and (if necessary) R1. */
- regcache_cooked_read (regcache, VAX_R0_REGNUM, buf);
+ regcache->cooked_read (VAX_R0_REGNUM, buf);
if (len > 4)
- regcache_cooked_read (regcache, VAX_R1_REGNUM, buf + 4);
+ regcache->cooked_read (VAX_R1_REGNUM, buf + 4);
memcpy (readbuf, buf, len);
}
if (writebuf)
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 07/15] Remove regcache_raw_read_part
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (10 preceding siblings ...)
2018-05-30 19:05 ` [pushed 04/15] Remove regcache_raw_read Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:06 ` [pushed 01/15] Remove regcache_get_ptid Simon Marchi
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_raw_read_part, update callers to use
readable_regcache::raw_read_part instead.
gdb/ChangeLog:
* regcache.h (regcache_raw_read_part): Remove, update callers to
use readable_regcache::raw_read_part instead.
* regcache.c (regcache_raw_read_part): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/amd64-tdep.c | 4 ++--
gdb/amd64-windows-tdep.c | 2 +-
gdb/regcache.c | 7 -------
gdb/regcache.h | 4 +---
gdb/spu-tdep.c | 2 +-
gdb/xtensa-tdep.c | 2 +-
7 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 98b80d3..e7a57c0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_raw_read_part): Remove, update callers to
+ use readable_regcache::raw_read_part instead.
+ * regcache.c (regcache_raw_read_part): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_cooked_read): Remove, update callers to
use readable_regcache::cooked_read instead.
* regcache.c (regcache_cooked_read): Remove.
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 597bb0f..dfd1118 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -844,8 +844,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
gdb_assert (regnum != -1);
if (readbuf)
- regcache_raw_read_part (regcache, regnum, offset, std::min (len, 8),
- readbuf + i * 8);
+ regcache->raw_read_part (regnum, offset, std::min (len, 8),
+ readbuf + i * 8);
if (writebuf)
regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
writebuf + i * 8);
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index 32ebead..bf351ee 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -329,7 +329,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
{
/* Extract the return value from the register where it was stored. */
if (readbuf)
- regcache_raw_read_part (regcache, regnum, 0, len, readbuf);
+ regcache->raw_read_part (regnum, 0, len, readbuf);
if (writebuf)
regcache_raw_write_part (regcache, regnum, 0, len, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
diff --git a/gdb/regcache.c b/gdb/regcache.c
index ec1bfb0..051bd48 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -867,13 +867,6 @@ regcache::write_part (int regnum, int offset, int len,
}
enum register_status
-regcache_raw_read_part (struct regcache *regcache, int regnum,
- int offset, int len, gdb_byte *buf)
-{
- return regcache->raw_read_part (regnum, offset, len, buf);
-}
-
-enum register_status
readable_regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf)
{
assert_regnum (regnum);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index f7228e4..4865d89 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -54,9 +54,6 @@ extern LONGEST regcache_raw_get_signed (struct regcache *regcache,
write style operations. The read variant returns the status of the
register. */
-extern enum register_status
- regcache_raw_read_part (struct regcache *regcache, int regnum,
- int offset, int len, gdb_byte *buf);
void regcache_raw_write_part (struct regcache *regcache, int regnum,
int offset, int len, const gdb_byte *buf);
@@ -243,6 +240,7 @@ public:
template<typename T, typename = RequireLongest<T>>
enum register_status raw_read (int regnum, T *val);
+ /* Partial transfer of raw registers. Return the status of the register. */
enum register_status raw_read_part (int regnum, int offset, int len,
gdb_byte *buf);
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 4628776..1d0766e 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1655,7 +1655,7 @@ spu_software_single_step (struct regcache *regcache)
target += SPUADDR_ADDR (pc);
else if (reg != -1)
{
- regcache_raw_read_part (regcache, reg, 0, 4, buf);
+ regcache->raw_read_part (reg, 0, 4, buf);
target += extract_unsigned_integer (buf, 4, byte_order) & -4;
}
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index c23d777..bee4969 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -1596,7 +1596,7 @@ xtensa_extract_return_value (struct type *type,
for (; len > 0; len -= 4, areg++, valbuf += 4)
{
if (len < 4)
- regcache_raw_read_part (regcache, areg, offset, len, valbuf);
+ regcache->raw_read_part (areg, offset, len, valbuf);
else
regcache->raw_read (areg, valbuf);
}
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 15/15] Remove regcache_raw_collect
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (3 preceding siblings ...)
2018-05-30 19:05 ` [pushed 02/15] Remove regcache_register_status Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 06/15] Remove regcache_cooked_read Simon Marchi
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_raw_collect, update callers to use
regcache::raw_collect.
gdb/ChangeLog:
* regcache.h (regcache_raw_collect): Remove, update callers to
use regcache::raw_collect.
* regcache.c (regcache_raw_collect): Remove.
---
gdb/ChangeLog | 6 +++
gdb/aarch32-linux-nat.c | 9 ++--
gdb/aarch64-linux-nat.c | 13 ++---
gdb/aix-thread.c | 46 ++++++++----------
gdb/alpha-tdep.c | 11 ++---
gdb/amd64-bsd-nat.c | 4 +-
gdb/amd64-linux-nat.c | 4 +-
gdb/amd64-nat.c | 2 +-
gdb/amd64-obsd-tdep.c | 4 +-
gdb/amd64-tdep.c | 8 ++--
gdb/arm-linux-nat.c | 13 +++--
gdb/arm-linux-tdep.c | 21 ++++-----
gdb/arm-nbsd-nat.c | 61 ++++++++++--------------
gdb/go32-nat.c | 4 +-
gdb/hppa-linux-nat.c | 8 ++--
gdb/hppa-nbsd-nat.c | 34 ++++++-------
gdb/hppa-obsd-nat.c | 44 ++++++++---------
gdb/i386-bsd-nat.c | 2 +-
gdb/i386-darwin-nat.c | 5 +-
gdb/i386-gnu-nat.c | 4 +-
gdb/i386-linux-nat.c | 10 ++--
gdb/i386-nto-tdep.c | 2 +-
gdb/i386-obsd-tdep.c | 4 +-
gdb/i386-tdep.c | 2 +-
gdb/i386-v4-nat.c | 2 +-
gdb/i387-tdep.c | 40 ++++++++--------
gdb/ia64-linux-nat.c | 7 ++-
gdb/linux-nat-trad.c | 2 +-
gdb/m32r-linux-nat.c | 6 +--
gdb/m32r-linux-tdep.c | 9 ++--
gdb/m68k-bsd-nat.c | 5 +-
gdb/m68k-linux-nat.c | 12 ++---
gdb/mips-linux-tdep.c | 8 ++--
gdb/mips-nbsd-tdep.c | 9 ++--
gdb/mips64-obsd-nat.c | 4 +-
gdb/mn10300-linux-tdep.c | 110 +++++++++++++++++++++----------------------
gdb/nios2-linux-tdep.c | 3 +-
gdb/nto-procfs.c | 2 +-
gdb/ppc-linux-nat.c | 23 ++++-----
gdb/ppc-ravenscar-thread.c | 2 +-
gdb/regcache.c | 9 ----
gdb/regcache.h | 8 +---
gdb/remote.c | 4 +-
gdb/rs6000-nat.c | 2 +-
gdb/rs6000-tdep.c | 2 +-
gdb/s390-linux-nat.c | 4 +-
gdb/sh-tdep.c | 2 +-
gdb/sparc-obsd-tdep.c | 6 +--
gdb/sparc-ravenscar-thread.c | 2 +-
gdb/sparc-tdep.c | 28 +++++------
gdb/sparc64-obsd-tdep.c | 6 +--
gdb/sparc64-tdep.c | 54 ++++++++++-----------
gdb/spu-linux-nat.c | 4 +-
gdb/spu-multiarch.c | 4 +-
gdb/tilegx-linux-nat.c | 2 +-
gdb/vax-bsd-nat.c | 2 +-
gdb/windows-nat.c | 3 +-
gdb/xtensa-linux-nat.c | 64 +++++++++++--------------
58 files changed, 354 insertions(+), 417 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c7dd3d6..ddb9277 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_raw_collect): Remove, update callers to
+ use regcache::raw_collect.
+ * regcache.c (regcache_raw_collect): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_raw_supply): Remove, update callers to
use detached_regcache::raw_supply.
* regcache.c (regcache_raw_supply): Remove.
diff --git a/gdb/aarch32-linux-nat.c b/gdb/aarch32-linux-nat.c
index 3297d6c..e390361 100644
--- a/gdb/aarch32-linux-nat.c
+++ b/gdb/aarch32-linux-nat.c
@@ -62,7 +62,7 @@ aarch32_gp_regcache_collect (const struct regcache *regcache, uint32_t *regs,
for (regno = ARM_A1_REGNUM; regno <= ARM_PC_REGNUM; regno++)
{
if (REG_VALID == regcache->get_register_status (regno))
- regcache_raw_collect (regcache, regno, ®s[regno]);
+ regcache->raw_collect (regno, ®s[regno]);
}
if (arm_apcs_32
@@ -70,8 +70,7 @@ aarch32_gp_regcache_collect (const struct regcache *regcache, uint32_t *regs,
{
uint32_t cpsr = regs[ARM_CPSR_GREGNUM];
- regcache_raw_collect (regcache, ARM_PS_REGNUM,
- ®s[ARM_CPSR_GREGNUM]);
+ regcache->raw_collect (ARM_PS_REGNUM, ®s[ARM_CPSR_GREGNUM]);
/* Keep reserved bits bit 20 to bit 23. */
regs[ARM_CPSR_GREGNUM] = ((regs[ARM_CPSR_GREGNUM] & 0xff0fffff)
| (cpsr & 0x00f00000));
@@ -103,7 +102,7 @@ aarch32_vfp_regcache_collect (const struct regcache *regcache, gdb_byte *regs,
int regno;
for (regno = 0; regno < vfp_register_count; regno++)
- regcache_raw_collect (regcache, regno + ARM_D0_REGNUM, regs + regno * 8);
+ regcache->raw_collect (regno + ARM_D0_REGNUM, regs + regno * 8);
- regcache_raw_collect (regcache, ARM_FPSCR_REGNUM, regs + 32 * 8);
+ regcache->raw_collect (ARM_FPSCR_REGNUM, regs + 32 * 8);
}
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index a46bace..950fa0a 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -265,8 +265,7 @@ store_gregs_to_thread (const struct regcache *regcache)
for (regno = AARCH64_X0_REGNUM; regno <= AARCH64_CPSR_REGNUM; regno++)
if (REG_VALID == regcache->get_register_status (regno))
- regcache_raw_collect (regcache, regno,
- ®s[regno - AARCH64_X0_REGNUM]);
+ regcache->raw_collect (regno, ®s[regno - AARCH64_X0_REGNUM]);
}
ret = ptrace (PTRACE_SETREGSET, tid, NT_PRSTATUS, &iovec);
@@ -361,15 +360,13 @@ store_fpregs_to_thread (const struct regcache *regcache)
for (regno = AARCH64_V0_REGNUM; regno <= AARCH64_V31_REGNUM; regno++)
if (REG_VALID == regcache->get_register_status (regno))
- regcache_raw_collect (regcache, regno,
- (char *) ®s.vregs[regno - AARCH64_V0_REGNUM]);
+ regcache->raw_collect
+ (regno, (char *) ®s.vregs[regno - AARCH64_V0_REGNUM]);
if (REG_VALID == regcache->get_register_status (AARCH64_FPSR_REGNUM))
- regcache_raw_collect (regcache, AARCH64_FPSR_REGNUM,
- (char *) ®s.fpsr);
+ regcache->raw_collect (AARCH64_FPSR_REGNUM, (char *) ®s.fpsr);
if (REG_VALID == regcache->get_register_status (AARCH64_FPCR_REGNUM))
- regcache_raw_collect (regcache, AARCH64_FPCR_REGNUM,
- (char *) ®s.fpcr);
+ regcache->raw_collect (AARCH64_FPCR_REGNUM, (char *) ®s.fpcr);
}
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 838b1a3..ebd4bee 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1386,8 +1386,7 @@ fill_gprs64 (const struct regcache *regcache, uint64_t *vals)
for (regno = 0; regno < ppc_num_gprs; regno++)
if (REG_VALID == regcache->get_register_status
(tdep->ppc_gp0_regnum + regno))
- regcache_raw_collect (regcache, tdep->ppc_gp0_regnum + regno,
- vals + regno);
+ regcache->raw_collect (tdep->ppc_gp0_regnum + regno, vals + regno);
}
static void
@@ -1399,8 +1398,7 @@ fill_gprs32 (const struct regcache *regcache, uint32_t *vals)
for (regno = 0; regno < ppc_num_gprs; regno++)
if (REG_VALID == regcache->get_register_status
(tdep->ppc_gp0_regnum + regno))
- regcache_raw_collect (regcache, tdep->ppc_gp0_regnum + regno,
- vals + regno);
+ regcache->raw_collect (tdep->ppc_gp0_regnum + regno, vals + regno);
}
/* Store the floating point registers into a double array. */
@@ -1419,8 +1417,7 @@ fill_fprs (const struct regcache *regcache, double *vals)
regno < tdep->ppc_fp0_regnum + ppc_num_fprs;
regno++)
if (REG_VALID == regcache->get_register_status (regno))
- regcache_raw_collect (regcache, regno,
- vals + regno - tdep->ppc_fp0_regnum);
+ regcache->raw_collect (regno, vals + regno - tdep->ppc_fp0_regnum);
}
/* Store the special registers into the specified 64-bit and 32-bit
@@ -1444,20 +1441,20 @@ fill_sprs64 (const struct regcache *regcache,
(gdbarch, gdbarch_pc_regnum (gdbarch)));
if (REG_VALID == regcache->get_register_status (gdbarch_pc_regnum (gdbarch)))
- regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch), iar);
+ regcache->raw_collect (gdbarch_pc_regnum (gdbarch), iar);
if (REG_VALID == regcache->get_register_status (tdep->ppc_ps_regnum))
- regcache_raw_collect (regcache, tdep->ppc_ps_regnum, msr);
+ regcache->raw_collect (tdep->ppc_ps_regnum, msr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_cr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_cr_regnum, cr);
+ regcache->raw_collect (tdep->ppc_cr_regnum, cr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_lr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_lr_regnum, lr);
+ regcache->raw_collect (tdep->ppc_lr_regnum, lr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_ctr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_ctr_regnum, ctr);
+ regcache->raw_collect (tdep->ppc_ctr_regnum, ctr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_xer_regnum))
- regcache_raw_collect (regcache, tdep->ppc_xer_regnum, xer);
+ regcache->raw_collect (tdep->ppc_xer_regnum, xer);
if (tdep->ppc_fpscr_regnum >= 0
&& REG_VALID == regcache->get_register_status (tdep->ppc_fpscr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_fpscr_regnum, fpscr);
+ regcache->raw_collect (tdep->ppc_fpscr_regnum, fpscr);
}
static void
@@ -1478,20 +1475,20 @@ fill_sprs32 (const struct regcache *regcache,
gdbarch_pc_regnum (gdbarch)));
if (REG_VALID == regcache->get_register_status (gdbarch_pc_regnum (gdbarch)))
- regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch), iar);
+ regcache->raw_collect (gdbarch_pc_regnum (gdbarch), iar);
if (REG_VALID == regcache->get_register_status (tdep->ppc_ps_regnum))
- regcache_raw_collect (regcache, tdep->ppc_ps_regnum, msr);
+ regcache->raw_collect (tdep->ppc_ps_regnum, msr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_cr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_cr_regnum, cr);
+ regcache->raw_collect (tdep->ppc_cr_regnum, cr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_lr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_lr_regnum, lr);
+ regcache->raw_collect (tdep->ppc_lr_regnum, lr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_ctr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_ctr_regnum, ctr);
+ regcache->raw_collect (tdep->ppc_ctr_regnum, ctr);
if (REG_VALID == regcache->get_register_status (tdep->ppc_xer_regnum))
- regcache_raw_collect (regcache, tdep->ppc_xer_regnum, xer);
+ regcache->raw_collect (tdep->ppc_xer_regnum, xer);
if (tdep->ppc_fpscr_regnum >= 0
&& REG_VALID == regcache->get_register_status (tdep->ppc_fpscr_regnum))
- regcache_raw_collect (regcache, tdep->ppc_fpscr_regnum, fpscr);
+ regcache->raw_collect (tdep->ppc_fpscr_regnum, fpscr);
}
/* Store all registers into pthread PDTID, which doesn't have a kernel
@@ -1529,14 +1526,12 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
{
if (arch64)
{
- regcache_raw_collect (regcache, tdep->ppc_gp0_regnum + i,
- (void *) &int64);
+ regcache->raw_collect (tdep->ppc_gp0_regnum + i, (void *) &int64);
ctx.gpr[i] = int64;
}
else
{
- regcache_raw_collect (regcache, tdep->ppc_gp0_regnum + i,
- (void *) &int32);
+ regcache->raw_collect (tdep->ppc_gp0_regnum + i, (void *) &int32);
ctx.gpr[i] = int32;
}
}
@@ -1689,8 +1684,7 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
if (tdep->ppc_mq_regnum >= 0)
if (REG_VALID == regcache->get_register_status
(tdep->ppc_mq_regnum))
- regcache_raw_collect (regcache, tdep->ppc_mq_regnum,
- &sprs32.pt_mq);
+ regcache->raw_collect (tdep->ppc_mq_regnum, &sprs32.pt_mq);
ptrace32 (PTT_WRITE_SPRS, tid, (uintptr_t) &sprs32, 0, NULL);
}
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 8ca1e51..53943e1 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -1524,13 +1524,13 @@ alpha_fill_int_regs (const struct regcache *regcache,
for (i = 0; i < 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_collect (regcache, i, regs + i * 8);
+ regcache->raw_collect (i, regs + i * 8);
if (regno == ALPHA_PC_REGNUM || regno == -1)
- regcache_raw_collect (regcache, ALPHA_PC_REGNUM, pc);
+ regcache->raw_collect (ALPHA_PC_REGNUM, pc);
if (unique && (regno == ALPHA_UNIQUE_REGNUM || regno == -1))
- regcache_raw_collect (regcache, ALPHA_UNIQUE_REGNUM, unique);
+ regcache->raw_collect (ALPHA_UNIQUE_REGNUM, unique);
}
void
@@ -1557,11 +1557,10 @@ alpha_fill_fp_regs (const struct regcache *regcache,
for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_collect (regcache, i,
- regs + (i - ALPHA_FP0_REGNUM) * 8);
+ regcache->raw_collect (i, regs + (i - ALPHA_FP0_REGNUM) * 8);
if (regno == ALPHA_FPCR_REGNUM || regno == -1)
- regcache_raw_collect (regcache, ALPHA_FPCR_REGNUM, fpcr);
+ regcache->raw_collect (ALPHA_FPCR_REGNUM, fpcr);
}
\f
diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c
index 6c46303..cf3c3b3 100644
--- a/gdb/amd64-bsd-nat.c
+++ b/gdb/amd64-bsd-nat.c
@@ -138,7 +138,7 @@ amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum)
{
register_t base;
- regcache_raw_collect (regcache, AMD64_FSBASE_REGNUM, &base);
+ regcache->raw_collect (AMD64_FSBASE_REGNUM, &base);
if (ptrace (PT_SETFSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1)
perror_with_name (_("Couldn't write segment register fs_base"));
@@ -151,7 +151,7 @@ amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum)
{
register_t base;
- regcache_raw_collect (regcache, AMD64_GSBASE_REGNUM, &base);
+ regcache->raw_collect (AMD64_GSBASE_REGNUM, &base);
if (ptrace (PT_SETGSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1)
perror_with_name (_("Couldn't write segment register gs_base"));
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 623a90e..5a39fa8 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -287,7 +287,7 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
if (regnum == -1 || regnum == AMD64_FSBASE_REGNUM)
{
- regcache_raw_collect (regcache, AMD64_FSBASE_REGNUM, &base);
+ regcache->raw_collect (AMD64_FSBASE_REGNUM, &base);
if (ptrace (PTRACE_ARCH_PRCTL, tid, base, ARCH_SET_FS) < 0)
perror_with_name (_("Couldn't write segment register fs_base"));
@@ -295,7 +295,7 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
if (regnum == -1 || regnum == AMD64_GSBASE_REGNUM)
{
- regcache_raw_collect (regcache, AMD64_GSBASE_REGNUM, &base);
+ regcache->raw_collect (AMD64_GSBASE_REGNUM, &base);
if (ptrace (PTRACE_ARCH_PRCTL, tid, base, ARCH_SET_GS) < 0)
perror_with_name (_("Couldn't write segment register gs_base"));
}
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
index 5dde69c..155683c 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
@@ -160,7 +160,7 @@ amd64_collect_native_gregset (const struct regcache *regcache,
int offset = amd64_native_gregset_reg_offset (gdbarch, i);
if (offset != -1)
- regcache_raw_collect (regcache, i, regs + offset);
+ regcache->raw_collect (i, regs + offset);
}
}
}
diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c
index 4089200..1e078b1 100644
--- a/gdb/amd64-obsd-tdep.c
+++ b/gdb/amd64-obsd-tdep.c
@@ -281,7 +281,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
/* Calculate the stack pointer (frame pointer) that will be
stored into the thread structure. */
offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
- regcache_raw_collect (regcache, AMD64_RSP_REGNUM, buf);
+ regcache->raw_collect (AMD64_RSP_REGNUM, buf);
sp = extract_unsigned_integer (buf, 8, byte_order) - offset;
/* Store the stack pointer. */
@@ -303,7 +303,7 @@ amd64obsd_collect_uthread (const struct regcache *regcache,
sp = read_memory_unsigned_integer (sp_addr, 8, byte_order);
/* Write the register into the stack frame. */
- regcache_raw_collect (regcache, i, buf);
+ regcache->raw_collect (i, buf);
write_memory (sp + amd64obsd_uthread_reg_offset[i], buf, 8);
}
}
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 8b925fd..9f8f018 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -3406,9 +3406,9 @@ amd64_collect_fxsave (const struct regcache *regcache, int regnum,
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
{
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
- regcache_raw_collect (regcache, I387_FISEG_REGNUM (tdep), regs + 12);
+ regcache->raw_collect (I387_FISEG_REGNUM (tdep), regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
- regcache_raw_collect (regcache, I387_FOSEG_REGNUM (tdep), regs + 20);
+ regcache->raw_collect (I387_FOSEG_REGNUM (tdep), regs + 20);
}
}
@@ -3427,10 +3427,10 @@ amd64_collect_xsave (const struct regcache *regcache, int regnum,
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 64)
{
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
- regcache_raw_collect (regcache, I387_FISEG_REGNUM (tdep),
+ regcache->raw_collect (I387_FISEG_REGNUM (tdep),
regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
- regcache_raw_collect (regcache, I387_FOSEG_REGNUM (tdep),
+ regcache->raw_collect (I387_FOSEG_REGNUM (tdep),
regs + 20);
}
}
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 163e1be..984bbe2 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -176,7 +176,7 @@ store_fpregs (const struct regcache *regcache)
/* Store fpsr. */
if (REG_VALID == regcache->get_register_status (ARM_FPS_REGNUM))
- regcache_raw_collect (regcache, ARM_FPS_REGNUM, fp + NWFPE_FPSR_OFFSET);
+ regcache->raw_collect (ARM_FPS_REGNUM, fp + NWFPE_FPSR_OFFSET);
/* Store the floating point registers. */
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
@@ -317,18 +317,17 @@ store_wmmx_regs (const struct regcache *regcache)
for (regno = 0; regno < 16; regno++)
if (REG_VALID == regcache->get_register_status (regno + ARM_WR0_REGNUM))
- regcache_raw_collect (regcache, regno + ARM_WR0_REGNUM,
- ®buf[regno * 8]);
+ regcache->raw_collect (regno + ARM_WR0_REGNUM, ®buf[regno * 8]);
for (regno = 0; regno < 2; regno++)
if (REG_VALID == regcache->get_register_status (regno + ARM_WCSSF_REGNUM))
- regcache_raw_collect (regcache, regno + ARM_WCSSF_REGNUM,
- ®buf[16 * 8 + regno * 4]);
+ regcache->raw_collect (regno + ARM_WCSSF_REGNUM,
+ ®buf[16 * 8 + regno * 4]);
for (regno = 0; regno < 4; regno++)
if (REG_VALID == regcache->get_register_status (regno + ARM_WCGR0_REGNUM))
- regcache_raw_collect (regcache, regno + ARM_WCGR0_REGNUM,
- ®buf[16 * 8 + 2 * 4 + regno * 4]);
+ regcache->raw_collect (regno + ARM_WCGR0_REGNUM,
+ ®buf[16 * 8 + 2 * 4 + regno * 4]);
ret = ptrace (PTRACE_SETWMMXREGS, tid, 0, regbuf);
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index d8a8347..eb4e206 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -520,22 +520,22 @@ arm_linux_collect_gregset (const struct regset *regset,
for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
if (regnum == -1 || regnum == regno)
- regcache_raw_collect (regcache, regno,
+ regcache->raw_collect (regno,
gregs + INT_REGISTER_SIZE * regno);
if (regnum == ARM_PS_REGNUM || regnum == -1)
{
if (arm_apcs_32)
- regcache_raw_collect (regcache, ARM_PS_REGNUM,
+ regcache->raw_collect (ARM_PS_REGNUM,
gregs + INT_REGISTER_SIZE * ARM_CPSR_GREGNUM);
else
- regcache_raw_collect (regcache, ARM_PS_REGNUM,
+ regcache->raw_collect (ARM_PS_REGNUM,
gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM);
}
if (regnum == ARM_PC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, ARM_PC_REGNUM,
- gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM);
+ regcache->raw_collect (ARM_PC_REGNUM,
+ gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM);
}
/* Support for register format used by the NWFPE FPA emulator. */
@@ -588,7 +588,7 @@ collect_nwfpe_register (const struct regcache *regcache, int regno,
gdb_byte reg_tag;
gdb_byte buf[FP_REGISTER_SIZE];
- regcache_raw_collect (regcache, regno, buf);
+ regcache->raw_collect (regno, buf);
/* NOTE drow/2006-06-07: This code uses the tag already in the
register buffer. I've preserved that when moving the code
@@ -647,8 +647,8 @@ arm_linux_collect_nwfpe (const struct regset *regset,
collect_nwfpe_register (regcache, regno, regs);
if (regnum == ARM_FPS_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, ARM_FPS_REGNUM,
- regs + INT_REGISTER_SIZE * ARM_FPS_REGNUM);
+ regcache->raw_collect (ARM_FPS_REGNUM,
+ regs + INT_REGISTER_SIZE * ARM_FPS_REGNUM);
}
/* Support VFP register format. */
@@ -680,12 +680,11 @@ arm_linux_collect_vfp (const struct regset *regset,
int regno;
if (regnum == ARM_FPSCR_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, ARM_FPSCR_REGNUM, regs + 32 * 8);
+ regcache->raw_collect (ARM_FPSCR_REGNUM, regs + 32 * 8);
for (regno = ARM_D0_REGNUM; regno <= ARM_D31_REGNUM; regno++)
if (regnum == -1 || regnum == regno)
- regcache_raw_collect (regcache, regno,
- regs + (regno - ARM_D0_REGNUM) * 8);
+ regcache->raw_collect (regno, regs + (regno - ARM_D0_REGNUM) * 8);
}
static const struct regset arm_linux_gregset =
diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c
index a641ccb..2a298ee 100644
--- a/gdb/arm-nbsd-nat.c
+++ b/gdb/arm-nbsd-nat.c
@@ -228,25 +228,22 @@ store_register (const struct regcache *regcache, int regno)
switch (regno)
{
case ARM_SP_REGNUM:
- regcache_raw_collect (regcache, ARM_SP_REGNUM,
- (char *) &inferior_registers.r_sp);
+ regcache->raw_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
break;
case ARM_LR_REGNUM:
- regcache_raw_collect (regcache, ARM_LR_REGNUM,
- (char *) &inferior_registers.r_lr);
+ regcache->raw_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
break;
case ARM_PC_REGNUM:
if (arm_apcs_32)
- regcache_raw_collect (regcache, ARM_PC_REGNUM,
- (char *) &inferior_registers.r_pc);
+ regcache->raw_collect (ARM_PC_REGNUM,
+ (char *) &inferior_registers.r_pc);
else
{
unsigned pc_val;
- regcache_raw_collect (regcache, ARM_PC_REGNUM,
- (char *) &pc_val);
+ regcache->raw_collect (ARM_PC_REGNUM, (char *) &pc_val);
pc_val = gdbarch_addr_bits_remove (gdbarch, pc_val);
inferior_registers.r_pc ^= gdbarch_addr_bits_remove
@@ -257,14 +254,13 @@ store_register (const struct regcache *regcache, int regno)
case ARM_PS_REGNUM:
if (arm_apcs_32)
- regcache_raw_collect (regcache, ARM_PS_REGNUM,
- (char *) &inferior_registers.r_cpsr);
+ regcache->raw_collect (ARM_PS_REGNUM,
+ (char *) &inferior_registers.r_cpsr);
else
{
unsigned psr_val;
- regcache_raw_collect (regcache, ARM_PS_REGNUM,
- (char *) &psr_val);
+ regcache->raw_collect (ARM_PS_REGNUM, (char *) &psr_val);
psr_val ^= gdbarch_addr_bits_remove (gdbarch, psr_val);
inferior_registers.r_pc = gdbarch_addr_bits_remove
@@ -274,8 +270,7 @@ store_register (const struct regcache *regcache, int regno)
break;
default:
- regcache_raw_collect (regcache, regno,
- (char *) &inferior_registers.r[regno]);
+ regcache->raw_collect (regno, (char *) &inferior_registers.r[regno]);
break;
}
@@ -296,30 +291,24 @@ store_regs (const struct regcache *regcache)
for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
- regcache_raw_collect (regcache, regno,
- (char *) &inferior_registers.r[regno]);
+ regcache->raw_collect (regno, (char *) &inferior_registers.r[regno]);
- regcache_raw_collect (regcache, ARM_SP_REGNUM,
- (char *) &inferior_registers.r_sp);
- regcache_raw_collect (regcache, ARM_LR_REGNUM,
- (char *) &inferior_registers.r_lr);
+ regcache->raw_collect (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
+ regcache->raw_collect (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
if (arm_apcs_32)
{
- regcache_raw_collect (regcache, ARM_PC_REGNUM,
- (char *) &inferior_registers.r_pc);
- regcache_raw_collect (regcache, ARM_PS_REGNUM,
- (char *) &inferior_registers.r_cpsr);
+ regcache->raw_collect (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
+ regcache->raw_collect (ARM_PS_REGNUM,
+ (char *) &inferior_registers.r_cpsr);
}
else
{
unsigned pc_val;
unsigned psr_val;
- regcache_raw_collect (regcache, ARM_PC_REGNUM,
- (char *) &pc_val);
- regcache_raw_collect (regcache, ARM_PS_REGNUM,
- (char *) &psr_val);
+ regcache->raw_collect (ARM_PC_REGNUM, (char *) &pc_val);
+ regcache->raw_collect (ARM_PS_REGNUM, (char *) &psr_val);
pc_val = gdbarch_addr_bits_remove (gdbarch, pc_val);
psr_val ^= gdbarch_addr_bits_remove (gdbarch, psr_val);
@@ -352,13 +341,13 @@ store_fp_register (const struct regcache *regcache, int regno)
switch (regno)
{
case ARM_FPS_REGNUM:
- regcache_raw_collect (regcache, ARM_FPS_REGNUM,
- (char *) &inferior_fp_registers.fpr_fpsr);
+ regcache->raw_collect (ARM_FPS_REGNUM,
+ (char *) &inferior_fp_registers.fpr_fpsr);
break;
default:
- regcache_raw_collect (regcache, regno,
- (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
+ regcache->raw_collect
+ (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
break;
}
@@ -378,11 +367,11 @@ store_fp_regs (const struct regcache *regcache)
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
- regcache_raw_collect (regcache, regno,
- (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
+ regcache->raw_collect
+ (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
- regcache_raw_collect (regcache, ARM_FPS_REGNUM,
- (char *) &inferior_fp_registers.fpr_fpsr);
+ regcache->raw_collect (ARM_FPS_REGNUM,
+ (char *) &inferior_fp_registers.fpr_fpsr);
ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index a2affe1..81e2ea4 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -571,8 +571,8 @@ store_register (const struct regcache *regcache, int regno)
{
struct gdbarch *gdbarch = regcache->arch ();
if (regno < gdbarch_fp0_regnum (gdbarch))
- regcache_raw_collect (regcache, regno,
- (char *) &a_tss + regno_mapping[regno].tss_ofs);
+ regcache->raw_collect (regno,
+ (char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch,
regno))
i387_collect_fsave (regcache, regno, &npx);
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
index 7dea079..6fd70c6 100644
--- a/gdb/hppa-linux-nat.c
+++ b/gdb/hppa-linux-nat.c
@@ -260,7 +260,7 @@ store_register (const struct regcache *regcache, int regno)
tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
- regcache_raw_collect (regcache, regno, &val);
+ regcache->raw_collect (regno, &val);
ptrace (PTRACE_POKEUSER, tid, hppa_linux_register_addr (regno, 0), val);
if (errno != 0)
error (_("Couldn't write register %s (#%d): %s."),
@@ -340,9 +340,7 @@ fill_gregset (const struct regcache *regcache,
int mregno = greg_map[i];
if (regno == -1 || regno == mregno)
- {
- regcache_raw_collect(regcache, mregno, &(*gregsetp)[i]);
- }
+ regcache->raw_collect (mregno, &(*gregsetp)[i]);
}
}
@@ -382,7 +380,7 @@ fill_fpregset (const struct regcache *regcache,
char *to = (char *) &((*fpregsetp)[(i - HPPA_FP0_REGNUM) / 2]);
if ((i - HPPA_FP0_REGNUM) & 1)
to += 4;
- regcache_raw_collect (regcache, i, to);
+ regcache->raw_collect (i, to);
}
}
diff --git a/gdb/hppa-nbsd-nat.c b/gdb/hppa-nbsd-nat.c
index 99dfd32..40a08b7 100644
--- a/gdb/hppa-nbsd-nat.c
+++ b/gdb/hppa-nbsd-nat.c
@@ -108,38 +108,38 @@ hppanbsd_collect_gregset (const struct regcache *regcache,
for (i = HPPA_R1_REGNUM; i <= HPPA_R31_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i, regs + i * 4);
+ regcache->raw_collect (i, regs + i * 4);
}
if (regnum == -1 || regnum == HPPA_IPSW_REGNUM)
- regcache_raw_collect (regcache, HPPA_IPSW_REGNUM, regs);
+ regcache->raw_collect (HPPA_IPSW_REGNUM, regs);
if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
+ regcache->raw_collect (HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
+ regcache->raw_collect (HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
- regcache_raw_collect (regcache, HPPA_SAR_REGNUM, regs + 32 * 4);
+ regcache->raw_collect (HPPA_SAR_REGNUM, regs + 32 * 4);
if (regnum == -1 || regnum == HPPA_PCSQ_HEAD_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
+ regcache->raw_collect (HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
if (regnum == -1 || regnum == HPPA_PCSQ_TAIL_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
+ regcache->raw_collect (HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
+ regcache->raw_collect (HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
+ regcache->raw_collect (HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
if (regnum == -1 || regnum == HPPA_IPSW_REGNUM)
- regcache_raw_collect (regcache, HPPA_IPSW_REGNUM, regs);
+ regcache->raw_collect (HPPA_IPSW_REGNUM, regs);
if (regnum == -1 || regnum == HPPA_SR4_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR4_REGNUM, regs + 41 * 4);
+ regcache->raw_collect (HPPA_SR4_REGNUM, regs + 41 * 4);
if (regnum == -1 || regnum == HPPA_SR4_REGNUM + 1)
- regcache_raw_collect (regcache, HPPA_SR4_REGNUM + 1, regs + 37 * 4);
+ regcache->raw_collect (HPPA_SR4_REGNUM + 1, regs + 37 * 4);
if (regnum == -1 || regnum == HPPA_SR4_REGNUM + 2)
- regcache_raw_collect (regcache, HPPA_SR4_REGNUM + 2, regs + 38 * 4);
+ regcache->raw_collect (HPPA_SR4_REGNUM + 2, regs + 38 * 4);
if (regnum == -1 || regnum == HPPA_SR4_REGNUM + 3)
- regcache_raw_collect (regcache, HPPA_SR4_REGNUM + 3, regs + 39 * 4);
+ regcache->raw_collect (HPPA_SR4_REGNUM + 3, regs + 39 * 4);
if (regnum == -1 || regnum == HPPA_SR4_REGNUM + 4)
- regcache_raw_collect (regcache, HPPA_SR4_REGNUM + 4, regs + 40 * 4);
+ regcache->raw_collect (HPPA_SR4_REGNUM + 4, regs + 40 * 4);
}
/* Collect the floating-point registers from REGCACHE and store them
@@ -156,8 +156,8 @@ hppanbsd_collect_fpregset (struct regcache *regcache,
{
if (regnum == -1 || regnum == i || regnum == i + 1)
{
- regcache_raw_collect (regcache, i, regs);
- regcache_raw_collect (regcache, i + 1, regs + 4);
+ regcache->raw_collect (i, regs);
+ regcache->raw_collect (i + 1, regs + 4);
}
}
}
diff --git a/gdb/hppa-obsd-nat.c b/gdb/hppa-obsd-nat.c
index 53880f6..eb056e3 100644
--- a/gdb/hppa-obsd-nat.c
+++ b/gdb/hppa-obsd-nat.c
@@ -120,52 +120,52 @@ hppaobsd_collect_gregset (const struct regcache *regcache,
for (i = HPPA_R1_REGNUM; i <= HPPA_R31_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i, regs + i * 4);
+ regcache->raw_collect (i, regs + i * 4);
}
if (sizeof(struct reg) >= 46 * 4)
{
if (regnum == -1 || regnum == HPPA_IPSW_REGNUM)
- regcache_raw_collect (regcache, HPPA_IPSW_REGNUM, regs);
+ regcache->raw_collect (HPPA_IPSW_REGNUM, regs);
if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
- regcache_raw_collect (regcache, HPPA_SAR_REGNUM, regs + 32 * 4);
+ regcache->raw_collect (HPPA_SAR_REGNUM, regs + 32 * 4);
if (regnum == -1 || regnum == HPPA_PCSQ_HEAD_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
+ regcache->raw_collect (HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
if (regnum == -1 || regnum == HPPA_PCSQ_TAIL_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
+ regcache->raw_collect (HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
+ regcache->raw_collect (HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
+ regcache->raw_collect (HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
if (regnum == -1 || regnum == HPPA_SR0_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR0_REGNUM, regs + 37 * 4);
+ regcache->raw_collect (HPPA_SR0_REGNUM, regs + 37 * 4);
if (regnum == -1 || regnum == HPPA_SR1_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR1_REGNUM, regs + 38 * 4);
+ regcache->raw_collect (HPPA_SR1_REGNUM, regs + 38 * 4);
if (regnum == -1 || regnum == HPPA_SR2_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR2_REGNUM, regs + 39 * 4);
+ regcache->raw_collect (HPPA_SR2_REGNUM, regs + 39 * 4);
if (regnum == -1 || regnum == HPPA_SR3_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR3_REGNUM, regs + 40 * 4);
+ regcache->raw_collect (HPPA_SR3_REGNUM, regs + 40 * 4);
if (regnum == -1 || regnum == HPPA_SR4_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR4_REGNUM, regs + 41 * 4);
+ regcache->raw_collect (HPPA_SR4_REGNUM, regs + 41 * 4);
if (regnum == -1 || regnum == HPPA_SR5_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR5_REGNUM, regs + 42 * 4);
+ regcache->raw_collect (HPPA_SR5_REGNUM, regs + 42 * 4);
if (regnum == -1 || regnum == HPPA_SR6_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR6_REGNUM, regs + 43 * 4);
+ regcache->raw_collect (HPPA_SR6_REGNUM, regs + 43 * 4);
if (regnum == -1 || regnum == HPPA_SR7_REGNUM)
- regcache_raw_collect (regcache, HPPA_SR7_REGNUM, regs + 44 * 4);
+ regcache->raw_collect (HPPA_SR7_REGNUM, regs + 44 * 4);
if (regnum == -1 || regnum == HPPA_CR26_REGNUM)
- regcache_raw_collect (regcache, HPPA_CR26_REGNUM, regs + 45 * 4);
+ regcache->raw_collect (HPPA_CR26_REGNUM, regs + 45 * 4);
if (regnum == -1 || regnum == HPPA_CR27_REGNUM)
- regcache_raw_collect (regcache, HPPA_CR27_REGNUM, regs + 46 * 4);
+ regcache->raw_collect (HPPA_CR27_REGNUM, regs + 46 * 4);
}
else
{
if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
- regcache_raw_collect (regcache, HPPA_SAR_REGNUM, regs);
+ regcache->raw_collect (HPPA_SAR_REGNUM, regs);
if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
+ regcache->raw_collect (HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
- regcache_raw_collect (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
+ regcache->raw_collect (HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
}
}
@@ -183,8 +183,8 @@ hppaobsd_collect_fpregset (struct regcache *regcache,
{
if (regnum == -1 || regnum == i || regnum == i + 1)
{
- regcache_raw_collect (regcache, i, regs);
- regcache_raw_collect (regcache, i + 1, regs + 4);
+ regcache->raw_collect (i, regs);
+ regcache->raw_collect (i + 1, regs + 4);
}
}
}
diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c
index 2753366..09ea99f 100644
--- a/gdb/i386-bsd-nat.c
+++ b/gdb/i386-bsd-nat.c
@@ -119,7 +119,7 @@ i386bsd_collect_gregset (const struct regcache *regcache,
int offset = i386bsd_r_reg_offset[i];
if (offset != -1)
- regcache_raw_collect (regcache, i, regs + offset);
+ regcache->raw_collect (i, regs + offset);
}
}
}
diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c
index 2dbf95f..fbe6668 100644
--- a/gdb/i386-darwin-nat.c
+++ b/gdb/i386-darwin-nat.c
@@ -244,9 +244,8 @@ i386_darwin_nat_target::store_registers (struct regcache *regcache,
for (i = 0; i < I386_NUM_GREGS; i++)
if (regno == -1 || regno == i)
- regcache_raw_collect
- (regcache, i,
- (char *)&gp_regs + i386_darwin_thread_state_reg_offset[i]);
+ regcache->raw_collect
+ (i, (char *) &gp_regs + i386_darwin_thread_state_reg_offset[i]);
ret = thread_set_state (current_thread, x86_THREAD_STATE32,
(thread_state_t) &gp_regs,
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index 1acfc07..9875d81 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -265,7 +265,7 @@ gnu_store_registers (struct target_ops *ops,
for (i = 0; i < I386_NUM_GREGS; i++)
if (REG_VALID == regcache->get_register_status (i))
- regcache_raw_collect (regcache, i, REG_ADDR (state, i));
+ regcache->raw_collect (i, REG_ADDR (state, i));
}
else
{
@@ -273,7 +273,7 @@ gnu_store_registers (struct target_ops *ops,
gdbarch_register_name (gdbarch, regno));
gdb_assert (REG_VALID == regcache->get_register_status (regno));
- regcache_raw_collect (regcache, regno, REG_ADDR (state, regno));
+ regcache->raw_collect (regno, REG_ADDR (state, regno));
}
/* Restore the T bit. */
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 1d8483a..897a21f 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -144,7 +144,7 @@ store_register (const struct regcache *regcache, int regno)
tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
- regcache_raw_collect (regcache, regno, &val);
+ regcache->raw_collect (regno, &val);
ptrace (PTRACE_POKEUSER, tid,
i386_linux_gregset_reg_offset[regno], val);
if (errno != 0)
@@ -189,14 +189,14 @@ fill_gregset (const struct regcache *regcache,
for (i = 0; i < I386_NUM_GREGS; i++)
if (regno == -1 || regno == i)
- regcache_raw_collect (regcache, i,
- regp + i386_linux_gregset_reg_offset[i]);
+ regcache->raw_collect (i, regp + i386_linux_gregset_reg_offset[i]);
if ((regno == -1 || regno == I386_LINUX_ORIG_EAX_REGNUM)
&& I386_LINUX_ORIG_EAX_REGNUM
< gdbarch_num_regs (regcache->arch ()))
- regcache_raw_collect (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
- + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+ regcache->raw_collect
+ (I386_LINUX_ORIG_EAX_REGNUM,
+ regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
}
#ifdef HAVE_PTRACE_GETREGS
diff --git a/gdb/i386-nto-tdep.c b/gdb/i386-nto-tdep.c
index 83c05a2..1f8d7ca 100644
--- a/gdb/i386-nto-tdep.c
+++ b/gdb/i386-nto-tdep.c
@@ -250,7 +250,7 @@ i386nto_regset_fill (const struct regcache *regcache, int regset, char *data)
{
int offset = nto_reg_offset (regno);
if (offset != -1)
- regcache_raw_collect (regcache, regno, data + offset);
+ regcache->raw_collect (regno, data + offset);
}
}
else if (regset == NTO_REG_FLOAT)
diff --git a/gdb/i386-obsd-tdep.c b/gdb/i386-obsd-tdep.c
index da2b88a..851fec6 100644
--- a/gdb/i386-obsd-tdep.c
+++ b/gdb/i386-obsd-tdep.c
@@ -250,7 +250,7 @@ i386obsd_collect_uthread (const struct regcache *regcache,
/* Calculate the stack pointer (frame pointer) that will be
stored into the thread structure. */
offset = i386obsd_uthread_reg_offset[I386_EIP_REGNUM] + 4;
- regcache_raw_collect (regcache, I386_ESP_REGNUM, buf);
+ regcache->raw_collect (I386_ESP_REGNUM, buf);
sp = extract_unsigned_integer (buf, 4, byte_order) - offset;
/* Store the stack pointer. */
@@ -272,7 +272,7 @@ i386obsd_collect_uthread (const struct regcache *regcache,
sp = read_memory_unsigned_integer (sp_addr, 4, byte_order);
/* Write the register into the stack frame. */
- regcache_raw_collect (regcache, i, buf);
+ regcache->raw_collect (i, buf);
write_memory (sp + i386obsd_uthread_reg_offset[i], buf, 4);
}
}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index f535cb3..b1d502f 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3840,7 +3840,7 @@ i386_collect_gregset (const struct regset *regset,
{
if ((regnum == i || regnum == -1)
&& tdep->gregset_reg_offset[i] != -1)
- regcache_raw_collect (regcache, i, regs + tdep->gregset_reg_offset[i]);
+ regcache->raw_collect (i, regs + tdep->gregset_reg_offset[i]);
}
}
diff --git a/gdb/i386-v4-nat.c b/gdb/i386-v4-nat.c
index 2313ff8..ddf50d9 100644
--- a/gdb/i386-v4-nat.c
+++ b/gdb/i386-v4-nat.c
@@ -123,7 +123,7 @@ fill_gregset (const struct regcache *regcache,
for (i = 0; i < I386_NUM_GREGS; i++)
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i, regp + regmap[i]);
+ regcache->raw_collect (i, regp + regmap[i]);
}
#endif /* HAVE_GREGSET_T */
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index b545f74..d0f64ad 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -508,7 +508,7 @@ i387_collect_fsave (const struct regcache *regcache, int regnum, void *fsave)
{
gdb_byte buf[4];
- regcache_raw_collect (regcache, i, buf);
+ regcache->raw_collect (i, buf);
if (i == I387_FOP_REGNUM (tdep))
{
@@ -520,7 +520,7 @@ i387_collect_fsave (const struct regcache *regcache, int regnum, void *fsave)
memcpy (FSAVE_ADDR (tdep, regs, i), buf, 2);
}
else
- regcache_raw_collect (regcache, i, FSAVE_ADDR (tdep, regs, i));
+ regcache->raw_collect (i, FSAVE_ADDR (tdep, regs, i));
}
}
\f
@@ -685,7 +685,7 @@ i387_collect_fxsave (const struct regcache *regcache, int regnum, void *fxsave)
{
gdb_byte buf[4];
- regcache_raw_collect (regcache, i, buf);
+ regcache->raw_collect (i, buf);
if (i == I387_FOP_REGNUM (tdep))
{
@@ -716,11 +716,11 @@ i387_collect_fxsave (const struct regcache *regcache, int regnum, void *fxsave)
memcpy (FXSAVE_ADDR (tdep, regs, i), buf, 2);
}
else
- regcache_raw_collect (regcache, i, FXSAVE_ADDR (tdep, regs, i));
+ regcache->raw_collect (i, FXSAVE_ADDR (tdep, regs, i));
}
if (regnum == I387_MXCSR_REGNUM (tdep) || regnum == -1)
- regcache_raw_collect (regcache, I387_MXCSR_REGNUM (tdep),
+ regcache->raw_collect (I387_MXCSR_REGNUM (tdep),
FXSAVE_MXCSR_ADDR (regs));
}
@@ -1505,7 +1505,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_PKRU_REGNUM (tdep);
i < I387_PKEYSEND_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_PKEYS_ADDR (tdep, regs, i);
if (memcmp (raw, p, 4) != 0)
{
@@ -1519,7 +1519,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_ZMM0H_REGNUM (tdep);
i < I387_ZMMENDH_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_AVX512_ZMM_H_ADDR (tdep, regs, i);
if (memcmp (raw, p, 32) != 0)
{
@@ -1533,7 +1533,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_K0_REGNUM (tdep);
i < I387_KEND_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_AVX512_K_ADDR (tdep, regs, i);
if (memcmp (raw, p, 8) != 0)
{
@@ -1548,7 +1548,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_YMM16H_REGNUM (tdep);
i < I387_YMMH_AVX512_END_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_YMM_AVX512_ADDR (tdep, regs, i);
if (memcmp (raw, p, 16) != 0)
{
@@ -1559,7 +1559,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_XMM16_REGNUM (tdep);
i < I387_XMM_AVX512_END_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_XMM_AVX512_ADDR (tdep, regs, i);
if (memcmp (raw, p, 16) != 0)
{
@@ -1574,7 +1574,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_BND0R_REGNUM (tdep);
i < I387_BNDCFGU_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_MPX_ADDR (tdep, regs, i);
if (memcmp (raw, p, 16))
{
@@ -1588,7 +1588,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_BNDCFGU_REGNUM (tdep);
i < I387_MPXEND_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_MPX_ADDR (tdep, regs, i);
if (memcmp (raw, p, 8))
{
@@ -1602,7 +1602,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_YMM0H_REGNUM (tdep);
i < I387_YMMENDH_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = XSAVE_AVXH_ADDR (tdep, regs, i);
if (memcmp (raw, p, 16))
{
@@ -1616,7 +1616,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_XMM0_REGNUM (tdep);
i < I387_MXCSR_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = FXSAVE_ADDR (tdep, regs, i);
if (memcmp (raw, p, 16))
{
@@ -1628,7 +1628,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
if ((tdep->xcr0 & X86_XSTATE_AVX) || (tdep->xcr0 & X86_XSTATE_SSE))
{
i = I387_MXCSR_REGNUM (tdep);
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = FXSAVE_MXCSR_ADDR (regs);
if (memcmp (raw, p, 4))
{
@@ -1649,7 +1649,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
for (i = I387_ST0_REGNUM (tdep);
i < I387_FCTRL_REGNUM (tdep); i++)
{
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
p = FXSAVE_ADDR (tdep, regs, i);
if (memcmp (raw, p, 10))
{
@@ -1661,7 +1661,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
else
{
/* Check if REGNUM is changed. */
- regcache_raw_collect (regcache, regnum, raw);
+ regcache->raw_collect (regnum, raw);
switch (regclass)
{
@@ -1731,7 +1731,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
case mpx:
if (regnum < I387_BNDCFGU_REGNUM (tdep))
{
- regcache_raw_collect (regcache, regnum, raw);
+ regcache->raw_collect (regnum, raw);
p = XSAVE_MPX_ADDR (tdep, regs, regnum);
if (memcmp (raw, p, 16))
{
@@ -1801,7 +1801,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
{
gdb_byte buf[4];
- regcache_raw_collect (regcache, i, buf);
+ regcache->raw_collect (i, buf);
if (i == I387_FOP_REGNUM (tdep))
{
@@ -1840,7 +1840,7 @@ i387_collect_xsave (const struct regcache *regcache, int regnum,
{
int regsize;
- regcache_raw_collect (regcache, i, raw);
+ regcache->raw_collect (i, raw);
regsize = regcache_register_size (regcache, i);
p = FXSAVE_ADDR (tdep, regs, i);
if (memcmp (raw, p, regsize))
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index 98fd953..ef70da5 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -450,7 +450,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *gregsetp, int regno)
#define COPY_REG(_idx_,_regi_) \
if ((regno == -1) || regno == _regi_) \
- regcache_raw_collect (regcache, _regi_, regp + _idx_)
+ regcache->raw_collect (_regi_, regp + _idx_)
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
{
@@ -524,8 +524,7 @@ fill_fpregset (const struct regcache *regcache,
for (regi = IA64_FR0_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
{
if ((regno == -1) || (regno == regi))
- regcache_raw_collect (regcache, regi,
- &((*fpregsetp)[regi - IA64_FR0_REGNUM]));
+ regcache->raw_collect (regi, &((*fpregsetp)[regi - IA64_FR0_REGNUM]));
}
}
@@ -842,7 +841,7 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum)
buf = (PTRACE_TYPE_RET *) alloca (size);
/* Write the register contents into the inferior a chunk at a time. */
- regcache_raw_collect (regcache, regnum, buf);
+ regcache->raw_collect (regnum, buf);
for (i = 0; i < size / sizeof (PTRACE_TYPE_RET); i++)
{
errno = 0;
diff --git a/gdb/linux-nat-trad.c b/gdb/linux-nat-trad.c
index 23abb0f..9776a20 100644
--- a/gdb/linux-nat-trad.c
+++ b/gdb/linux-nat-trad.c
@@ -110,7 +110,7 @@ linux_nat_trad_target::store_register (const struct regcache *regcache,
buf = (gdb_byte *) alloca (size);
/* Write the register contents into the inferior a chunk at a time. */
- regcache_raw_collect (regcache, regnum, buf);
+ regcache->raw_collect (regnum, buf);
for (i = 0; i < size; i += sizeof (PTRACE_TYPE_RET))
{
size_t chunk = std::min (sizeof (PTRACE_TYPE_RET), size - i);
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 3c72357..8740af5 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -150,11 +150,11 @@ fill_gregset (const struct regcache *regcache,
continue;
if (i != M32R_SP_REGNUM)
- regcache_raw_collect (regcache, i, regp + regmap[i]);
+ regcache->raw_collect (i, regp + regmap[i]);
else if (psw & 0x8000)
- regcache_raw_collect (regcache, i, regp + SPU_REGMAP);
+ regcache->raw_collect (i, regp + SPU_REGMAP);
else
- regcache_raw_collect (regcache, i, regp + SPI_REGMAP);
+ regcache->raw_collect (i, regp + SPI_REGMAP);
}
}
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
index 5618218..be35b69 100644
--- a/gdb/m32r-linux-tdep.c
+++ b/gdb/m32r-linux-tdep.c
@@ -401,7 +401,7 @@ m32r_linux_collect_gregset (const struct regset *regset,
ULONGEST psw;
gdb_byte buf[4];
- regcache_raw_collect (regcache, PSW_REGNUM, buf);
+ regcache->raw_collect (PSW_REGNUM, buf);
psw = extract_unsigned_integer (buf, 4, byte_order);
for (i = 0; i < ARRAY_SIZE (m32r_pt_regs_offset); i++)
@@ -420,12 +420,11 @@ m32r_linux_collect_gregset (const struct regset *regset,
case CBR_REGNUM:
break;
case M32R_SP_REGNUM:
- regcache_raw_collect (regcache, i, regs
- + ((psw & 0x80) ? SPU_OFFSET : SPI_OFFSET));
+ regcache->raw_collect
+ (i, regs + ((psw & 0x80) ? SPU_OFFSET : SPI_OFFSET));
break;
default:
- regcache_raw_collect (regcache, i,
- regs + m32r_pt_regs_offset[i]);
+ regcache->raw_collect (i, regs + m32r_pt_regs_offset[i]);
}
}
}
diff --git a/gdb/m68k-bsd-nat.c b/gdb/m68k-bsd-nat.c
index 8d2f548..2111c27 100644
--- a/gdb/m68k-bsd-nat.c
+++ b/gdb/m68k-bsd-nat.c
@@ -88,7 +88,7 @@ m68kbsd_collect_gregset (const struct regcache *regcache,
for (i = M68K_D0_REGNUM; i <= M68K_PC_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i, regs + i * 4);
+ regcache->raw_collect (i, regs + i * 4);
}
}
@@ -106,8 +106,7 @@ m68kbsd_collect_fpregset (struct regcache *regcache,
for (i = M68K_FP0_REGNUM; i <= M68K_FPI_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i,
- regs + m68kbsd_fpreg_offset (gdbarch, i));
+ regcache->raw_collect (i, regs + m68kbsd_fpreg_offset (gdbarch, i));
}
}
\f
diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c
index 2dbf857..d66a630 100644
--- a/gdb/m68k-linux-nat.c
+++ b/gdb/m68k-linux-nat.c
@@ -172,7 +172,7 @@ store_register (const struct regcache *regcache, int regno)
regaddr = 4 * regmap[regno];
/* Put the contents of regno into a local buffer. */
- regcache_raw_collect (regcache, regno, buf);
+ regcache->raw_collect (regno, buf);
/* Store the local buffer into the inferior a chunk at the time. */
for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long))
@@ -241,7 +241,7 @@ fill_gregset (const struct regcache *regcache,
for (i = 0; i < NUM_GREGS; i++)
if (regno == -1 || regno == i)
- regcache_raw_collect (regcache, i, regp + regmap[i]);
+ regcache->raw_collect (i, regp + regmap[i]);
}
#ifdef HAVE_PTRACE_GETREGS
@@ -338,15 +338,13 @@ fill_fpregset (const struct regcache *regcache,
for (i = gdbarch_fp0_regnum (gdbarch);
i < gdbarch_fp0_regnum (gdbarch) + 8; i++)
if (regno == -1 || regno == i)
- regcache_raw_collect (regcache, i,
- FPREG_ADDR (fpregsetp,
- i - gdbarch_fp0_regnum (gdbarch)));
+ regcache->raw_collect
+ (i, FPREG_ADDR (fpregsetp, i - gdbarch_fp0_regnum (gdbarch)));
/* Fill in the floating-point control registers. */
for (i = M68K_FPC_REGNUM; i <= M68K_FPI_REGNUM; i++)
if (regno == -1 || regno == i)
- regcache_raw_collect (regcache, i,
- &fpregsetp->fpcntl[i - M68K_FPC_REGNUM]);
+ regcache->raw_collect (i, &fpregsetp->fpcntl[i - M68K_FPC_REGNUM]);
}
#ifdef HAVE_PTRACE_GETREGS
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 1dd9764..30d5feb 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -194,7 +194,7 @@ mips_fill_gregset (const struct regcache *regcache,
if (regno > 0 && regno < 32)
{
dst = regp + regno + EF_REG0;
- regcache_raw_collect (regcache, regno, dst);
+ regcache->raw_collect (regno, dst);
return;
}
@@ -219,7 +219,7 @@ mips_fill_gregset (const struct regcache *regcache,
if (regaddr != -1)
{
dst = regp + regaddr;
- regcache_raw_collect (regcache, regno, dst);
+ regcache->raw_collect (regno, dst);
}
}
@@ -471,13 +471,13 @@ mips64_fill_fpregset (const struct regcache *regcache,
to = (gdb_byte *) (*fpregsetp + (regi & ~1));
if ((gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) != (regi & 1))
to += 4;
- regcache_raw_collect (regcache, regno, to);
+ regcache->raw_collect (regno, to);
}
else
{
to = (gdb_byte *) (*fpregsetp + regno
- gdbarch_fp0_regnum (gdbarch));
- regcache_raw_collect (regcache, regno, to);
+ regcache->raw_collect (regno, to);
}
}
else if (regno == mips_regnum (gdbarch)->fp_control_status)
diff --git a/gdb/mips-nbsd-tdep.c b/gdb/mips-nbsd-tdep.c
index 5a14b2f..5f4db87 100644
--- a/gdb/mips-nbsd-tdep.c
+++ b/gdb/mips-nbsd-tdep.c
@@ -161,8 +161,7 @@ mipsnbsd_fill_reg (const struct regcache *regcache, char *regs, int regno)
for (i = 0; i <= gdbarch_pc_regnum (gdbarch); i++)
if ((regno == i || regno == -1)
&& ! gdbarch_cannot_store_register (gdbarch, i))
- regcache_raw_collect (regcache, i,
- regs + (i * mips_isa_regsize (gdbarch)));
+ regcache->raw_collect (i, regs + (i * mips_isa_regsize (gdbarch)));
}
void
@@ -200,9 +199,9 @@ mipsnbsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno)
i++)
if ((regno == i || regno == -1)
&& ! gdbarch_cannot_store_register (gdbarch, i))
- regcache_raw_collect (regcache, i,
- fpregs + ((i - gdbarch_fp0_regnum (gdbarch))
- * mips_isa_regsize (gdbarch)));
+ regcache->raw_collect
+ (i, (fpregs + ((i - gdbarch_fp0_regnum (gdbarch))
+ * mips_isa_regsize (gdbarch))));
}
#if 0
diff --git a/gdb/mips64-obsd-nat.c b/gdb/mips64-obsd-nat.c
index 9c306dd..4627cbe 100644
--- a/gdb/mips64-obsd-nat.c
+++ b/gdb/mips64-obsd-nat.c
@@ -71,13 +71,13 @@ mips64obsd_collect_gregset (const struct regcache *regcache,
for (i = MIPS_ZERO_REGNUM; i <= MIPS_PC_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i, regs + i * 8);
+ regcache->raw_collect (i, regs + i * 8);
}
for (i = MIPS_FP0_REGNUM; i <= MIPS_FSR_REGNUM; i++)
{
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i, regs + (i + 2) * 8);
+ regcache->raw_collect (i, regs + (i + 2) * 8);
}
}
\f
diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c
index a79f1f2..070fb20 100644
--- a/gdb/mn10300-linux-tdep.c
+++ b/gdb/mn10300-linux-tdep.c
@@ -274,96 +274,96 @@ am33_collect_gregset_method (const struct regset *regset,
switch (regnum) {
case E_D0_REGNUM:
- regcache_raw_collect (regcache, E_D0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
+ regcache->raw_collect (E_D0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
break;
case E_D1_REGNUM:
- regcache_raw_collect (regcache, E_D1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
+ regcache->raw_collect (E_D1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
break;
case E_D2_REGNUM:
- regcache_raw_collect (regcache, E_D2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
+ regcache->raw_collect (E_D2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
break;
case E_D3_REGNUM:
- regcache_raw_collect (regcache, E_D3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
+ regcache->raw_collect (E_D3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
break;
case E_A0_REGNUM:
- regcache_raw_collect (regcache, E_A0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
+ regcache->raw_collect (E_A0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
break;
case E_A1_REGNUM:
- regcache_raw_collect (regcache, E_A1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
+ regcache->raw_collect (E_A1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
break;
case E_A2_REGNUM:
- regcache_raw_collect (regcache, E_A2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
+ regcache->raw_collect (E_A2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
break;
case E_A3_REGNUM:
- regcache_raw_collect (regcache, E_A3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
+ regcache->raw_collect (E_A3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
break;
case E_SP_REGNUM:
- regcache_raw_collect (regcache, E_SP_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
+ regcache->raw_collect (E_SP_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
break;
case E_PC_REGNUM:
- regcache_raw_collect (regcache, E_PC_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
+ regcache->raw_collect (E_PC_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
break;
case E_MDR_REGNUM:
- regcache_raw_collect (regcache, E_MDR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
+ regcache->raw_collect (E_MDR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
break;
case E_PSW_REGNUM:
- regcache_raw_collect (regcache, E_PSW_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
+ regcache->raw_collect (E_PSW_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
break;
case E_LIR_REGNUM:
- regcache_raw_collect (regcache, E_LIR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
+ regcache->raw_collect (E_LIR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
break;
case E_LAR_REGNUM:
- regcache_raw_collect (regcache, E_LAR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
+ regcache->raw_collect (E_LAR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
break;
case E_MDRQ_REGNUM:
- regcache_raw_collect (regcache, E_MDRQ_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
+ regcache->raw_collect (E_MDRQ_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
break;
case E_E0_REGNUM:
- regcache_raw_collect (regcache, E_E0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
+ regcache->raw_collect (E_E0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
break;
case E_E1_REGNUM:
- regcache_raw_collect (regcache, E_E1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
+ regcache->raw_collect (E_E1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
break;
case E_E2_REGNUM:
- regcache_raw_collect (regcache, E_E2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
+ regcache->raw_collect (E_E2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
break;
case E_E3_REGNUM:
- regcache_raw_collect (regcache, E_E3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
+ regcache->raw_collect (E_E3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
break;
case E_E4_REGNUM:
- regcache_raw_collect (regcache, E_E4_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
+ regcache->raw_collect (E_E4_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
break;
case E_E5_REGNUM:
- regcache_raw_collect (regcache, E_E5_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
+ regcache->raw_collect (E_E5_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
break;
case E_E6_REGNUM:
- regcache_raw_collect (regcache, E_E6_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
+ regcache->raw_collect (E_E6_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
break;
case E_E7_REGNUM:
- regcache_raw_collect (regcache, E_E7_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
+ regcache->raw_collect (E_E7_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
break;
/* ssp, msp, and usp are inaccessible. */
@@ -377,16 +377,16 @@ am33_collect_gregset_method (const struct regset *regset,
/* The gregset struct has noplace to put this: do nothing. */
break;
case E_MCRH_REGNUM:
- regcache_raw_collect (regcache, E_MCRH_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
+ regcache->raw_collect (E_MCRH_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
break;
case E_MCRL_REGNUM:
- regcache_raw_collect (regcache, E_MCRL_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
+ regcache->raw_collect (E_MCRL_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
break;
case E_MCVF_REGNUM:
- regcache_raw_collect (regcache, E_MCVF_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
+ regcache->raw_collect (E_MCVF_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
break;
case E_FPCR_REGNUM:
/* FPCR is numbered among the GP regs, but handled as an FP reg.
@@ -429,12 +429,10 @@ am33_collect_fpregset_method (const struct regset *regset,
E_FPCR_REGNUM, fpregs, len);
}
else if (regnum == E_FPCR_REGNUM)
- regcache_raw_collect (regcache, E_FPCR_REGNUM,
- &fpregset->fpcr);
+ regcache->raw_collect (E_FPCR_REGNUM, &fpregset->fpcr);
else if (E_FS0_REGNUM <= regnum
&& regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG)
- regcache_raw_collect (regcache, regnum,
- &fpregset->fpregs[regnum - E_FS0_REGNUM]);
+ regcache->raw_collect (regnum, &fpregset->fpregs[regnum - E_FS0_REGNUM]);
return;
}
diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index 7ee6f14..e7f4ecf 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -87,8 +87,7 @@ nios2_collect_gregset (const struct regset *regset,
if (regnum == -1 || regnum == regno)
{
if (reg_offsets[regno] != -1)
- regcache_raw_collect (regcache, regno,
- gregs + 4 * reg_offsets[regno]);
+ regcache->raw_collect (regno, gregs + 4 * reg_offsets[regno]);
}
}
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index fcd3001..63cae8a 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -1434,7 +1434,7 @@ nto_procfs_target::store_registers (struct regcache *regcache, int regno)
if (len < 1)
return;
- regcache_raw_collect (regcache, regno, (char *) ® + off);
+ regcache->raw_collect (regno, (char *) ® + off);
err = devctl (ctl_fd, dev_set, ®, regsize, 0);
if (err != EOK)
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 7f209f4..62f3daf 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -895,26 +895,23 @@ store_spe_register (const struct regcache *regcache, int tid, int regno)
int i;
for (i = 0; i < ppc_num_gprs; i++)
- regcache_raw_collect (regcache,
- tdep->ppc_ev0_upper_regnum + i,
- &evrregs.evr[i]);
+ regcache->raw_collect (tdep->ppc_ev0_upper_regnum + i,
+ &evrregs.evr[i]);
}
else if (tdep->ppc_ev0_upper_regnum <= regno
&& regno < tdep->ppc_ev0_upper_regnum + ppc_num_gprs)
- regcache_raw_collect (regcache, regno,
- &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
+ regcache->raw_collect (regno,
+ &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
if (regno == -1
|| regno == tdep->ppc_acc_regnum)
- regcache_raw_collect (regcache,
- tdep->ppc_acc_regnum,
- &evrregs.acc);
+ regcache->raw_collect (tdep->ppc_acc_regnum,
+ &evrregs.acc);
if (regno == -1
|| regno == tdep->ppc_spefscr_regnum)
- regcache_raw_collect (regcache,
- tdep->ppc_spefscr_regnum,
- &evrregs.spefscr);
+ regcache->raw_collect (tdep->ppc_spefscr_regnum,
+ &evrregs.spefscr);
/* Write back the modified register set. */
set_spe_registers (tid, &evrregs);
@@ -958,13 +955,13 @@ store_register (const struct regcache *regcache, int tid, int regno)
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
{
/* Little-endian values always sit at the left end of the buffer. */
- regcache_raw_collect (regcache, regno, buf);
+ regcache->raw_collect (regno, buf);
}
else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
/* Big-endian values sit at the right end of the buffer. */
size_t padding = (bytes_to_transfer - register_size (gdbarch, regno));
- regcache_raw_collect (regcache, regno, buf + padding);
+ regcache->raw_collect (regno, buf + padding);
}
for (i = 0; i < bytes_to_transfer; i += sizeof (long))
diff --git a/gdb/ppc-ravenscar-thread.c b/gdb/ppc-ravenscar-thread.c
index ae5ad24..7b83e45 100644
--- a/gdb/ppc-ravenscar-thread.c
+++ b/gdb/ppc-ravenscar-thread.c
@@ -197,7 +197,7 @@ ppc_ravenscar_generic_store_registers
else
return;
- regcache_raw_collect (regcache, regnum, buf);
+ regcache->raw_collect (regnum, buf);
write_memory (register_address,
buf,
buf_size);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 8d47fda..a914b54 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -948,15 +948,6 @@ detached_regcache::raw_supply_zeroed (int regnum)
m_register_status[regnum] = REG_VALID;
}
-/* Collect register REGNUM from REGCACHE and store its contents in BUF. */
-
-void
-regcache_raw_collect (const struct regcache *regcache, int regnum, void *buf)
-{
- gdb_assert (regcache != NULL && buf != NULL);
- regcache->raw_collect (regnum, buf);
-}
-
void
regcache::raw_collect (int regnum, void *buf) const
{
diff --git a/gdb/regcache.h b/gdb/regcache.h
index b60f031..3edddf4 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -67,13 +67,6 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache,
/* For regcache_read_pc see common/common-regcache.h. */
extern void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc);
-/* Transfer a raw register [0..NUM_REGS) between the regcache and the
- target. These functions are called by the target in response to a
- target_fetch_registers() or target_store_registers(). */
-
-extern void regcache_raw_collect (const struct regcache *regcache,
- int regnum, void *buf);
-
/* Mapping between register numbers and offsets in a buffer, for use
in the '*regset' functions below. In an array of
'regcache_map_entry' each element is interpreted like follows:
@@ -299,6 +292,7 @@ public:
void raw_update (int regnum) override;
+ /* Collect register REGNUM from REGCACHE and store its contents in BUF. */
void raw_collect (int regnum, void *buf) const;
void raw_collect_integer (int regnum, gdb_byte *addr, int addr_len,
diff --git a/gdb/remote.c b/gdb/remote.c
index 3f0b678..3013fbe 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8367,7 +8367,7 @@ remote_target::store_register_using_P (const struct regcache *regcache,
xsnprintf (buf, get_remote_packet_size (), "P%s=", phex_nz (reg->pnum, 0));
p = buf + strlen (buf);
- regcache_raw_collect (regcache, reg->regnum, regp);
+ regcache->raw_collect (reg->regnum, regp);
bin2hex (regp, p, register_size (gdbarch, reg->regnum));
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
@@ -8409,7 +8409,7 @@ remote_target::store_registers_using_G (const struct regcache *regcache)
struct packet_reg *r = &rsa->regs[i];
if (r->in_g_packet)
- regcache_raw_collect (regcache, r->regnum, regs + r->offset);
+ regcache->raw_collect (r->regnum, regs + r->offset);
}
}
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 7e39d57..31677c2 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -253,7 +253,7 @@ store_register (struct regcache *regcache, int regno)
pid_t pid = ptid_get_pid (regcache->ptid ());
/* Fetch the register's value from the register cache. */
- regcache_raw_collect (regcache, regno, addr);
+ regcache->raw_collect (regno, addr);
/* -1 can be a successful return value, so infer errors from errno. */
errno = 0;
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index e165d1b..a0f290f 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -418,7 +418,7 @@ ppc_collect_reg (const struct regcache *regcache, int regnum,
regsize - gdb_regsize);
}
}
- regcache_raw_collect (regcache, regnum, regs + offset);
+ regcache->raw_collect (regnum, regs + offset);
}
}
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index 303cbee..60c549a 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -210,14 +210,14 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno)
if (regno == -1 || regno == S390_PSWM_REGNUM)
{
pswm &= 0x80000000;
- regcache_raw_collect (regcache, S390_PSWM_REGNUM, buf);
+ regcache->raw_collect (S390_PSWM_REGNUM, buf);
pswm |= (extract_unsigned_integer (buf, 4, byte_order)
& 0xfff7ffff) << 32;
}
if (regno == -1 || regno == S390_PSWA_REGNUM)
{
- regcache_raw_collect (regcache, S390_PSWA_REGNUM, buf);
+ regcache->raw_collect (S390_PSWA_REGNUM, buf);
pswa = extract_unsigned_integer (buf, 4, byte_order);
pswm ^= (pswm ^ pswa) & 0x80000000;
pswa &= 0x7fffffff;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 5e9fd09..d1a1434 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -2201,7 +2201,7 @@ sh_corefile_collect_regset (const struct regset *regset,
{
if ((regnum == -1 || regnum == regmap[i].regnum)
&& regmap[i].offset + 4 <= len)
- regcache_raw_collect (regcache, regmap[i].regnum,
+ regcache->raw_collect (regmap[i].regnum,
(char *)regs + regmap[i].offset);
}
}
diff --git a/gdb/sparc-obsd-tdep.c b/gdb/sparc-obsd-tdep.c
index c821562..0f6caa6 100644
--- a/gdb/sparc-obsd-tdep.c
+++ b/gdb/sparc-obsd-tdep.c
@@ -208,7 +208,7 @@ sparc32obsd_collect_uthread(const struct regcache *regcache,
{
CORE_ADDR fp_addr = addr + SPARC32OBSD_UTHREAD_FP_OFFSET;
- regcache_raw_collect (regcache, SPARC_SP_REGNUM, buf);
+ regcache->raw_collect (SPARC_SP_REGNUM, buf);
write_memory (fp_addr,buf, 4);
}
@@ -216,7 +216,7 @@ sparc32obsd_collect_uthread(const struct regcache *regcache,
{
CORE_ADDR i7, i7_addr = addr + SPARC32OBSD_UTHREAD_PC_OFFSET;
- regcache_raw_collect (regcache, SPARC32_PC_REGNUM, buf);
+ regcache->raw_collect (SPARC32_PC_REGNUM, buf);
i7 = extract_unsigned_integer (buf, 4, byte_order) - 8;
write_memory_unsigned_integer (i7_addr, 4, byte_order, i7);
@@ -224,7 +224,7 @@ sparc32obsd_collect_uthread(const struct regcache *regcache,
return;
}
- regcache_raw_collect (regcache, SPARC_SP_REGNUM, buf);
+ regcache->raw_collect (SPARC_SP_REGNUM, buf);
sp = extract_unsigned_integer (buf, 4, byte_order);
sparc_collect_rwindow (regcache, sp, regnum);
}
diff --git a/gdb/sparc-ravenscar-thread.c b/gdb/sparc-ravenscar-thread.c
index 129b4b6..0b4d68a 100644
--- a/gdb/sparc-ravenscar-thread.c
+++ b/gdb/sparc-ravenscar-thread.c
@@ -172,7 +172,7 @@ sparc_ravenscar_store_registers (struct regcache *regcache, int regnum)
else
return;
- regcache_raw_collect (regcache, regnum, buf);
+ regcache->raw_collect (regnum, buf);
write_memory (register_address,
buf,
buf_size);
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index ad0d2b4..65c1f00 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -2031,7 +2031,7 @@ sparc_collect_rwindow (const struct regcache *regcache,
{
if (regnum == -1 || regnum == SPARC_SP_REGNUM || regnum == i)
{
- regcache_raw_collect (regcache, i, buf);
+ regcache->raw_collect (i, buf);
/* Handle StackGhost. */
if (i == SPARC_I7_REGNUM)
@@ -2061,7 +2061,7 @@ sparc_collect_rwindow (const struct regcache *regcache,
{
if (regnum == -1 || regnum == SPARC_SP_REGNUM || regnum == i)
{
- regcache_raw_collect (regcache, i, buf);
+ regcache->raw_collect (i, buf);
/* Handle StackGhost. */
if (i == SPARC_I7_REGNUM)
@@ -2153,20 +2153,16 @@ sparc32_collect_gregset (const struct sparc_gregmap *gregmap,
int i;
if (regnum == SPARC32_PSR_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_PSR_REGNUM,
- regs + gregmap->r_psr_offset);
+ regcache->raw_collect (SPARC32_PSR_REGNUM, regs + gregmap->r_psr_offset);
if (regnum == SPARC32_PC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_PC_REGNUM,
- regs + gregmap->r_pc_offset);
+ regcache->raw_collect (SPARC32_PC_REGNUM, regs + gregmap->r_pc_offset);
if (regnum == SPARC32_NPC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_NPC_REGNUM,
- regs + gregmap->r_npc_offset);
+ regcache->raw_collect (SPARC32_NPC_REGNUM, regs + gregmap->r_npc_offset);
if (regnum == SPARC32_Y_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_Y_REGNUM,
- regs + gregmap->r_y_offset);
+ regcache->raw_collect (SPARC32_Y_REGNUM, regs + gregmap->r_y_offset);
if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_O7_REGNUM) || regnum == -1)
{
@@ -2176,7 +2172,7 @@ sparc32_collect_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_G1_REGNUM; i <= SPARC_O7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_collect (regcache, i, regs + offset);
+ regcache->raw_collect (i, regs + offset);
offset += 4;
}
}
@@ -2192,7 +2188,7 @@ sparc32_collect_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_collect (regcache, i, regs + offset);
+ regcache->raw_collect (i, regs + offset);
offset += 4;
}
}
@@ -2229,13 +2225,13 @@ sparc32_collect_fpregset (const struct sparc_fpregmap *fpregmap,
for (i = 0; i < 32; i++)
{
if (regnum == (SPARC_F0_REGNUM + i) || regnum == -1)
- regcache_raw_collect (regcache, SPARC_F0_REGNUM + i,
- regs + fpregmap->r_f0_offset + (i * 4));
+ regcache->raw_collect (SPARC_F0_REGNUM + i,
+ regs + fpregmap->r_f0_offset + (i * 4));
}
if (regnum == SPARC32_FSR_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_FSR_REGNUM,
- regs + fpregmap->r_fsr_offset);
+ regcache->raw_collect (SPARC32_FSR_REGNUM,
+ regs + fpregmap->r_fsr_offset);
}
\f
diff --git a/gdb/sparc64-obsd-tdep.c b/gdb/sparc64-obsd-tdep.c
index 6af5f08..48b45c4 100644
--- a/gdb/sparc64-obsd-tdep.c
+++ b/gdb/sparc64-obsd-tdep.c
@@ -379,7 +379,7 @@ sparc64obsd_collect_uthread(const struct regcache *regcache,
{
CORE_ADDR fp_addr = addr + SPARC64OBSD_UTHREAD_FP_OFFSET;
- regcache_raw_collect (regcache, SPARC_SP_REGNUM, buf);
+ regcache->raw_collect (SPARC_SP_REGNUM, buf);
write_memory (fp_addr,buf, 8);
}
@@ -387,7 +387,7 @@ sparc64obsd_collect_uthread(const struct regcache *regcache,
{
CORE_ADDR i7, i7_addr = addr + SPARC64OBSD_UTHREAD_PC_OFFSET;
- regcache_raw_collect (regcache, SPARC64_PC_REGNUM, buf);
+ regcache->raw_collect (SPARC64_PC_REGNUM, buf);
i7 = extract_unsigned_integer (buf, 8, byte_order) - 8;
write_memory_unsigned_integer (i7_addr, 8, byte_order, i7);
@@ -395,7 +395,7 @@ sparc64obsd_collect_uthread(const struct regcache *regcache,
return;
}
- regcache_raw_collect (regcache, SPARC_SP_REGNUM, buf);
+ regcache->raw_collect (SPARC_SP_REGNUM, buf);
sp = extract_unsigned_integer (buf, 8, byte_order);
sparc_collect_rwindow (regcache, sp, regnum);
}
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 083ad72..86b5fcf 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -2010,7 +2010,7 @@ sparc64_collect_gregset (const struct sparc_gregmap *gregmap,
gdb_byte buf[8];
tstate = extract_unsigned_integer (regs + offset, 8, byte_order);
- regcache_raw_collect (regcache, SPARC32_PSR_REGNUM, buf);
+ regcache->raw_collect (SPARC32_PSR_REGNUM, buf);
psr = extract_unsigned_integer (buf, 4, byte_order);
tstate |= (psr & PSR_ICC) << 12;
if ((psr & (PSR_VERS | PSR_IMPL)) == PSR_V8PLUS)
@@ -2020,46 +2020,46 @@ sparc64_collect_gregset (const struct sparc_gregmap *gregmap,
}
if (regnum == SPARC32_PC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_PC_REGNUM,
- regs + gregmap->r_pc_offset + 4);
+ regcache->raw_collect (SPARC32_PC_REGNUM,
+ regs + gregmap->r_pc_offset + 4);
if (regnum == SPARC32_NPC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_NPC_REGNUM,
- regs + gregmap->r_npc_offset + 4);
+ regcache->raw_collect (SPARC32_NPC_REGNUM,
+ regs + gregmap->r_npc_offset + 4);
if (regnum == SPARC32_Y_REGNUM || regnum == -1)
{
int offset = gregmap->r_y_offset + 8 - gregmap->r_y_size;
- regcache_raw_collect (regcache, SPARC32_Y_REGNUM, regs + offset);
+ regcache->raw_collect (SPARC32_Y_REGNUM, regs + offset);
}
}
else
{
if (regnum == SPARC64_STATE_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC64_STATE_REGNUM,
- regs + gregmap->r_tstate_offset);
+ regcache->raw_collect (SPARC64_STATE_REGNUM,
+ regs + gregmap->r_tstate_offset);
if (regnum == SPARC64_PC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC64_PC_REGNUM,
- regs + gregmap->r_pc_offset);
+ regcache->raw_collect (SPARC64_PC_REGNUM,
+ regs + gregmap->r_pc_offset);
if (regnum == SPARC64_NPC_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC64_NPC_REGNUM,
- regs + gregmap->r_npc_offset);
+ regcache->raw_collect (SPARC64_NPC_REGNUM,
+ regs + gregmap->r_npc_offset);
if (regnum == SPARC64_Y_REGNUM || regnum == -1)
{
gdb_byte buf[8];
- regcache_raw_collect (regcache, SPARC64_Y_REGNUM, buf);
+ regcache->raw_collect (SPARC64_Y_REGNUM, buf);
memcpy (regs + gregmap->r_y_offset,
buf + 8 - gregmap->r_y_size, gregmap->r_y_size);
}
if ((regnum == SPARC64_FPRS_REGNUM || regnum == -1)
&& gregmap->r_fprs_offset != -1)
- regcache_raw_collect (regcache, SPARC64_FPRS_REGNUM,
- regs + gregmap->r_fprs_offset);
+ regcache->raw_collect (SPARC64_FPRS_REGNUM,
+ regs + gregmap->r_fprs_offset);
}
@@ -2074,7 +2074,7 @@ sparc64_collect_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_G1_REGNUM; i <= SPARC_O7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_collect (regcache, i, regs + offset);
+ regcache->raw_collect (i, regs + offset);
offset += 8;
}
}
@@ -2093,7 +2093,7 @@ sparc64_collect_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_collect (regcache, i, regs + offset);
+ regcache->raw_collect (i, regs + offset);
offset += 8;
}
}
@@ -2113,7 +2113,7 @@ sparc64_supply_fpregset (const struct sparc_fpregmap *fpregmap,
{
if (regnum == (SPARC_F0_REGNUM + i) || regnum == -1)
regcache->raw_supply (SPARC_F0_REGNUM + i,
- regs + fpregmap->r_f0_offset + (i * 4));
+ regs + fpregmap->r_f0_offset + (i * 4));
}
if (sparc32)
@@ -2150,29 +2150,29 @@ sparc64_collect_fpregset (const struct sparc_fpregmap *fpregmap,
for (i = 0; i < 32; i++)
{
if (regnum == (SPARC_F0_REGNUM + i) || regnum == -1)
- regcache_raw_collect (regcache, SPARC_F0_REGNUM + i,
- regs + fpregmap->r_f0_offset + (i * 4));
+ regcache->raw_collect (SPARC_F0_REGNUM + i,
+ regs + fpregmap->r_f0_offset + (i * 4));
}
if (sparc32)
{
if (regnum == SPARC32_FSR_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC32_FSR_REGNUM,
- regs + fpregmap->r_fsr_offset);
+ regcache->raw_collect (SPARC32_FSR_REGNUM,
+ regs + fpregmap->r_fsr_offset);
}
else
{
for (i = 0; i < 16; i++)
{
if (regnum == (SPARC64_F32_REGNUM + i) || regnum == -1)
- regcache_raw_collect (regcache, SPARC64_F32_REGNUM + i,
- (regs + fpregmap->r_f0_offset
- + (32 * 4) + (i * 8)));
+ regcache->raw_collect (SPARC64_F32_REGNUM + i,
+ (regs + fpregmap->r_f0_offset
+ + (32 * 4) + (i * 8)));
}
if (regnum == SPARC64_FSR_REGNUM || regnum == -1)
- regcache_raw_collect (regcache, SPARC64_FSR_REGNUM,
- regs + fpregmap->r_fsr_offset);
+ regcache->raw_collect (SPARC64_FSR_REGNUM,
+ regs + fpregmap->r_fsr_offset);
}
}
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 6a5be8b..96cda72 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -577,7 +577,7 @@ spu_linux_nat_target::store_registers (struct regcache *regcache, int regno)
if (regno == -1 || regno == SPU_PC_REGNUM)
{
gdb_byte buf[4];
- regcache_raw_collect (regcache, SPU_PC_REGNUM, buf);
+ regcache->raw_collect (SPU_PC_REGNUM, buf);
store_ppc_memory (addr, buf, 4);
}
@@ -590,7 +590,7 @@ spu_linux_nat_target::store_registers (struct regcache *regcache, int regno)
ULONGEST len;
for (i = 0; i < SPU_NUM_GPRS; i++)
- regcache_raw_collect (regcache, i, buf + i*16);
+ regcache->raw_collect (i, buf + i*16);
xsnprintf (annex, sizeof annex, "%d/regs", fd);
spu_proc_xfer_spu (annex, NULL, buf, 0, sizeof buf, &len);
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index dc99f60..39a657f 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -265,7 +265,7 @@ spu_multiarch_target::store_registers (struct regcache *regcache, int regno)
if (regno == -1 || regno == SPU_PC_REGNUM)
{
gdb_byte buf[4];
- regcache_raw_collect (regcache, SPU_PC_REGNUM, buf);
+ regcache->raw_collect (SPU_PC_REGNUM, buf);
target_write (ops_beneath, TARGET_OBJECT_MEMORY, NULL,
buf, spufs_addr, sizeof buf);
@@ -279,7 +279,7 @@ spu_multiarch_target::store_registers (struct regcache *regcache, int regno)
int i;
for (i = 0; i < SPU_NUM_GPRS; i++)
- regcache_raw_collect (regcache, i, buf + i*16);
+ regcache->raw_collect (i, buf + i*16);
xsnprintf (annex, sizeof annex, "%d/regs", spufs_fd);
target_write (ops_beneath, TARGET_OBJECT_SPU, annex,
diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c
index 1ff6485..6fa7fb6 100644
--- a/gdb/tilegx-linux-nat.c
+++ b/gdb/tilegx-linux-nat.c
@@ -103,7 +103,7 @@ fill_gregset (const struct regcache* regcache,
for (i = 0; i < sizeof (regmap) / sizeof (regmap[0]); i++)
if (regmap[i] >= 0)
- regcache_raw_collect (regcache, i, regp + regmap[i]);
+ regcache->raw_collect (i, regp + regmap[i]);
}
/* Transfering floating-point registers between GDB, inferiors and cores. */
diff --git a/gdb/vax-bsd-nat.c b/gdb/vax-bsd-nat.c
index 527d718..10cd12e 100644
--- a/gdb/vax-bsd-nat.c
+++ b/gdb/vax-bsd-nat.c
@@ -62,7 +62,7 @@ vaxbsd_collect_gregset (const struct regcache *regcache,
for (i = 0; i <= VAX_NUM_REGS; i++)
{
if (regnum == -1 || regnum == i)
- regcache_raw_collect (regcache, i, regs + i * 4);
+ regcache->raw_collect (i, regs + i * 4);
}
}
\f
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 2d6ece0..0f24257 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -596,8 +596,7 @@ do_windows_store_inferior_registers (const struct regcache *regcache,
windows_thread_info *th, int r)
{
if (r >= 0)
- regcache_raw_collect (regcache, r,
- ((char *) &th->context) + mappings[r]);
+ regcache->raw_collect (r, ((char *) &th->context) + mappings[r]);
else
{
for (r = 0; r < gdbarch_num_regs (regcache->arch ()); r++)
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index 8737a9a..5ac29ee 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -64,63 +64,54 @@ fill_gregset (const struct regcache *regcache,
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
- regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch), ®s->pc);
+ regcache->raw_collect (gdbarch_pc_regnum (gdbarch), ®s->pc);
if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
- regcache_raw_collect (regcache, gdbarch_ps_regnum (gdbarch), ®s->ps);
+ regcache->raw_collect (gdbarch_ps_regnum (gdbarch), ®s->ps);
if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->wb_regnum,
- ®s->windowbase);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->wb_regnum,
+ ®s->windowbase);
if (regnum == gdbarch_tdep (gdbarch)->ws_regnum || regnum == -1)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->ws_regnum,
- ®s->windowstart);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->ws_regnum,
+ ®s->windowstart);
if (regnum == gdbarch_tdep (gdbarch)->lbeg_regnum || regnum == -1)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->lbeg_regnum,
- ®s->lbeg);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->lbeg_regnum,
+ ®s->lbeg);
if (regnum == gdbarch_tdep (gdbarch)->lend_regnum || regnum == -1)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->lend_regnum,
- ®s->lend);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->lend_regnum,
+ ®s->lend);
if (regnum == gdbarch_tdep (gdbarch)->lcount_regnum || regnum == -1)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->lcount_regnum,
- ®s->lcount);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->lcount_regnum,
+ ®s->lcount);
if (regnum == gdbarch_tdep (gdbarch)->sar_regnum || regnum == -1)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->sar_regnum,
- ®s->sar);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->sar_regnum,
+ ®s->sar);
if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->threadptr_regnum,
- ®s->threadptr);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->threadptr_regnum,
+ ®s->threadptr);
if (regnum >=gdbarch_tdep (gdbarch)->ar_base
&& regnum < gdbarch_tdep (gdbarch)->ar_base
+ gdbarch_tdep (gdbarch)->num_aregs)
- regcache_raw_collect (regcache,regnum,
- ®s->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]);
+ regcache->raw_collect (regnum,
+ ®s->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]);
else if (regnum == -1)
{
for (i = 0; i < gdbarch_tdep (gdbarch)->num_aregs; ++i)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->ar_base + i,
- ®s->ar[i]);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->ar_base + i,
+ ®s->ar[i]);
}
if (regnum >= gdbarch_tdep (gdbarch)->a0_base
&& regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS)
- regcache_raw_collect (regcache, regnum,
- ®s->ar[(4 * regs->windowbase + regnum
- - gdbarch_tdep (gdbarch)->a0_base)
+ regcache->raw_collect (regnum,
+ ®s->ar[(4 * regs->windowbase + regnum
+ - gdbarch_tdep (gdbarch)->a0_base)
% gdbarch_tdep (gdbarch)->num_aregs]);
else if (regnum == -1)
{
for (i = 0; i < C0_NREGS; ++i)
- regcache_raw_collect (regcache,
- gdbarch_tdep (gdbarch)->a0_base + i,
- ®s->ar[(4 * regs->windowbase + i)
- % gdbarch_tdep (gdbarch)->num_aregs]);
+ regcache->raw_collect (gdbarch_tdep (gdbarch)->a0_base + i,
+ (®s->ar[(4 * regs->windowbase + i)
+ % gdbarch_tdep (gdbarch)->num_aregs]));
}
}
@@ -282,8 +273,7 @@ store_xtregs (struct regcache *regcache, int regnum)
for (ptr = xtensa_regmap_table; ptr->name; ptr++)
if (regnum == ptr->gdb_regnum || regnum == -1)
- regcache_raw_collect (regcache, ptr->gdb_regnum,
- xtregs + ptr->ptrace_offset);
+ regcache->raw_collect (ptr->gdb_regnum, xtregs + ptr->ptrace_offset);
if (ptrace (PTRACE_SETXTREGS, tid, 0, (long)&xtregs) < 0)
perror_with_name (_("Couldn't write extended registers"));
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 03/15] Remove regcache_raw_update
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (6 preceding siblings ...)
2018-05-30 19:05 ` [pushed 11/15] Remove regcache_cooked_read_value Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 09/15] Remove regcache_invalidate Simon Marchi
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_raw_update, update callers to use
readable_regcache::raw_update instead.
gdb/ChangeLog:
* regcache.h (regcache_raw_update): Remove, update callers to
use readable_regcache::raw_update instead.
* regcache.c (regcache_raw_update): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/regcache.c | 8 --------
gdb/regcache.h | 5 +----
gdb/remote.c | 2 +-
4 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ef6d921..4f451a2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_raw_update): Remove, update callers to
+ use readable_regcache::raw_update instead.
+ * regcache.c (regcache_raw_update): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_register_status): Remove, update callers
to use reg_buffer::get_register_status directly instead.
* regcache.c (regcache_register_status): Remove.
diff --git a/gdb/regcache.c b/gdb/regcache.c
index dd1dde2..64d167a 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -489,14 +489,6 @@ registers_changed (void)
}
void
-regcache_raw_update (struct regcache *regcache, int regnum)
-{
- gdb_assert (regcache != NULL);
-
- regcache->raw_update (regnum);
-}
-
-void
regcache::raw_update (int regnum)
{
assert_regnum (regnum);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index fa177b5..dffc27f 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -35,10 +35,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
struct gdbarch *,
struct address_space *);
-/* Make certain that the register REGNUM in REGCACHE is up-to-date. */
-
-void regcache_raw_update (struct regcache *regcache, int regnum);
-
/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
regcache. The read variants return the status of the register. */
@@ -257,6 +253,7 @@ public:
enum register_status raw_read_part (int regnum, int offset, int len,
gdb_byte *buf);
+ /* Make certain that the register REGNUM is up-to-date. */
virtual void raw_update (int regnum) = 0;
enum register_status cooked_read (int regnum, gdb_byte *buf);
diff --git a/gdb/remote.c b/gdb/remote.c
index 3df9ad4..3aca5fb 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8339,7 +8339,7 @@ remote_target::prepare_to_store (struct regcache *regcache)
/* Make sure all the necessary registers are cached. */
for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
if (rsa->regs[i].in_g_packet)
- regcache_raw_update (regcache, rsa->regs[i].regnum);
+ regcache->raw_update (rsa->regs[i].regnum);
break;
case PACKET_ENABLE:
break;
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 14/15] Remove regcache_raw_supply
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (8 preceding siblings ...)
2018-05-30 19:05 ` [pushed 09/15] Remove regcache_invalidate Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 04/15] Remove regcache_raw_read Simon Marchi
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_raw_supply, update callers to use
detached_regcache::raw_supply.
gdb/ChangeLog:
* regcache.h (regcache_raw_supply): Remove, update callers to
use detached_regcache::raw_supply.
* regcache.c (regcache_raw_supply): Remove.
---
gdb/ChangeLog | 6 ++
gdb/aarch32-linux-nat.c | 14 ++---
gdb/aarch64-linux-nat.c | 9 ++-
gdb/aix-thread.c | 45 +++++++--------
gdb/alpha-bsd-nat.c | 7 +--
gdb/alpha-nbsd-tdep.c | 12 ++--
gdb/alpha-tdep.c | 13 ++---
gdb/amd64-bsd-nat.c | 4 +-
gdb/amd64-fbsd-nat.c | 24 ++++----
gdb/amd64-linux-nat.c | 4 +-
gdb/amd64-nat.c | 2 +-
gdb/amd64-obsd-nat.c | 18 +++---
gdb/amd64-obsd-tdep.c | 4 +-
gdb/amd64-tdep.c | 10 ++--
gdb/arch-utils.c | 2 +-
gdb/arm-bsd-tdep.c | 6 +-
gdb/arm-linux-nat.c | 14 ++---
gdb/arm-linux-tdep.c | 20 +++----
gdb/arm-nbsd-nat.c | 51 +++++++---------
gdb/corelow.c | 2 +-
gdb/cris-tdep.c | 6 +-
gdb/ctf.c | 4 +-
gdb/go32-nat.c | 4 +-
gdb/hppa-linux-nat.c | 10 ++--
gdb/hppa-nbsd-nat.c | 30 +++++-----
gdb/hppa-nbsd-tdep.c | 2 +-
gdb/hppa-obsd-nat.c | 46 +++++++--------
gdb/hppa-obsd-tdep.c | 44 +++++++-------
gdb/i386-bsd-nat.c | 2 +-
gdb/i386-darwin-nat.c | 7 +--
gdb/i386-fbsd-nat.c | 14 ++---
gdb/i386-gnu-nat.c | 9 ++-
gdb/i386-linux-nat.c | 12 ++--
gdb/i386-nbsd-nat.c | 12 ++--
gdb/i386-obsd-nat.c | 14 ++---
gdb/i386-obsd-tdep.c | 4 +-
gdb/i386-tdep.c | 2 +-
gdb/i386-v4-nat.c | 2 +-
gdb/i387-tdep.c | 134 +++++++++++++++++++------------------------
gdb/ia64-linux-nat.c | 49 ++++++++--------
gdb/ia64-linux-tdep.c | 4 +-
gdb/linux-nat-trad.c | 4 +-
gdb/m32r-linux-nat.c | 6 +-
gdb/m32r-linux-tdep.c | 2 +-
gdb/m68k-bsd-nat.c | 14 ++---
gdb/m68k-bsd-tdep.c | 5 +-
gdb/m68k-linux-nat.c | 21 +++----
gdb/mips-linux-tdep.c | 13 ++---
gdb/mips-nbsd-tdep.c | 17 +++---
gdb/mips64-obsd-nat.c | 4 +-
gdb/mips64-obsd-tdep.c | 2 +-
gdb/mn10300-linux-tdep.c | 110 +++++++++++++++++------------------
gdb/nios2-linux-tdep.c | 5 +-
gdb/ppc-fbsd-nat.c | 8 +--
gdb/ppc-linux-nat.c | 18 +++---
gdb/ppc-nbsd-nat.c | 17 +++---
gdb/ppc-obsd-nat.c | 14 ++---
gdb/ppc-ravenscar-thread.c | 2 +-
gdb/record-btrace.c | 2 +-
gdb/regcache.c | 9 ---
gdb/regcache.h | 3 +-
gdb/remote.c | 15 +++--
gdb/rs6000-nat.c | 2 +-
gdb/rs6000-tdep.c | 2 +-
gdb/s390-linux-nat.c | 4 +-
gdb/s390-tdep.c | 4 +-
gdb/score-tdep.c | 5 +-
gdb/sh-tdep.c | 4 +-
gdb/sparc-nat.c | 2 +-
gdb/sparc-nbsd-nat.c | 10 ++--
gdb/sparc-obsd-tdep.c | 6 +-
gdb/sparc-ravenscar-thread.c | 2 +-
gdb/sparc-tdep.c | 29 ++++------
gdb/sparc64-fbsd-nat.c | 6 +-
gdb/sparc64-nbsd-nat.c | 6 +-
gdb/sparc64-obsd-nat.c | 6 +-
gdb/sparc64-obsd-tdep.c | 6 +-
gdb/sparc64-tdep.c | 50 ++++++++--------
gdb/spu-linux-nat.c | 6 +-
gdb/spu-multiarch.c | 6 +-
gdb/tilegx-linux-nat.c | 2 +-
gdb/tracefile-tfile.c | 4 +-
gdb/tracefile.c | 2 +-
gdb/vax-bsd-nat.c | 14 ++---
gdb/vax-tdep.c | 2 +-
gdb/windows-nat.c | 8 +--
gdb/xtensa-linux-nat.c | 46 ++++++---------
gdb/xtensa-tdep.c | 37 ++++++------
88 files changed, 581 insertions(+), 659 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b0fb0c6..c7dd3d6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_raw_supply): Remove, update callers to
+ use detached_regcache::raw_supply.
+ * regcache.c (regcache_raw_supply): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_cooked_write_part): Remove, update
callers to use regcache::cooked_write_part.
* regcache.c (regcache_cooked_write_part): Remove.
diff --git a/gdb/aarch32-linux-nat.c b/gdb/aarch32-linux-nat.c
index d1c1314..3297d6c 100644
--- a/gdb/aarch32-linux-nat.c
+++ b/gdb/aarch32-linux-nat.c
@@ -34,20 +34,20 @@ aarch32_gp_regcache_supply (struct regcache *regcache, uint32_t *regs,
int regno;
for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
- regcache_raw_supply (regcache, regno, ®s[regno]);
+ regcache->raw_supply (regno, ®s[regno]);
if (arm_apcs_32)
{
/* Clear reserved bits bit 20 to bit 23. */
regs[ARM_CPSR_GREGNUM] &= 0xff0fffff;
- regcache_raw_supply (regcache, ARM_PS_REGNUM, ®s[ARM_CPSR_GREGNUM]);
+ regcache->raw_supply (ARM_PS_REGNUM, ®s[ARM_CPSR_GREGNUM]);
}
else
- regcache_raw_supply (regcache, ARM_PS_REGNUM, ®s[ARM_PC_REGNUM]);
+ regcache->raw_supply (ARM_PS_REGNUM, ®s[ARM_PC_REGNUM]);
regs[ARM_PC_REGNUM] = gdbarch_addr_bits_remove
(regcache->arch (), regs[ARM_PC_REGNUM]);
- regcache_raw_supply (regcache, ARM_PC_REGNUM, ®s[ARM_PC_REGNUM]);
+ regcache->raw_supply (ARM_PC_REGNUM, ®s[ARM_PC_REGNUM]);
}
/* Collect GP registers from REGCACHE to buffer REGS. ARM_APCS_32 is
@@ -88,11 +88,9 @@ aarch32_vfp_regcache_supply (struct regcache *regcache, gdb_byte *regs,
int regno;
for (regno = 0; regno < vfp_register_count; regno++)
- regcache_raw_supply (regcache, regno + ARM_D0_REGNUM,
- regs + regno * 8);
+ regcache->raw_supply (regno + ARM_D0_REGNUM, regs + regno * 8);
- regcache_raw_supply (regcache, ARM_FPSCR_REGNUM,
- regs + 32 * 8);
+ regcache->raw_supply (ARM_FPSCR_REGNUM, regs + 32 * 8);
}
/* Collect VFP registers from REGCACHE to buffer REGS.
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index c1fb7ac..a46bace 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -227,7 +227,7 @@ fetch_gregs_from_thread (struct regcache *regcache)
int regno;
for (regno = AARCH64_X0_REGNUM; regno <= AARCH64_CPSR_REGNUM; regno++)
- regcache_raw_supply (regcache, regno, ®s[regno - AARCH64_X0_REGNUM]);
+ regcache->raw_supply (regno, ®s[regno - AARCH64_X0_REGNUM]);
}
}
@@ -314,11 +314,10 @@ fetch_fpregs_from_thread (struct regcache *regcache)
perror_with_name (_("Unable to fetch vFP/SIMD registers."));
for (regno = AARCH64_V0_REGNUM; regno <= AARCH64_V31_REGNUM; regno++)
- regcache_raw_supply (regcache, regno,
- ®s.vregs[regno - AARCH64_V0_REGNUM]);
+ regcache->raw_supply (regno, ®s.vregs[regno - AARCH64_V0_REGNUM]);
- regcache_raw_supply (regcache, AARCH64_FPSR_REGNUM, ®s.fpsr);
- regcache_raw_supply (regcache, AARCH64_FPCR_REGNUM, ®s.fpcr);
+ regcache->raw_supply (AARCH64_FPSR_REGNUM, ®s.fpsr);
+ regcache->raw_supply (AARCH64_FPCR_REGNUM, ®s.fpcr);
}
}
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 749065c..838b1a3 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1116,8 +1116,8 @@ supply_gprs64 (struct regcache *regcache, uint64_t *vals)
int regno;
for (regno = 0; regno < ppc_num_gprs; regno++)
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + regno,
- (char *) (vals + regno));
+ regcache->raw_supply (tdep->ppc_gp0_regnum + regno,
+ (char *) (vals + regno));
}
/* Record that 32-bit register REGNO contains VAL. */
@@ -1125,7 +1125,7 @@ supply_gprs64 (struct regcache *regcache, uint64_t *vals)
static void
supply_reg32 (struct regcache *regcache, int regno, uint32_t val)
{
- regcache_raw_supply (regcache, regno, (char *) &val);
+ regcache->raw_supply (regno, (char *) &val);
}
/* Record that the floating-point registers contain VALS. */
@@ -1144,8 +1144,8 @@ supply_fprs (struct regcache *regcache, double *vals)
for (regno = tdep->ppc_fp0_regnum;
regno < tdep->ppc_fp0_regnum + ppc_num_fprs;
regno++)
- regcache_raw_supply (regcache, regno,
- (char *) (vals + regno - tdep->ppc_fp0_regnum));
+ regcache->raw_supply (regno,
+ (char *) (vals + regno - tdep->ppc_fp0_regnum));
}
/* Predicate to test whether given register number is a "special" register. */
@@ -1177,16 +1177,14 @@ supply_sprs64 (struct regcache *regcache,
struct gdbarch *gdbarch = regcache->arch ();
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
- (char *) &iar);
- regcache_raw_supply (regcache, tdep->ppc_ps_regnum, (char *) &msr);
- regcache_raw_supply (regcache, tdep->ppc_cr_regnum, (char *) &cr);
- regcache_raw_supply (regcache, tdep->ppc_lr_regnum, (char *) &lr);
- regcache_raw_supply (regcache, tdep->ppc_ctr_regnum, (char *) &ctr);
- regcache_raw_supply (regcache, tdep->ppc_xer_regnum, (char *) &xer);
+ regcache->raw_supply (gdbarch_pc_regnum (gdbarch), (char *) &iar);
+ regcache->raw_supply (tdep->ppc_ps_regnum, (char *) &msr);
+ regcache->raw_supply (tdep->ppc_cr_regnum, (char *) &cr);
+ regcache->raw_supply (tdep->ppc_lr_regnum, (char *) &lr);
+ regcache->raw_supply (tdep->ppc_ctr_regnum, (char *) &ctr);
+ regcache->raw_supply (tdep->ppc_xer_regnum, (char *) &xer);
if (tdep->ppc_fpscr_regnum >= 0)
- regcache_raw_supply (regcache, tdep->ppc_fpscr_regnum,
- (char *) &fpscr);
+ regcache->raw_supply (tdep->ppc_fpscr_regnum, (char *) &fpscr);
}
/* Record that the special registers contain the specified 32-bit
@@ -1201,16 +1199,14 @@ supply_sprs32 (struct regcache *regcache,
struct gdbarch *gdbarch = regcache->arch ();
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
- (char *) &iar);
- regcache_raw_supply (regcache, tdep->ppc_ps_regnum, (char *) &msr);
- regcache_raw_supply (regcache, tdep->ppc_cr_regnum, (char *) &cr);
- regcache_raw_supply (regcache, tdep->ppc_lr_regnum, (char *) &lr);
- regcache_raw_supply (regcache, tdep->ppc_ctr_regnum, (char *) &ctr);
- regcache_raw_supply (regcache, tdep->ppc_xer_regnum, (char *) &xer);
+ regcache->raw_supply (gdbarch_pc_regnum (gdbarch), (char *) &iar);
+ regcache->raw_supply (tdep->ppc_ps_regnum, (char *) &msr);
+ regcache->raw_supply (tdep->ppc_cr_regnum, (char *) &cr);
+ regcache->raw_supply (tdep->ppc_lr_regnum, (char *) &lr);
+ regcache->raw_supply (tdep->ppc_ctr_regnum, (char *) &ctr);
+ regcache->raw_supply (tdep->ppc_xer_regnum, (char *) &xer);
if (tdep->ppc_fpscr_regnum >= 0)
- regcache_raw_supply (regcache, tdep->ppc_fpscr_regnum,
- (char *) &fpscr);
+ regcache->raw_supply (tdep->ppc_fpscr_regnum, (char *) &fpscr);
}
/* Fetch all registers from pthread PDTID, which doesn't have a kernel
@@ -1349,8 +1345,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno,
sprs32.pt_fpscr);
if (tdep->ppc_mq_regnum >= 0)
- regcache_raw_supply (regcache, tdep->ppc_mq_regnum,
- (char *) &sprs32.pt_mq);
+ regcache->raw_supply (tdep->ppc_mq_regnum, (char *) &sprs32.pt_mq);
}
}
}
diff --git a/gdb/alpha-bsd-nat.c b/gdb/alpha-bsd-nat.c
index e889d22..7a3fe9b 100644
--- a/gdb/alpha-bsd-nat.c
+++ b/gdb/alpha-bsd-nat.c
@@ -182,12 +182,11 @@ alphabsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
if (pcb->pcb_hw.apcb_ksp == 0)
return 0;
- regcache_raw_supply (regcache, ALPHA_SP_REGNUM, &pcb->pcb_hw.apcb_ksp);
+ regcache->raw_supply (ALPHA_SP_REGNUM, &pcb->pcb_hw.apcb_ksp);
for (regnum = ALPHA_S0_REGNUM; regnum < ALPHA_A0_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum,
- &pcb->pcb_context[regnum - ALPHA_S0_REGNUM]);
- regcache_raw_supply (regcache, ALPHA_RA_REGNUM, &pcb->pcb_context[7]);
+ regcache->raw_supply (regnum, &pcb->pcb_context[regnum - ALPHA_S0_REGNUM]);
+ regcache->raw_supply (ALPHA_RA_REGNUM, &pcb->pcb_context[7]);
return 1;
}
diff --git a/gdb/alpha-nbsd-tdep.c b/gdb/alpha-nbsd-tdep.c
index 970526e..dffab3f 100644
--- a/gdb/alpha-nbsd-tdep.c
+++ b/gdb/alpha-nbsd-tdep.c
@@ -58,11 +58,11 @@ alphanbsd_supply_fpregset (const struct regset *regset,
for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + (i - ALPHA_FP0_REGNUM) * 8);
+ regcache->raw_supply (i, regs + (i - ALPHA_FP0_REGNUM) * 8);
}
if (regnum == ALPHA_FPCR_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, ALPHA_FPCR_REGNUM, regs + 32 * 8);
+ regcache->raw_supply (ALPHA_FPCR_REGNUM, regs + 32 * 8);
}
/* Supply register REGNUM from the buffer specified by GREGS and LEN
@@ -95,11 +95,11 @@ alphanbsd_aout_supply_gregset (const struct regset *regset,
for (i = 0; i < ARRAY_SIZE(regmap); i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + regmap[i] * 8);
+ regcache->raw_supply (i, regs + regmap[i] * 8);
}
if (regnum == ALPHA_PC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, ALPHA_PC_REGNUM, regs + 31 * 8);
+ regcache->raw_supply (ALPHA_PC_REGNUM, regs + 31 * 8);
if (len >= ALPHANBSD_SIZEOF_GREGS + ALPHANBSD_SIZEOF_FPREGS)
{
@@ -130,11 +130,11 @@ alphanbsd_supply_gregset (const struct regset *regset,
for (i = 0; i < ALPHA_ZERO_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * 8);
+ regcache->raw_supply (i, regs + i * 8);
}
if (regnum == ALPHA_PC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, ALPHA_PC_REGNUM, regs + 31 * 8);
+ regcache->raw_supply (ALPHA_PC_REGNUM, regs + 31 * 8);
}
/* NetBSD/alpha register sets. */
diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c
index 408bedc..8ca1e51 100644
--- a/gdb/alpha-tdep.c
+++ b/gdb/alpha-tdep.c
@@ -1499,20 +1499,20 @@ alpha_supply_int_regs (struct regcache *regcache, int regno,
for (i = 0; i < 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_supply (regcache, i, regs + i * 8);
+ regcache->raw_supply (i, regs + i * 8);
if (regno == ALPHA_ZERO_REGNUM || regno == -1)
{
const gdb_byte zero[8] = { 0 };
- regcache_raw_supply (regcache, ALPHA_ZERO_REGNUM, zero);
+ regcache->raw_supply (ALPHA_ZERO_REGNUM, zero);
}
if (regno == ALPHA_PC_REGNUM || regno == -1)
- regcache_raw_supply (regcache, ALPHA_PC_REGNUM, pc);
+ regcache->raw_supply (ALPHA_PC_REGNUM, pc);
if (regno == ALPHA_UNIQUE_REGNUM || regno == -1)
- regcache_raw_supply (regcache, ALPHA_UNIQUE_REGNUM, unique);
+ regcache->raw_supply (ALPHA_UNIQUE_REGNUM, unique);
}
void
@@ -1542,11 +1542,10 @@ alpha_supply_fp_regs (struct regcache *regcache, int regno,
for (i = ALPHA_FP0_REGNUM; i < ALPHA_FP0_REGNUM + 31; ++i)
if (regno == i || regno == -1)
- regcache_raw_supply (regcache, i,
- regs + (i - ALPHA_FP0_REGNUM) * 8);
+ regcache->raw_supply (i, regs + (i - ALPHA_FP0_REGNUM) * 8);
if (regno == ALPHA_FPCR_REGNUM || regno == -1)
- regcache_raw_supply (regcache, ALPHA_FPCR_REGNUM, fpcr);
+ regcache->raw_supply (ALPHA_FPCR_REGNUM, fpcr);
}
void
diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c
index 81ba835..6c46303 100644
--- a/gdb/amd64-bsd-nat.c
+++ b/gdb/amd64-bsd-nat.c
@@ -64,7 +64,7 @@ amd64bsd_fetch_inferior_registers (struct regcache *regcache, int regnum)
if (ptrace (PT_GETFSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1)
perror_with_name (_("Couldn't get segment register fs_base"));
- regcache_raw_supply (regcache, AMD64_FSBASE_REGNUM, &base);
+ regcache->raw_supply (AMD64_FSBASE_REGNUM, &base);
if (regnum != -1)
return;
}
@@ -77,7 +77,7 @@ amd64bsd_fetch_inferior_registers (struct regcache *regcache, int regnum)
if (ptrace (PT_GETGSBASE, pid, (PTRACE_TYPE_ARG3) &base, 0) == -1)
perror_with_name (_("Couldn't get segment register gs_base"));
- regcache_raw_supply (regcache, AMD64_GSBASE_REGNUM, &base);
+ regcache->raw_supply (AMD64_GSBASE_REGNUM, &base);
if (regnum != -1)
return;
}
diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c
index 6e0a1f9..6b0367b 100644
--- a/gdb/amd64-fbsd-nat.c
+++ b/gdb/amd64-fbsd-nat.c
@@ -131,24 +131,24 @@ amd64fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
return 0;
pcb->pcb_rsp += 8;
- regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &pcb->pcb_rip);
- regcache_raw_supply (regcache, AMD64_RBX_REGNUM, &pcb->pcb_rbx);
- regcache_raw_supply (regcache, AMD64_RSP_REGNUM, &pcb->pcb_rsp);
- regcache_raw_supply (regcache, AMD64_RBP_REGNUM, &pcb->pcb_rbp);
- regcache_raw_supply (regcache, 12, &pcb->pcb_r12);
- regcache_raw_supply (regcache, 13, &pcb->pcb_r13);
- regcache_raw_supply (regcache, 14, &pcb->pcb_r14);
- regcache_raw_supply (regcache, 15, &pcb->pcb_r15);
+ regcache->raw_supply (AMD64_RIP_REGNUM, &pcb->pcb_rip);
+ regcache->raw_supply (AMD64_RBX_REGNUM, &pcb->pcb_rbx);
+ regcache->raw_supply (AMD64_RSP_REGNUM, &pcb->pcb_rsp);
+ regcache->raw_supply (AMD64_RBP_REGNUM, &pcb->pcb_rbp);
+ regcache->raw_supply (12, &pcb->pcb_r12);
+ regcache->raw_supply (13, &pcb->pcb_r13);
+ regcache->raw_supply (14, &pcb->pcb_r14);
+ regcache->raw_supply (15, &pcb->pcb_r15);
#if (__FreeBSD_version < 800075) && (__FreeBSD_kernel_version < 800075)
/* struct pcb provides the pcb_ds/pcb_es/pcb_fs/pcb_gs fields only
up until __FreeBSD_version 800074: The removal of these fields
occurred on 2009-04-01 while the __FreeBSD_version number was
bumped to 800075 on 2009-04-06. So 800075 is the closest version
number where we should not try to access these fields. */
- regcache_raw_supply (regcache, AMD64_DS_REGNUM, &pcb->pcb_ds);
- regcache_raw_supply (regcache, AMD64_ES_REGNUM, &pcb->pcb_es);
- regcache_raw_supply (regcache, AMD64_FS_REGNUM, &pcb->pcb_fs);
- regcache_raw_supply (regcache, AMD64_GS_REGNUM, &pcb->pcb_gs);
+ regcache->raw_supply (AMD64_DS_REGNUM, &pcb->pcb_ds);
+ regcache->raw_supply (AMD64_ES_REGNUM, &pcb->pcb_es);
+ regcache->raw_supply (AMD64_FS_REGNUM, &pcb->pcb_fs);
+ regcache->raw_supply (AMD64_GS_REGNUM, &pcb->pcb_gs);
#endif
return 1;
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 17de388..623a90e 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -200,7 +200,7 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
if (ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_GET_FS) < 0)
perror_with_name (_("Couldn't get segment register fs_base"));
- regcache_raw_supply (regcache, AMD64_FSBASE_REGNUM, &base);
+ regcache->raw_supply (AMD64_FSBASE_REGNUM, &base);
}
if (regnum == -1 || regnum == AMD64_GSBASE_REGNUM)
@@ -208,7 +208,7 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
if (ptrace (PTRACE_ARCH_PRCTL, tid, &base, ARCH_GET_GS) < 0)
perror_with_name (_("Couldn't get segment register gs_base"));
- regcache_raw_supply (regcache, AMD64_GSBASE_REGNUM, &base);
+ regcache->raw_supply (AMD64_GSBASE_REGNUM, &base);
}
}
#endif
diff --git a/gdb/amd64-nat.c b/gdb/amd64-nat.c
index 12d364a..5dde69c 100644
--- a/gdb/amd64-nat.c
+++ b/gdb/amd64-nat.c
@@ -113,7 +113,7 @@ amd64_supply_native_gregset (struct regcache *regcache,
int offset = amd64_native_gregset_reg_offset (gdbarch, i);
if (offset != -1)
- regcache_raw_supply (regcache, i, regs + offset);
+ regcache->raw_supply (i, regs + offset);
}
}
}
diff --git a/gdb/amd64-obsd-nat.c b/gdb/amd64-obsd-nat.c
index 0e89e3f..c0d6a33 100644
--- a/gdb/amd64-obsd-nat.c
+++ b/gdb/amd64-obsd-nat.c
@@ -106,22 +106,22 @@ amd64obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
{
/* Yes, we have a frame that matches cpu_switch(). */
pcb->pcb_rsp += sizeof (struct switchframe);
- regcache_raw_supply (regcache, 12, &sf.sf_r12);
- regcache_raw_supply (regcache, 13, &sf.sf_r13);
- regcache_raw_supply (regcache, 14, &sf.sf_r14);
- regcache_raw_supply (regcache, 15, &sf.sf_r15);
- regcache_raw_supply (regcache, AMD64_RBX_REGNUM, &sf.sf_rbx);
- regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &sf.sf_rip);
+ regcache->raw_supply (12, &sf.sf_r12);
+ regcache->raw_supply (13, &sf.sf_r13);
+ regcache->raw_supply (14, &sf.sf_r14);
+ regcache->raw_supply (15, &sf.sf_r15);
+ regcache->raw_supply (AMD64_RBX_REGNUM, &sf.sf_rbx);
+ regcache->raw_supply (AMD64_RIP_REGNUM, &sf.sf_rip);
}
else
{
/* No, the pcb must have been last updated by savectx(). */
pcb->pcb_rsp += 8;
- regcache_raw_supply (regcache, AMD64_RIP_REGNUM, &sf);
+ regcache->raw_supply (AMD64_RIP_REGNUM, &sf);
}
- regcache_raw_supply (regcache, AMD64_RSP_REGNUM, &pcb->pcb_rsp);
- regcache_raw_supply (regcache, AMD64_RBP_REGNUM, &pcb->pcb_rbp);
+ regcache->raw_supply (AMD64_RSP_REGNUM, &pcb->pcb_rsp);
+ regcache->raw_supply (AMD64_RBP_REGNUM, &pcb->pcb_rbp);
return 1;
}
diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c
index b1be933..4089200 100644
--- a/gdb/amd64-obsd-tdep.c
+++ b/gdb/amd64-obsd-tdep.c
@@ -241,7 +241,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
returned from _thread_machdep_switch. */
offset = amd64obsd_uthread_reg_offset[AMD64_RIP_REGNUM] + 8;
store_unsigned_integer (buf, 8, byte_order, sp + offset);
- regcache_raw_supply (regcache, AMD64_RSP_REGNUM, buf);
+ regcache->raw_supply (AMD64_RSP_REGNUM, buf);
}
for (i = 0; i < ARRAY_SIZE (amd64obsd_uthread_reg_offset); i++)
@@ -256,7 +256,7 @@ amd64obsd_supply_uthread (struct regcache *regcache,
/* Read the saved register from the stack frame. */
read_memory (sp + amd64obsd_uthread_reg_offset[i], buf, 8);
- regcache_raw_supply (regcache, i, buf);
+ regcache->raw_supply (i, buf);
}
}
}
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 975c907..8b925fd 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -3349,9 +3349,9 @@ amd64_supply_fxsave (struct regcache *regcache, int regnum,
const gdb_byte *regs = (const gdb_byte *) fxsave;
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
- regcache_raw_supply (regcache, I387_FISEG_REGNUM (tdep), regs + 12);
+ regcache->raw_supply (I387_FISEG_REGNUM (tdep), regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
- regcache_raw_supply (regcache, I387_FOSEG_REGNUM (tdep), regs + 20);
+ regcache->raw_supply (I387_FOSEG_REGNUM (tdep), regs + 20);
}
}
@@ -3381,11 +3381,9 @@ amd64_supply_xsave (struct regcache *regcache, int regnum,
if (!(clear_bv & X86_XSTATE_X87))
{
if (regnum == -1 || regnum == I387_FISEG_REGNUM (tdep))
- regcache_raw_supply (regcache, I387_FISEG_REGNUM (tdep),
- regs + 12);
+ regcache->raw_supply (I387_FISEG_REGNUM (tdep), regs + 12);
if (regnum == -1 || regnum == I387_FOSEG_REGNUM (tdep))
- regcache_raw_supply (regcache, I387_FOSEG_REGNUM (tdep),
- regs + 20);
+ regcache->raw_supply (I387_FOSEG_REGNUM (tdep), regs + 20);
}
}
}
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index e3cce49..b3169ca 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -946,7 +946,7 @@ default_guess_tracepoint_registers (struct gdbarch *gdbarch,
regs = (gdb_byte *) alloca (register_size (gdbarch, pc_regno));
store_unsigned_integer (regs, register_size (gdbarch, pc_regno),
gdbarch_byte_order (gdbarch), addr);
- regcache_raw_supply (regcache, pc_regno, regs);
+ regcache->raw_supply (pc_regno, regs);
}
int
diff --git a/gdb/arm-bsd-tdep.c b/gdb/arm-bsd-tdep.c
index 7c820d0..a2719ca 100644
--- a/gdb/arm-bsd-tdep.c
+++ b/gdb/arm-bsd-tdep.c
@@ -58,7 +58,7 @@ armbsd_supply_fpregset (const struct regset *regset,
for (i = ARM_F0_REGNUM; i <= ARM_FPS_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + armbsd_fpreg_offset (i));
+ regcache->raw_supply (i, regs + armbsd_fpreg_offset (i));
}
}
@@ -79,11 +79,11 @@ armbsd_supply_gregset (const struct regset *regset,
for (i = ARM_A1_REGNUM; i <= ARM_PC_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * 4);
+ regcache->raw_supply (i, regs + i * 4);
}
if (regnum == ARM_PS_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, i, regs + 16 * 4);
+ regcache->raw_supply (i, regs + 16 * 4);
if (len >= ARMBSD_SIZEOF_GREGS + ARMBSD_SIZEOF_FPREGS)
{
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index a1bef7a..163e1be 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -138,8 +138,7 @@ fetch_fpregs (struct regcache *regcache)
perror_with_name (_("Unable to fetch the floating point registers."));
/* Fetch fpsr. */
- regcache_raw_supply (regcache, ARM_FPS_REGNUM,
- fp + NWFPE_FPSR_OFFSET);
+ regcache->raw_supply (ARM_FPS_REGNUM, fp + NWFPE_FPSR_OFFSET);
/* Fetch the floating point registers. */
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
@@ -292,16 +291,15 @@ fetch_wmmx_regs (struct regcache *regcache)
perror_with_name (_("Unable to fetch WMMX registers."));
for (regno = 0; regno < 16; regno++)
- regcache_raw_supply (regcache, regno + ARM_WR0_REGNUM,
- ®buf[regno * 8]);
+ regcache->raw_supply (regno + ARM_WR0_REGNUM, ®buf[regno * 8]);
for (regno = 0; regno < 2; regno++)
- regcache_raw_supply (regcache, regno + ARM_WCSSF_REGNUM,
- ®buf[16 * 8 + regno * 4]);
+ regcache->raw_supply (regno + ARM_WCSSF_REGNUM,
+ ®buf[16 * 8 + regno * 4]);
for (regno = 0; regno < 4; regno++)
- regcache_raw_supply (regcache, regno + ARM_WCGR0_REGNUM,
- ®buf[16 * 8 + 2 * 4 + regno * 4]);
+ regcache->raw_supply (regno + ARM_WCGR0_REGNUM,
+ ®buf[16 * 8 + 2 * 4 + regno * 4]);
}
static void
diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c
index e8f8c4e..d8a8347 100644
--- a/gdb/arm-linux-tdep.c
+++ b/gdb/arm-linux-tdep.c
@@ -487,16 +487,15 @@ arm_linux_supply_gregset (const struct regset *regset,
for (regno = ARM_A1_REGNUM; regno < ARM_PC_REGNUM; regno++)
if (regnum == -1 || regnum == regno)
- regcache_raw_supply (regcache, regno,
- gregs + INT_REGISTER_SIZE * regno);
+ regcache->raw_supply (regno, gregs + INT_REGISTER_SIZE * regno);
if (regnum == ARM_PS_REGNUM || regnum == -1)
{
if (arm_apcs_32)
- regcache_raw_supply (regcache, ARM_PS_REGNUM,
- gregs + INT_REGISTER_SIZE * ARM_CPSR_GREGNUM);
+ regcache->raw_supply (ARM_PS_REGNUM,
+ gregs + INT_REGISTER_SIZE * ARM_CPSR_GREGNUM);
else
- regcache_raw_supply (regcache, ARM_PS_REGNUM,
+ regcache->raw_supply (ARM_PS_REGNUM,
gregs + INT_REGISTER_SIZE * ARM_PC_REGNUM);
}
@@ -507,7 +506,7 @@ arm_linux_supply_gregset (const struct regset *regset,
INT_REGISTER_SIZE, byte_order);
reg_pc = gdbarch_addr_bits_remove (gdbarch, reg_pc);
store_unsigned_integer (pc_buf, INT_REGISTER_SIZE, byte_order, reg_pc);
- regcache_raw_supply (regcache, ARM_PC_REGNUM, pc_buf);
+ regcache->raw_supply (ARM_PC_REGNUM, pc_buf);
}
}
@@ -578,7 +577,7 @@ supply_nwfpe_register (struct regcache *regcache, int regno,
break;
}
- regcache_raw_supply (regcache, regno, buf);
+ regcache->raw_supply (regno, buf);
}
void
@@ -627,7 +626,7 @@ arm_linux_supply_nwfpe (const struct regset *regset,
int regno;
if (regnum == ARM_FPS_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, ARM_FPS_REGNUM,
+ regcache->raw_supply (ARM_FPS_REGNUM,
regs + NWFPE_FPSR_OFFSET);
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
@@ -665,12 +664,11 @@ arm_linux_supply_vfp (const struct regset *regset,
int regno;
if (regnum == ARM_FPSCR_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, ARM_FPSCR_REGNUM, regs + 32 * 8);
+ regcache->raw_supply (ARM_FPSCR_REGNUM, regs + 32 * 8);
for (regno = ARM_D0_REGNUM; regno <= ARM_D31_REGNUM; regno++)
if (regnum == -1 || regnum == regno)
- regcache_raw_supply (regcache, regno,
- regs + (regno - ARM_D0_REGNUM) * 8);
+ regcache->raw_supply (regno, regs + (regno - ARM_D0_REGNUM) * 8);
}
static void
diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c
index 3d64346..a641ccb 100644
--- a/gdb/arm-nbsd-nat.c
+++ b/gdb/arm-nbsd-nat.c
@@ -50,22 +50,18 @@ arm_supply_gregset (struct regcache *regcache, struct reg *gregset)
/* Integer registers. */
for (regno = ARM_A1_REGNUM; regno < ARM_SP_REGNUM; regno++)
- regcache_raw_supply (regcache, regno, (char *) &gregset->r[regno]);
+ regcache->raw_supply (regno, (char *) &gregset->r[regno]);
- regcache_raw_supply (regcache, ARM_SP_REGNUM,
- (char *) &gregset->r_sp);
- regcache_raw_supply (regcache, ARM_LR_REGNUM,
- (char *) &gregset->r_lr);
+ regcache->raw_supply (ARM_SP_REGNUM, (char *) &gregset->r_sp);
+ regcache->raw_supply (ARM_LR_REGNUM, (char *) &gregset->r_lr);
/* This is ok: we're running native... */
r_pc = gdbarch_addr_bits_remove (regcache->arch (), gregset->r_pc);
- regcache_raw_supply (regcache, ARM_PC_REGNUM, (char *) &r_pc);
+ regcache->raw_supply (ARM_PC_REGNUM, (char *) &r_pc);
if (arm_apcs_32)
- regcache_raw_supply (regcache, ARM_PS_REGNUM,
- (char *) &gregset->r_cpsr);
+ regcache->raw_supply (ARM_PS_REGNUM, (char *) &gregset->r_cpsr);
else
- regcache_raw_supply (regcache, ARM_PS_REGNUM,
- (char *) &gregset->r_pc);
+ regcache->raw_supply (ARM_PS_REGNUM, (char *) &gregset->r_pc);
}
static void
@@ -74,11 +70,10 @@ arm_supply_fparegset (struct regcache *regcache, struct fpreg *fparegset)
int regno;
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
- regcache_raw_supply (regcache, regno,
- (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]);
+ regcache->raw_supply (regno,
+ (char *) &fparegset->fpr[regno - ARM_F0_REGNUM]);
- regcache_raw_supply (regcache, ARM_FPS_REGNUM,
- (char *) &fparegset->fpr_fpsr);
+ regcache->raw_supply (ARM_FPS_REGNUM, (char *) &fparegset->fpr_fpsr);
}
static void
@@ -99,13 +94,11 @@ fetch_register (struct regcache *regcache, int regno)
switch (regno)
{
case ARM_SP_REGNUM:
- regcache_raw_supply (regcache, ARM_SP_REGNUM,
- (char *) &inferior_registers.r_sp);
+ regcache->raw_supply (ARM_SP_REGNUM, (char *) &inferior_registers.r_sp);
break;
case ARM_LR_REGNUM:
- regcache_raw_supply (regcache, ARM_LR_REGNUM,
- (char *) &inferior_registers.r_lr);
+ regcache->raw_supply (ARM_LR_REGNUM, (char *) &inferior_registers.r_lr);
break;
case ARM_PC_REGNUM:
@@ -113,22 +106,20 @@ fetch_register (struct regcache *regcache, int regno)
inferior_registers.r_pc = gdbarch_addr_bits_remove
(regcache->arch (),
inferior_registers.r_pc);
- regcache_raw_supply (regcache, ARM_PC_REGNUM,
- (char *) &inferior_registers.r_pc);
+ regcache->raw_supply (ARM_PC_REGNUM, (char *) &inferior_registers.r_pc);
break;
case ARM_PS_REGNUM:
if (arm_apcs_32)
- regcache_raw_supply (regcache, ARM_PS_REGNUM,
- (char *) &inferior_registers.r_cpsr);
+ regcache->raw_supply (ARM_PS_REGNUM,
+ (char *) &inferior_registers.r_cpsr);
else
- regcache_raw_supply (regcache, ARM_PS_REGNUM,
- (char *) &inferior_registers.r_pc);
+ regcache->raw_supply (ARM_PS_REGNUM,
+ (char *) &inferior_registers.r_pc);
break;
default:
- regcache_raw_supply (regcache, regno,
- (char *) &inferior_registers.r[regno]);
+ regcache->raw_supply (regno, (char *) &inferior_registers.r[regno]);
break;
}
}
@@ -170,13 +161,13 @@ fetch_fp_register (struct regcache *regcache, int regno)
switch (regno)
{
case ARM_FPS_REGNUM:
- regcache_raw_supply (regcache, ARM_FPS_REGNUM,
- (char *) &inferior_fp_registers.fpr_fpsr);
+ regcache->raw_supply (ARM_FPS_REGNUM,
+ (char *) &inferior_fp_registers.fpr_fpsr);
break;
default:
- regcache_raw_supply (regcache, regno,
- (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
+ regcache->raw_supply
+ (regno, (char *) &inferior_fp_registers.fpr[regno - ARM_F0_REGNUM]);
break;
}
}
diff --git a/gdb/corelow.c b/gdb/corelow.c
index 0a7d742..a816395 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -705,7 +705,7 @@ core_target::fetch_registers (struct regcache *regcache, int regno)
/* Mark all registers not found in the core as unavailable. */
for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
if (regcache->get_register_status (i) == REG_UNKNOWN)
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
}
void
diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c
index a0fb3b2..e0371a2 100644
--- a/gdb/cris-tdep.c
+++ b/gdb/cris-tdep.c
@@ -3809,7 +3809,7 @@ cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
knows about the actual size of each register so that's no problem. */
for (i = 0; i < NUM_GENREGS + NUM_SPECREGS; i++)
{
- regcache_raw_supply (regcache, i, (char *)®p[i]);
+ regcache->raw_supply (i, (char *)®p[i]);
}
if (tdep->cris_version == 32)
@@ -3817,8 +3817,8 @@ cris_supply_gregset (struct regcache *regcache, cris_elf_gregset_t *gregsetp)
/* Needed to set pseudo-register PC for CRISv32. */
/* FIXME: If ERP is in a delay slot at this point then the PC will
be wrong. Issue a warning to alert the user. */
- regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch),
- (char *)®p[ERP_REGNUM]);
+ regcache->raw_supply (gdbarch_pc_regnum (gdbarch),
+ (char *)®p[ERP_REGNUM]);
if (*(char *)®p[ERP_REGNUM] & 0x1)
fprintf_unfiltered (gdb_stderr, "Warning: PC in delay slot\n");
diff --git a/gdb/ctf.c b/gdb/ctf.c
index 1ab095d..7e22074 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1266,12 +1266,12 @@ ctf_target::fetch_registers (struct regcache *regcache, int regno)
{
if (regno == regn)
{
- regcache_raw_supply (regcache, regno, regs + offset);
+ regcache->raw_supply (regno, regs + offset);
break;
}
else if (regno == -1)
{
- regcache_raw_supply (regcache, regn, regs + offset);
+ regcache->raw_supply (regn, regs + offset);
}
}
offset += regsize;
diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
index 980180b..a2affe1 100644
--- a/gdb/go32-nat.c
+++ b/gdb/go32-nat.c
@@ -541,8 +541,8 @@ fetch_register (struct regcache *regcache, int regno)
{
struct gdbarch *gdbarch = regcache->arch ();
if (regno < gdbarch_fp0_regnum (gdbarch))
- regcache_raw_supply (regcache, regno,
- (char *) &a_tss + regno_mapping[regno].tss_ofs);
+ regcache->raw_supply (regno,
+ (char *) &a_tss + regno_mapping[regno].tss_ofs);
else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch,
regno))
i387_supply_fsave (regcache, regno, &npx);
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
index 39ae83f..7dea079 100644
--- a/gdb/hppa-linux-nat.c
+++ b/gdb/hppa-linux-nat.c
@@ -229,7 +229,7 @@ fetch_register (struct regcache *regcache, int regno)
if (gdbarch_cannot_fetch_register (gdbarch, regno))
{
- regcache_raw_supply (regcache, regno, NULL);
+ regcache->raw_supply (regno, NULL);
return;
}
@@ -242,7 +242,7 @@ fetch_register (struct regcache *regcache, int regno)
gdbarch_register_name (gdbarch, regno),
regno, safe_strerror (errno));
- regcache_raw_supply (regcache, regno, &val);
+ regcache->raw_supply (regno, &val);
}
/* Store one register. */
@@ -321,7 +321,7 @@ supply_gregset (struct regcache *regcache, const gdb_gregset_t *gregsetp)
for (i = 0; i < sizeof (greg_map) / sizeof (greg_map[0]); i++, regp++)
{
int regno = greg_map[i];
- regcache_raw_supply (regcache, regno, regp);
+ regcache->raw_supply (regno, regp);
}
}
@@ -359,8 +359,8 @@ supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp)
for (regi = 0; regi <= 31; regi++)
{
from = (const char *) &((*fpregsetp)[regi]);
- regcache_raw_supply (regcache, 2*regi + HPPA_FP0_REGNUM, from);
- regcache_raw_supply (regcache, 2*regi + HPPA_FP0_REGNUM + 1, from + 4);
+ regcache->raw_supply (2*regi + HPPA_FP0_REGNUM, from);
+ regcache->raw_supply (2*regi + HPPA_FP0_REGNUM + 1, from + 4);
}
}
diff --git a/gdb/hppa-nbsd-nat.c b/gdb/hppa-nbsd-nat.c
index 2ffa5bc..99dfd32 100644
--- a/gdb/hppa-nbsd-nat.c
+++ b/gdb/hppa-nbsd-nat.c
@@ -63,19 +63,19 @@ hppanbsd_supply_gregset (struct regcache *regcache, const void *gregs)
int regnum;
for (regnum = HPPA_R1_REGNUM; regnum <= HPPA_R31_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, regs + regnum * 4);
-
- regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs + 32 * 4);
- regcache_raw_supply (regcache, HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
- regcache_raw_supply (regcache, HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
- regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
- regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
- regcache_raw_supply (regcache, HPPA_IPSW_REGNUM, regs);
- regcache_raw_supply (regcache, HPPA_SR4_REGNUM, regs + 41 * 4);
- regcache_raw_supply (regcache, HPPA_SR4_REGNUM + 1, regs + 37 * 4);
- regcache_raw_supply (regcache, HPPA_SR4_REGNUM + 2, regs + 38 * 4);
- regcache_raw_supply (regcache, HPPA_SR4_REGNUM + 3, regs + 39 * 4);
- regcache_raw_supply (regcache, HPPA_SR4_REGNUM + 4, regs + 40 * 4);
+ regcache->raw_supply (regnum, regs + regnum * 4);
+
+ regcache->raw_supply (HPPA_SAR_REGNUM, regs + 32 * 4);
+ regcache->raw_supply (HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
+ regcache->raw_supply (HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
+ regcache->raw_supply (HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
+ regcache->raw_supply (HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
+ regcache->raw_supply (HPPA_IPSW_REGNUM, regs);
+ regcache->raw_supply (HPPA_SR4_REGNUM, regs + 41 * 4);
+ regcache->raw_supply (HPPA_SR4_REGNUM + 1, regs + 37 * 4);
+ regcache->raw_supply (HPPA_SR4_REGNUM + 2, regs + 38 * 4);
+ regcache->raw_supply (HPPA_SR4_REGNUM + 3, regs + 39 * 4);
+ regcache->raw_supply (HPPA_SR4_REGNUM + 4, regs + 40 * 4);
}
/* Supply the floating-point registers stored in FPREGS to REGCACHE. */
@@ -89,8 +89,8 @@ hppanbsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
for (regnum = HPPA_FP0_REGNUM; regnum <= HPPA_FP31R_REGNUM;
regnum += 2, regs += 8)
{
- regcache_raw_supply (regcache, regnum, regs);
- regcache_raw_supply (regcache, regnum + 1, regs + 4);
+ regcache->raw_supply (regnum, regs);
+ regcache->raw_supply (regnum + 1, regs + 4);
}
}
diff --git a/gdb/hppa-nbsd-tdep.c b/gdb/hppa-nbsd-tdep.c
index 05249b6..f9932b5 100644
--- a/gdb/hppa-nbsd-tdep.c
+++ b/gdb/hppa-nbsd-tdep.c
@@ -171,7 +171,7 @@ hppanbsd_supply_gregset (const struct regset *regset,
for (i = 0; i < ARRAY_SIZE (hppanbsd_reg_offset); i++)
if (hppanbsd_reg_offset[i] != -1)
if (regnum == -1 || regnum == i)
- regcache_raw_supply (regcache, i, regs + hppanbsd_reg_offset[i]);
+ regcache->raw_supply (i, regs + hppanbsd_reg_offset[i]);
}
/* NetBSD/hppa register set. */
diff --git a/gdb/hppa-obsd-nat.c b/gdb/hppa-obsd-nat.c
index 2ef2f7e..53880f6 100644
--- a/gdb/hppa-obsd-nat.c
+++ b/gdb/hppa-obsd-nat.c
@@ -60,34 +60,34 @@ hppaobsd_supply_gregset (struct regcache *regcache, const void *gregs)
const char *regs = gregs;
int regnum;
- regcache_raw_supply (regcache, HPPA_R0_REGNUM, &zero);
+ regcache->raw_supply (HPPA_R0_REGNUM, &zero);
for (regnum = HPPA_R1_REGNUM; regnum <= HPPA_R31_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, regs + regnum * 4);
+ regcache->raw_supply (regnum, regs + regnum * 4);
if (sizeof(struct reg) >= 46 * 4)
{
- regcache_raw_supply (regcache, HPPA_IPSW_REGNUM, regs);
- regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs + 32 * 4);
- regcache_raw_supply (regcache, HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
- regcache_raw_supply (regcache, HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
- regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
- regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
- regcache_raw_supply (regcache, HPPA_SR0_REGNUM, regs + 37 * 4);
- regcache_raw_supply (regcache, HPPA_SR1_REGNUM, regs + 38 * 4);
- regcache_raw_supply (regcache, HPPA_SR2_REGNUM, regs + 39 * 4);
- regcache_raw_supply (regcache, HPPA_SR3_REGNUM, regs + 40 * 4);
- regcache_raw_supply (regcache, HPPA_SR4_REGNUM, regs + 41 * 4);
- regcache_raw_supply (regcache, HPPA_SR5_REGNUM, regs + 42 * 4);
- regcache_raw_supply (regcache, HPPA_SR6_REGNUM, regs + 43 * 4);
- regcache_raw_supply (regcache, HPPA_SR7_REGNUM, regs + 44 * 4);
- regcache_raw_supply (regcache, HPPA_CR26_REGNUM, regs + 45 * 4);
- regcache_raw_supply (regcache, HPPA_CR27_REGNUM, regs + 46 * 4);
+ regcache->raw_supply (HPPA_IPSW_REGNUM, regs);
+ regcache->raw_supply (HPPA_SAR_REGNUM, regs + 32 * 4);
+ regcache->raw_supply (HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
+ regcache->raw_supply (HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
+ regcache->raw_supply (HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
+ regcache->raw_supply (HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
+ regcache->raw_supply (HPPA_SR0_REGNUM, regs + 37 * 4);
+ regcache->raw_supply (HPPA_SR1_REGNUM, regs + 38 * 4);
+ regcache->raw_supply (HPPA_SR2_REGNUM, regs + 39 * 4);
+ regcache->raw_supply (HPPA_SR3_REGNUM, regs + 40 * 4);
+ regcache->raw_supply (HPPA_SR4_REGNUM, regs + 41 * 4);
+ regcache->raw_supply (HPPA_SR5_REGNUM, regs + 42 * 4);
+ regcache->raw_supply (HPPA_SR6_REGNUM, regs + 43 * 4);
+ regcache->raw_supply (HPPA_SR7_REGNUM, regs + 44 * 4);
+ regcache->raw_supply (HPPA_CR26_REGNUM, regs + 45 * 4);
+ regcache->raw_supply (HPPA_CR27_REGNUM, regs + 46 * 4);
}
else
{
- regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs);
- regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
- regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
+ regcache->raw_supply (HPPA_SAR_REGNUM, regs);
+ regcache->raw_supply (HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
+ regcache->raw_supply (HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
}
}
@@ -102,8 +102,8 @@ hppaobsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
for (regnum = HPPA_FP0_REGNUM; regnum <= HPPA_FP31R_REGNUM;
regnum += 2, regs += 8)
{
- regcache_raw_supply (regcache, regnum, regs);
- regcache_raw_supply (regcache, regnum + 1, regs + 4);
+ regcache->raw_supply (regnum, regs);
+ regcache->raw_supply (regnum + 1, regs + 4);
}
}
diff --git a/gdb/hppa-obsd-tdep.c b/gdb/hppa-obsd-tdep.c
index 974a072..403e9dd 100644
--- a/gdb/hppa-obsd-tdep.c
+++ b/gdb/hppa-obsd-tdep.c
@@ -51,56 +51,56 @@ hppaobsd_supply_gregset (const struct regset *regset,
gdb_assert (len >= HPPAOBSD_SIZEOF_GREGS);
if (regnum == -1 || regnum == HPPA_R0_REGNUM)
- regcache_raw_supply (regcache, HPPA_R0_REGNUM, &zero);
+ regcache->raw_supply (HPPA_R0_REGNUM, &zero);
for (i = HPPA_R1_REGNUM, offset = 4; i <= HPPA_R31_REGNUM; i++, offset += 4)
{
if (regnum == -1 || regnum == i)
- regcache_raw_supply (regcache, i, regs + offset);
+ regcache->raw_supply (i, regs + offset);
}
if (len >= HPPANBSD_SIZEOF_GREGS)
{
if (regnum == -1 || regnum == HPPA_IPSW_REGNUM)
- regcache_raw_supply (regcache, HPPA_IPSW_REGNUM, regs);
+ regcache->raw_supply (HPPA_IPSW_REGNUM, regs);
if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
- regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs + 32 * 4);
+ regcache->raw_supply (HPPA_SAR_REGNUM, regs + 32 * 4);
if (regnum == -1 || regnum == HPPA_PCSQ_HEAD_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
+ regcache->raw_supply (HPPA_PCSQ_HEAD_REGNUM, regs + 33 * 4);
if (regnum == -1 || regnum == HPPA_PCSQ_TAIL_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
+ regcache->raw_supply (HPPA_PCSQ_TAIL_REGNUM, regs + 34 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
+ regcache->raw_supply (HPPA_PCOQ_HEAD_REGNUM, regs + 35 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
+ regcache->raw_supply (HPPA_PCOQ_TAIL_REGNUM, regs + 36 * 4);
if (regnum == -1 || regnum == HPPA_SR0_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR0_REGNUM, regs + 37 * 4);
+ regcache->raw_supply (HPPA_SR0_REGNUM, regs + 37 * 4);
if (regnum == -1 || regnum == HPPA_SR1_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR1_REGNUM, regs + 38 * 4);
+ regcache->raw_supply (HPPA_SR1_REGNUM, regs + 38 * 4);
if (regnum == -1 || regnum == HPPA_SR2_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR2_REGNUM, regs + 39 * 4);
+ regcache->raw_supply (HPPA_SR2_REGNUM, regs + 39 * 4);
if (regnum == -1 || regnum == HPPA_SR3_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR3_REGNUM, regs + 40 * 4);
+ regcache->raw_supply (HPPA_SR3_REGNUM, regs + 40 * 4);
if (regnum == -1 || regnum == HPPA_SR4_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR4_REGNUM, regs + 41 * 4);
+ regcache->raw_supply (HPPA_SR4_REGNUM, regs + 41 * 4);
if (regnum == -1 || regnum == HPPA_SR5_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR5_REGNUM, regs + 42 * 4);
+ regcache->raw_supply (HPPA_SR5_REGNUM, regs + 42 * 4);
if (regnum == -1 || regnum == HPPA_SR6_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR6_REGNUM, regs + 43 * 4);
+ regcache->raw_supply (HPPA_SR6_REGNUM, regs + 43 * 4);
if (regnum == -1 || regnum == HPPA_SR7_REGNUM)
- regcache_raw_supply (regcache, HPPA_SR7_REGNUM, regs + 44 * 4);
+ regcache->raw_supply (HPPA_SR7_REGNUM, regs + 44 * 4);
if (regnum == -1 || regnum == HPPA_CR26_REGNUM)
- regcache_raw_supply (regcache, HPPA_CR26_REGNUM, regs + 45 * 4);
+ regcache->raw_supply (HPPA_CR26_REGNUM, regs + 45 * 4);
if (regnum == -1 || regnum == HPPA_CR27_REGNUM)
- regcache_raw_supply (regcache, HPPA_CR27_REGNUM, regs + 46 * 4);
+ regcache->raw_supply (HPPA_CR27_REGNUM, regs + 46 * 4);
}
else
{
if (regnum == -1 || regnum == HPPA_SAR_REGNUM)
- regcache_raw_supply (regcache, HPPA_SAR_REGNUM, regs);
+ regcache->raw_supply (HPPA_SAR_REGNUM, regs);
if (regnum == -1 || regnum == HPPA_PCOQ_HEAD_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
+ regcache->raw_supply (HPPA_PCOQ_HEAD_REGNUM, regs + 32 * 4);
if (regnum == -1 || regnum == HPPA_PCOQ_TAIL_REGNUM)
- regcache_raw_supply (regcache, HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
+ regcache->raw_supply (HPPA_PCOQ_TAIL_REGNUM, regs + 33 * 4);
}
}
@@ -121,7 +121,7 @@ hppaobsd_supply_fpregset (const struct regset *regset,
for (i = HPPA_FP0_REGNUM; i <= HPPA_FP31R_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + (i - HPPA_FP0_REGNUM) * 4);
+ regcache->raw_supply (i, regs + (i - HPPA_FP0_REGNUM) * 4);
}
}
diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c
index cca4629..2753366 100644
--- a/gdb/i386-bsd-nat.c
+++ b/gdb/i386-bsd-nat.c
@@ -97,7 +97,7 @@ i386bsd_supply_gregset (struct regcache *regcache, const void *gregs)
int offset = i386bsd_r_reg_offset[regnum];
if (offset != -1)
- regcache_raw_supply (regcache, regnum, regs + offset);
+ regcache->raw_supply (regnum, regs + offset);
}
}
diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c
index 03adb20..2dbf95f 100644
--- a/gdb/i386-darwin-nat.c
+++ b/gdb/i386-darwin-nat.c
@@ -132,9 +132,8 @@ i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno)
MACH_CHECK_ERROR (ret);
}
for (i = 0; i < I386_NUM_GREGS; i++)
- regcache_raw_supply
- (regcache, i,
- (char *)&gp_regs + i386_darwin_thread_state_reg_offset[i]);
+ regcache->raw_supply
+ (i, (char *) &gp_regs + i386_darwin_thread_state_reg_offset[i]);
fetched++;
}
@@ -164,7 +163,7 @@ i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno)
if (! fetched)
{
warning (_("unknown register %d"), regno);
- regcache_raw_supply (regcache, regno, NULL);
+ regcache->raw_supply (regno, NULL);
}
}
diff --git a/gdb/i386-fbsd-nat.c b/gdb/i386-fbsd-nat.c
index 0d3762a..46f9a86 100644
--- a/gdb/i386-fbsd-nat.c
+++ b/gdb/i386-fbsd-nat.c
@@ -123,13 +123,13 @@ i386fbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
return 0;
pcb->pcb_esp += 4;
- regcache_raw_supply (regcache, I386_EDI_REGNUM, &pcb->pcb_edi);
- regcache_raw_supply (regcache, I386_ESI_REGNUM, &pcb->pcb_esi);
- regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp);
- regcache_raw_supply (regcache, I386_ESP_REGNUM, &pcb->pcb_esp);
- regcache_raw_supply (regcache, I386_EBX_REGNUM, &pcb->pcb_ebx);
- regcache_raw_supply (regcache, I386_EIP_REGNUM, &pcb->pcb_eip);
- regcache_raw_supply (regcache, I386_GS_REGNUM, &pcb->pcb_gs);
+ regcache->raw_supply (I386_EDI_REGNUM, &pcb->pcb_edi);
+ regcache->raw_supply (I386_ESI_REGNUM, &pcb->pcb_esi);
+ regcache->raw_supply (I386_EBP_REGNUM, &pcb->pcb_ebp);
+ regcache->raw_supply (I386_ESP_REGNUM, &pcb->pcb_esp);
+ regcache->raw_supply (I386_EBX_REGNUM, &pcb->pcb_ebx);
+ regcache->raw_supply (I386_EIP_REGNUM, &pcb->pcb_eip);
+ regcache->raw_supply (I386_GS_REGNUM, &pcb->pcb_gs);
return 1;
}
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index a738308..1acfc07 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -138,7 +138,7 @@ gnu_fetch_registers (struct target_ops *ops,
proc_debug (thread, "fetching all register");
for (i = 0; i < I386_NUM_GREGS; i++)
- regcache_raw_supply (regcache, i, REG_ADDR (state, i));
+ regcache->raw_supply (i, REG_ADDR (state, i));
thread->fetched_regs = ~0;
}
else
@@ -147,8 +147,7 @@ gnu_fetch_registers (struct target_ops *ops,
gdbarch_register_name (regcache->arch (),
regno));
- regcache_raw_supply (regcache, regno,
- REG_ADDR (state, regno));
+ regcache->raw_supply (regno, REG_ADDR (state, regno));
thread->fetched_regs |= (1 << regno);
}
}
@@ -250,8 +249,8 @@ gnu_store_registers (struct target_ops *ops,
gdbarch_register_name (gdbarch, check_regno));
if (regno >= 0 && regno != check_regno)
/* Update GDB's copy of the register. */
- regcache_raw_supply (regcache, check_regno,
- REG_ADDR (state, check_regno));
+ regcache->raw_supply (check_regno,
+ REG_ADDR (state, check_regno));
else
warning (_("... also writing this register! "
"Suspicious..."));
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 054638b..1d8483a 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -112,7 +112,7 @@ fetch_register (struct regcache *regcache, int regno)
gdb_assert (!have_ptrace_getregs);
if (i386_linux_gregset_reg_offset[regno] == -1)
{
- regcache_raw_supply (regcache, regno, NULL);
+ regcache->raw_supply (regno, NULL);
return;
}
@@ -126,7 +126,7 @@ fetch_register (struct regcache *regcache, int regno)
gdbarch_register_name (regcache->arch (), regno),
regno, safe_strerror (errno));
- regcache_raw_supply (regcache, regno, &val);
+ regcache->raw_supply (regno, &val);
}
/* Store one register. */
@@ -167,13 +167,13 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
int i;
for (i = 0; i < I386_NUM_GREGS; i++)
- regcache_raw_supply (regcache, i,
- regp + i386_linux_gregset_reg_offset[i]);
+ regcache->raw_supply (i, regp + i386_linux_gregset_reg_offset[i]);
if (I386_LINUX_ORIG_EAX_REGNUM
< gdbarch_num_regs (regcache->arch ()))
- regcache_raw_supply (regcache, I386_LINUX_ORIG_EAX_REGNUM, regp
- + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
+ regcache->raw_supply
+ (I386_LINUX_ORIG_EAX_REGNUM,
+ regp + i386_linux_gregset_reg_offset[I386_LINUX_ORIG_EAX_REGNUM]);
}
/* Fill register REGNO (if it is a general-purpose register) in
diff --git a/gdb/i386-nbsd-nat.c b/gdb/i386-nbsd-nat.c
index bc875e0..dd1ac29 100644
--- a/gdb/i386-nbsd-nat.c
+++ b/gdb/i386-nbsd-nat.c
@@ -61,12 +61,12 @@ i386nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
read_memory (pcb->pcb_esp, (gdb_byte *)&sf, sizeof sf);
pcb->pcb_esp += sizeof (struct switchframe);
- regcache_raw_supply (regcache, I386_EDI_REGNUM, &sf.sf_edi);
- regcache_raw_supply (regcache, I386_ESI_REGNUM, &sf.sf_esi);
- regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp);
- regcache_raw_supply (regcache, I386_ESP_REGNUM, &pcb->pcb_esp);
- regcache_raw_supply (regcache, I386_EBX_REGNUM, &sf.sf_ebx);
- regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip);
+ regcache->raw_supply (I386_EDI_REGNUM, &sf.sf_edi);
+ regcache->raw_supply (I386_ESI_REGNUM, &sf.sf_esi);
+ regcache->raw_supply (I386_EBP_REGNUM, &pcb->pcb_ebp);
+ regcache->raw_supply (I386_ESP_REGNUM, &pcb->pcb_esp);
+ regcache->raw_supply (I386_EBX_REGNUM, &sf.sf_ebx);
+ regcache->raw_supply (I386_EIP_REGNUM, &sf.sf_eip);
return 1;
}
diff --git a/gdb/i386-obsd-nat.c b/gdb/i386-obsd-nat.c
index a3221ed..faae83e 100644
--- a/gdb/i386-obsd-nat.c
+++ b/gdb/i386-obsd-nat.c
@@ -67,10 +67,10 @@ i386obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
/* Yes, we have a frame that matches cpu_switch(). */
read_memory (pcb->pcb_esp, (gdb_byte *) &sf, sizeof sf);
pcb->pcb_esp += sizeof (struct switchframe);
- regcache_raw_supply (regcache, I386_EDI_REGNUM, &sf.sf_edi);
- regcache_raw_supply (regcache, I386_ESI_REGNUM, &sf.sf_esi);
- regcache_raw_supply (regcache, I386_EBX_REGNUM, &sf.sf_ebx);
- regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip);
+ regcache->raw_supply (I386_EDI_REGNUM, &sf.sf_edi);
+ regcache->raw_supply (I386_ESI_REGNUM, &sf.sf_esi);
+ regcache->raw_supply (I386_EBX_REGNUM, &sf.sf_ebx);
+ regcache->raw_supply (I386_EIP_REGNUM, &sf.sf_eip);
}
else
#endif
@@ -79,11 +79,11 @@ i386obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
pcb->pcb_esp = pcb->pcb_ebp;
pcb->pcb_ebp = read_memory_integer(pcb->pcb_esp, 4, byte_order);
sf.sf_eip = read_memory_integer(pcb->pcb_esp + 4, 4, byte_order);
- regcache_raw_supply (regcache, I386_EIP_REGNUM, &sf.sf_eip);
+ regcache->raw_supply (I386_EIP_REGNUM, &sf.sf_eip);
}
- regcache_raw_supply (regcache, I386_EBP_REGNUM, &pcb->pcb_ebp);
- regcache_raw_supply (regcache, I386_ESP_REGNUM, &pcb->pcb_esp);
+ regcache->raw_supply (I386_EBP_REGNUM, &pcb->pcb_ebp);
+ regcache->raw_supply (I386_ESP_REGNUM, &pcb->pcb_esp);
return 1;
}
diff --git a/gdb/i386-obsd-tdep.c b/gdb/i386-obsd-tdep.c
index 1533ed2..da2b88a 100644
--- a/gdb/i386-obsd-tdep.c
+++ b/gdb/i386-obsd-tdep.c
@@ -210,7 +210,7 @@ i386obsd_supply_uthread (struct regcache *regcache,
returned from _thread_machdep_switch. */
offset = i386obsd_uthread_reg_offset[I386_EIP_REGNUM] + 4;
store_unsigned_integer (buf, 4, byte_order, sp + offset);
- regcache_raw_supply (regcache, I386_ESP_REGNUM, buf);
+ regcache->raw_supply (I386_ESP_REGNUM, buf);
}
for (i = 0; i < ARRAY_SIZE (i386obsd_uthread_reg_offset); i++)
@@ -225,7 +225,7 @@ i386obsd_supply_uthread (struct regcache *regcache,
/* Read the saved register from the stack frame. */
read_memory (sp + i386obsd_uthread_reg_offset[i], buf, 4);
- regcache_raw_supply (regcache, i, buf);
+ regcache->raw_supply (i, buf);
}
}
}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 158344f..f535cb3 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -3815,7 +3815,7 @@ i386_supply_gregset (const struct regset *regset, struct regcache *regcache,
{
if ((regnum == i || regnum == -1)
&& tdep->gregset_reg_offset[i] != -1)
- regcache_raw_supply (regcache, i, regs + tdep->gregset_reg_offset[i]);
+ regcache->raw_supply (i, regs + tdep->gregset_reg_offset[i]);
}
}
diff --git a/gdb/i386-v4-nat.c b/gdb/i386-v4-nat.c
index 36e07fa..2313ff8 100644
--- a/gdb/i386-v4-nat.c
+++ b/gdb/i386-v4-nat.c
@@ -107,7 +107,7 @@ supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
int regnum;
for (regnum = 0; regnum < I386_NUM_GREGS; regnum++)
- regcache_raw_supply (regcache, regnum, regp + regmap[regnum]);
+ regcache->raw_supply (regnum, regp + regmap[regnum]);
}
/* Fill register REGNUM (if it is a general-purpose register) in
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index b465fda..b545f74 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -450,7 +450,7 @@ i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
{
if (fsave == NULL)
{
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
continue;
}
@@ -465,22 +465,22 @@ i387_supply_fsave (struct regcache *regcache, int regnum, const void *fsave)
val[2] = val[3] = 0;
if (i == I387_FOP_REGNUM (tdep))
val[1] &= ((1 << 3) - 1);
- regcache_raw_supply (regcache, i, val);
+ regcache->raw_supply (i, val);
}
else
- regcache_raw_supply (regcache, i, FSAVE_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, FSAVE_ADDR (tdep, regs, i));
}
/* Provide dummy values for the SSE registers. */
for (i = I387_XMM0_REGNUM (tdep); i < I387_MXCSR_REGNUM (tdep); i++)
if (regnum == -1 || regnum == i)
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
if (regnum == -1 || regnum == I387_MXCSR_REGNUM (tdep))
{
gdb_byte buf[4];
store_unsigned_integer (buf, 4, byte_order, I387_MXCSR_INIT_VAL);
- regcache_raw_supply (regcache, I387_MXCSR_REGNUM (tdep), buf);
+ regcache->raw_supply (I387_MXCSR_REGNUM (tdep), buf);
}
}
@@ -597,7 +597,7 @@ i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
{
if (regs == NULL)
{
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
continue;
}
@@ -644,18 +644,18 @@ i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave)
val[0] = ftag & 0xff;
val[1] = (ftag >> 8) & 0xff;
}
- regcache_raw_supply (regcache, i, val);
+ regcache->raw_supply (i, val);
}
else
- regcache_raw_supply (regcache, i, FXSAVE_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, FXSAVE_ADDR (tdep, regs, i));
}
if (regnum == I387_MXCSR_REGNUM (tdep) || regnum == -1)
{
if (regs == NULL)
- regcache_raw_supply (regcache, I387_MXCSR_REGNUM (tdep), NULL);
+ regcache->raw_supply (I387_MXCSR_REGNUM (tdep), NULL);
else
- regcache_raw_supply (regcache, I387_MXCSR_REGNUM (tdep),
+ regcache->raw_supply (I387_MXCSR_REGNUM (tdep),
FXSAVE_MXCSR_ADDR (regs));
}
}
@@ -996,74 +996,68 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
case pkeys:
if ((clear_bv & X86_XSTATE_PKRU))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- XSAVE_PKEYS_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum, XSAVE_PKEYS_ADDR (tdep, regs, regnum));
return;
case avx512_zmm_h:
if ((clear_bv & (X86_XSTATE_ZMM_H | X86_XSTATE_ZMM)))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- XSAVE_AVX512_ZMM_H_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum,
+ XSAVE_AVX512_ZMM_H_ADDR (tdep, regs, regnum));
return;
case avx512_k:
if ((clear_bv & X86_XSTATE_K))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- XSAVE_AVX512_K_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum, XSAVE_AVX512_K_ADDR (tdep, regs, regnum));
return;
case avx512_ymmh_avx512:
if ((clear_bv & X86_XSTATE_ZMM))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- XSAVE_YMM_AVX512_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum,
+ XSAVE_YMM_AVX512_ADDR (tdep, regs, regnum));
return;
case avx512_xmm_avx512:
if ((clear_bv & X86_XSTATE_ZMM))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- XSAVE_XMM_AVX512_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum,
+ XSAVE_XMM_AVX512_ADDR (tdep, regs, regnum));
return;
case avxh:
if ((clear_bv & X86_XSTATE_AVX))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- XSAVE_AVXH_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum, XSAVE_AVXH_ADDR (tdep, regs, regnum));
return;
case mpx:
if ((clear_bv & X86_XSTATE_BNDREGS))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- XSAVE_MPX_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum, XSAVE_MPX_ADDR (tdep, regs, regnum));
return;
case sse:
if ((clear_bv & X86_XSTATE_SSE))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- FXSAVE_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum, FXSAVE_ADDR (tdep, regs, regnum));
return;
case x87:
if ((clear_bv & X86_XSTATE_X87))
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
else
- regcache_raw_supply (regcache, regnum,
- FXSAVE_ADDR (tdep, regs, regnum));
+ regcache->raw_supply (regnum, FXSAVE_ADDR (tdep, regs, regnum));
return;
case all:
@@ -1075,15 +1069,14 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
for (i = I387_PKRU_REGNUM (tdep);
i < I387_PKEYSEND_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_PKRU_REGNUM (tdep);
i < I387_PKEYSEND_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i,
- XSAVE_PKEYS_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, XSAVE_PKEYS_ADDR (tdep, regs, i));
}
}
@@ -1095,15 +1088,15 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
for (i = I387_ZMM0H_REGNUM (tdep);
i < I387_ZMMENDH_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_ZMM0H_REGNUM (tdep);
i < I387_ZMMENDH_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i,
- XSAVE_AVX512_ZMM_H_ADDR (tdep, regs, i));
+ regcache->raw_supply (i,
+ XSAVE_AVX512_ZMM_H_ADDR (tdep, regs, i));
}
}
@@ -1115,15 +1108,14 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
for (i = I387_K0_REGNUM (tdep);
i < I387_KEND_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_K0_REGNUM (tdep);
i < I387_KEND_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i,
- XSAVE_AVX512_K_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, XSAVE_AVX512_K_ADDR (tdep, regs, i));
}
}
@@ -1135,24 +1127,22 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
for (i = I387_YMM16H_REGNUM (tdep);
i < I387_YMMH_AVX512_END_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
for (i = I387_XMM16_REGNUM (tdep);
i < I387_XMM_AVX512_END_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_YMM16H_REGNUM (tdep);
i < I387_YMMH_AVX512_END_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i,
- XSAVE_YMM_AVX512_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, XSAVE_YMM_AVX512_ADDR (tdep, regs, i));
for (i = I387_XMM16_REGNUM (tdep);
i < I387_XMM_AVX512_END_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i,
- XSAVE_XMM_AVX512_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, XSAVE_XMM_AVX512_ADDR (tdep, regs, i));
}
}
/* Handle the upper YMM registers. */
@@ -1163,15 +1153,14 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
for (i = I387_YMM0H_REGNUM (tdep);
i < I387_YMMENDH_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_YMM0H_REGNUM (tdep);
i < I387_YMMENDH_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i,
- XSAVE_AVXH_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, XSAVE_AVXH_ADDR (tdep, regs, i));
}
}
@@ -1182,14 +1171,13 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
{
for (i = I387_BND0R_REGNUM (tdep);
i < I387_BNDCFGU_REGNUM (tdep); i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_BND0R_REGNUM (tdep);
i < I387_BNDCFGU_REGNUM (tdep); i++)
- regcache_raw_supply (regcache, i,
- XSAVE_MPX_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, XSAVE_MPX_ADDR (tdep, regs, i));
}
}
@@ -1200,14 +1188,13 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
{
for (i = I387_BNDCFGU_REGNUM (tdep);
i < I387_MPXEND_REGNUM (tdep); i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_BNDCFGU_REGNUM (tdep);
i < I387_MPXEND_REGNUM (tdep); i++)
- regcache_raw_supply (regcache, i,
- XSAVE_MPX_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, XSAVE_MPX_ADDR (tdep, regs, i));
}
}
@@ -1219,14 +1206,13 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
for (i = I387_XMM0_REGNUM (tdep);
i < I387_MXCSR_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_XMM0_REGNUM (tdep);
i < I387_MXCSR_REGNUM (tdep); i++)
- regcache_raw_supply (regcache, i,
- FXSAVE_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, FXSAVE_ADDR (tdep, regs, i));
}
}
@@ -1238,14 +1224,14 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
for (i = I387_ST0_REGNUM (tdep);
i < I387_FCTRL_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
else
{
for (i = I387_ST0_REGNUM (tdep);
i < I387_FCTRL_REGNUM (tdep);
i++)
- regcache_raw_supply (regcache, i, FXSAVE_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, FXSAVE_ADDR (tdep, regs, i));
}
}
break;
@@ -1263,17 +1249,17 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
store_unsigned_integer (buf, 4, byte_order,
I387_FCTRL_INIT_VAL);
- regcache_raw_supply (regcache, i, buf);
+ regcache->raw_supply (i, buf);
}
else if (i == I387_FTAG_REGNUM (tdep))
{
gdb_byte buf[4];
store_unsigned_integer (buf, 4, byte_order, 0xffff);
- regcache_raw_supply (regcache, i, buf);
+ regcache->raw_supply (i, buf);
}
else
- regcache_raw_supply (regcache, i, zero);
+ regcache->raw_supply (i, zero);
}
/* Most of the FPU control registers occupy only 16 bits in
the xsave extended state. Give those a special treatment. */
@@ -1318,10 +1304,10 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
val[0] = ftag & 0xff;
val[1] = (ftag >> 8) & 0xff;
}
- regcache_raw_supply (regcache, i, val);
+ regcache->raw_supply (i, val);
}
else
- regcache_raw_supply (regcache, i, FXSAVE_ADDR (tdep, regs, i));
+ regcache->raw_supply (i, FXSAVE_ADDR (tdep, regs, i));
}
if (regnum == I387_MXCSR_REGNUM (tdep) || regnum == -1)
@@ -1334,11 +1320,11 @@ i387_supply_xsave (struct regcache *regcache, int regnum,
gdb_byte buf[4];
store_unsigned_integer (buf, 4, byte_order, I387_MXCSR_INIT_VAL);
- regcache_raw_supply (regcache, I387_MXCSR_REGNUM (tdep), buf);
+ regcache->raw_supply (I387_MXCSR_REGNUM (tdep), buf);
}
else
- regcache_raw_supply (regcache, I387_MXCSR_REGNUM (tdep),
- FXSAVE_MXCSR_ADDR (regs));
+ regcache->raw_supply (I387_MXCSR_REGNUM (tdep),
+ FXSAVE_MXCSR_ADDR (regs));
}
}
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index d095bde..98fd953 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -414,33 +414,32 @@ supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
for (regi = IA64_GR0_REGNUM; regi <= IA64_GR31_REGNUM; regi++)
{
- regcache_raw_supply (regcache, regi, regp + (regi - IA64_GR0_REGNUM));
+ regcache->raw_supply (regi, regp + (regi - IA64_GR0_REGNUM));
}
/* FIXME: NAT collection bits are at index 32; gotta deal with these
somehow... */
- regcache_raw_supply (regcache, IA64_PR_REGNUM, regp + 33);
+ regcache->raw_supply (IA64_PR_REGNUM, regp + 33);
for (regi = IA64_BR0_REGNUM; regi <= IA64_BR7_REGNUM; regi++)
{
- regcache_raw_supply (regcache, regi,
- regp + 34 + (regi - IA64_BR0_REGNUM));
+ regcache->raw_supply (regi, regp + 34 + (regi - IA64_BR0_REGNUM));
}
- regcache_raw_supply (regcache, IA64_IP_REGNUM, regp + 42);
- regcache_raw_supply (regcache, IA64_CFM_REGNUM, regp + 43);
- regcache_raw_supply (regcache, IA64_PSR_REGNUM, regp + 44);
- regcache_raw_supply (regcache, IA64_RSC_REGNUM, regp + 45);
- regcache_raw_supply (regcache, IA64_BSP_REGNUM, regp + 46);
- regcache_raw_supply (regcache, IA64_BSPSTORE_REGNUM, regp + 47);
- regcache_raw_supply (regcache, IA64_RNAT_REGNUM, regp + 48);
- regcache_raw_supply (regcache, IA64_CCV_REGNUM, regp + 49);
- regcache_raw_supply (regcache, IA64_UNAT_REGNUM, regp + 50);
- regcache_raw_supply (regcache, IA64_FPSR_REGNUM, regp + 51);
- regcache_raw_supply (regcache, IA64_PFS_REGNUM, regp + 52);
- regcache_raw_supply (regcache, IA64_LC_REGNUM, regp + 53);
- regcache_raw_supply (regcache, IA64_EC_REGNUM, regp + 54);
+ regcache->raw_supply (IA64_IP_REGNUM, regp + 42);
+ regcache->raw_supply (IA64_CFM_REGNUM, regp + 43);
+ regcache->raw_supply (IA64_PSR_REGNUM, regp + 44);
+ regcache->raw_supply (IA64_RSC_REGNUM, regp + 45);
+ regcache->raw_supply (IA64_BSP_REGNUM, regp + 46);
+ regcache->raw_supply (IA64_BSPSTORE_REGNUM, regp + 47);
+ regcache->raw_supply (IA64_RNAT_REGNUM, regp + 48);
+ regcache->raw_supply (IA64_CCV_REGNUM, regp + 49);
+ regcache->raw_supply (IA64_UNAT_REGNUM, regp + 50);
+ regcache->raw_supply (IA64_FPSR_REGNUM, regp + 51);
+ regcache->raw_supply (IA64_PFS_REGNUM, regp + 52);
+ regcache->raw_supply (IA64_LC_REGNUM, regp + 53);
+ regcache->raw_supply (IA64_EC_REGNUM, regp + 54);
}
void
@@ -500,14 +499,14 @@ supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
for fr0/fr1 and always supply their expected values. */
/* fr0 is always read as zero. */
- regcache_raw_supply (regcache, IA64_FR0_REGNUM, f_zero);
+ regcache->raw_supply (IA64_FR0_REGNUM, f_zero);
/* fr1 is always read as one (1.0). */
- regcache_raw_supply (regcache, IA64_FR1_REGNUM, f_one);
+ regcache->raw_supply (IA64_FR1_REGNUM, f_one);
for (regi = IA64_FR2_REGNUM; regi <= IA64_FR127_REGNUM; regi++)
{
from = (const char *) &((*fpregsetp)[regi - IA64_FR0_REGNUM]);
- regcache_raw_supply (regcache, regi, from);
+ regcache->raw_supply (regi, from);
}
}
@@ -748,7 +747,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
const gdb_byte zero[8] = { 0 };
gdb_assert (sizeof (zero) == register_size (gdbarch, regnum));
- regcache_raw_supply (regcache, regnum, zero);
+ regcache->raw_supply (regnum, zero);
return;
}
@@ -758,7 +757,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
const gdb_byte f_zero[16] = { 0 };
gdb_assert (sizeof (f_zero) == register_size (gdbarch, regnum));
- regcache_raw_supply (regcache, regnum, f_zero);
+ regcache->raw_supply (regnum, f_zero);
return;
}
@@ -769,13 +768,13 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0xff, 0, 0, 0, 0, 0, 0 };
gdb_assert (sizeof (f_one) == register_size (gdbarch, regnum));
- regcache_raw_supply (regcache, regnum, f_one);
+ regcache->raw_supply (regnum, f_one);
return;
}
if (ia64_cannot_fetch_register (gdbarch, regnum))
{
- regcache_raw_supply (regcache, regnum, NULL);
+ regcache->raw_supply (regnum, NULL);
return;
}
@@ -800,7 +799,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
addr += sizeof (PTRACE_TYPE_RET);
}
- regcache_raw_supply (regcache, regnum, buf);
+ regcache->raw_supply (regnum, buf);
}
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
diff --git a/gdb/ia64-linux-tdep.c b/gdb/ia64-linux-tdep.c
index b1662f2..19d0cf2 100644
--- a/gdb/ia64-linux-tdep.c
+++ b/gdb/ia64-linux-tdep.c
@@ -184,9 +184,9 @@ ia64_linux_supply_fpregset (const struct regset *regset,
did the same. So ignore whatever might be recorded in fpregset_t
for fr0/fr1 and always supply their expected values. */
if (regnum == -1 || regnum == IA64_FR0_REGNUM)
- regcache_raw_supply (regcache, IA64_FR0_REGNUM, f_zero);
+ regcache->raw_supply (IA64_FR0_REGNUM, f_zero);
if (regnum == -1 || regnum == IA64_FR1_REGNUM)
- regcache_raw_supply (regcache, IA64_FR1_REGNUM, f_one);
+ regcache->raw_supply (IA64_FR1_REGNUM, f_one);
}
static const struct regset ia64_linux_gregset =
diff --git a/gdb/linux-nat-trad.c b/gdb/linux-nat-trad.c
index ed75eed..23abb0f 100644
--- a/gdb/linux-nat-trad.c
+++ b/gdb/linux-nat-trad.c
@@ -41,7 +41,7 @@ linux_nat_trad_target::fetch_register (struct regcache *regcache, int regnum)
if (addr == (CORE_ADDR)-1
|| gdbarch_cannot_fetch_register (gdbarch, regnum))
{
- regcache_raw_supply (regcache, regnum, NULL);
+ regcache->raw_supply (regnum, NULL);
return;
}
@@ -66,7 +66,7 @@ linux_nat_trad_target::fetch_register (struct regcache *regcache, int regnum)
addr += sizeof (PTRACE_TYPE_RET);
}
- regcache_raw_supply (regcache, regnum, buf);
+ regcache->raw_supply (regnum, buf);
}
/* Fetch register REGNUM from the inferior. If REGNUM is -1, do this
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 9d833fa..3c72357 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -101,11 +101,11 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t * gregsetp)
}
if (i != M32R_SP_REGNUM)
- regcache_raw_supply (regcache, i, ®val);
+ regcache->raw_supply (i, ®val);
else if (psw & 0x8000)
- regcache_raw_supply (regcache, i, regp + SPU_REGMAP);
+ regcache->raw_supply (i, regp + SPU_REGMAP);
else
- regcache_raw_supply (regcache, i, regp + SPI_REGMAP);
+ regcache->raw_supply (i, regp + SPI_REGMAP);
}
}
diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
index 352a6f0..5618218 100644
--- a/gdb/m32r-linux-tdep.c
+++ b/gdb/m32r-linux-tdep.c
@@ -385,7 +385,7 @@ m32r_linux_supply_gregset (const struct regset *regset,
p = regs + m32r_pt_regs_offset[i];
}
- regcache_raw_supply (regcache, i, p);
+ regcache->raw_supply (i, p);
}
}
diff --git a/gdb/m68k-bsd-nat.c b/gdb/m68k-bsd-nat.c
index c44f736..8d2f548 100644
--- a/gdb/m68k-bsd-nat.c
+++ b/gdb/m68k-bsd-nat.c
@@ -58,7 +58,7 @@ m68kbsd_supply_gregset (struct regcache *regcache, const void *gregs)
int regnum;
for (regnum = M68K_D0_REGNUM; regnum <= M68K_PC_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, regs + regnum * 4);
+ regcache->raw_supply (regnum, regs + regnum * 4);
}
/* Supply the floating-point registers stored in FPREGS to REGCACHE. */
@@ -71,8 +71,8 @@ m68kbsd_supply_fpregset (struct regcache *regcache, const void *fpregs)
int regnum;
for (regnum = M68K_FP0_REGNUM; regnum <= M68K_FPI_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum,
- regs + m68kbsd_fpreg_offset (gdbarch, regnum));
+ regcache->raw_supply (regnum,
+ regs + m68kbsd_fpreg_offset (gdbarch, regnum));
}
/* Collect the general-purpose registers from REGCACHE and store them
@@ -209,15 +209,15 @@ m68kbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
return 0;
for (regnum = M68K_D2_REGNUM; regnum <= M68K_D7_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, &pcb->pcb_regs[i++]);
+ regcache->raw_supply (regnum, &pcb->pcb_regs[i++]);
for (regnum = M68K_A2_REGNUM; regnum <= M68K_SP_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, &pcb->pcb_regs[i++]);
+ regcache->raw_supply (regnum, &pcb->pcb_regs[i++]);
tmp = pcb->pcb_ps & 0xffff;
- regcache_raw_supply (regcache, M68K_PS_REGNUM, &tmp);
+ regcache->raw_supply (M68K_PS_REGNUM, &tmp);
read_memory (pcb->pcb_regs[PCB_REGS_FP] + 4, (char *) &tmp, sizeof tmp);
- regcache_raw_supply (regcache, M68K_PC_REGNUM, &tmp);
+ regcache->raw_supply (M68K_PC_REGNUM, &tmp);
return 1;
}
diff --git a/gdb/m68k-bsd-tdep.c b/gdb/m68k-bsd-tdep.c
index 99c4d74..2f53870 100644
--- a/gdb/m68k-bsd-tdep.c
+++ b/gdb/m68k-bsd-tdep.c
@@ -67,8 +67,7 @@ m68kbsd_supply_fpregset (const struct regset *regset,
for (i = M68K_FP0_REGNUM; i <= M68K_PC_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i,
- regs + m68kbsd_fpreg_offset (gdbarch, i));
+ regcache->raw_supply (i, regs + m68kbsd_fpreg_offset (gdbarch, i));
}
}
@@ -89,7 +88,7 @@ m68kbsd_supply_gregset (const struct regset *regset,
for (i = M68K_D0_REGNUM; i <= M68K_PC_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * 4);
+ regcache->raw_supply (i, regs + i * 4);
}
if (len >= M68KBSD_SIZEOF_GREGS + M68KBSD_SIZEOF_FPREGS)
diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c
index 409a4fd..2dbf857 100644
--- a/gdb/m68k-linux-nat.c
+++ b/gdb/m68k-linux-nat.c
@@ -133,7 +133,7 @@ fetch_register (struct regcache *regcache, int regno)
gdbarch_register_name (gdbarch, regno),
regno, safe_strerror (errno));
}
- regcache_raw_supply (regcache, regno, buf);
+ regcache->raw_supply (regno, buf);
}
/* Fetch register values from the inferior.
@@ -224,11 +224,9 @@ supply_gregset (struct regcache *regcache, const elf_gregset_t *gregsetp)
for (regi = M68K_D0_REGNUM;
regi <= gdbarch_sp_regnum (gdbarch);
regi++)
- regcache_raw_supply (regcache, regi, ®p[regmap[regi]]);
- regcache_raw_supply (regcache, gdbarch_ps_regnum (gdbarch),
- ®p[PT_SR]);
- regcache_raw_supply (regcache,
- gdbarch_pc_regnum (gdbarch), ®p[PT_PC]);
+ regcache->raw_supply (regi, ®p[regmap[regi]]);
+ regcache->raw_supply (gdbarch_ps_regnum (gdbarch), ®p[PT_SR]);
+ regcache->raw_supply (gdbarch_pc_regnum (gdbarch), ®p[PT_PC]);
}
/* Fill register REGNO (if it is a general-purpose register) in
@@ -318,12 +316,11 @@ supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp)
for (regi = gdbarch_fp0_regnum (gdbarch);
regi < gdbarch_fp0_regnum (gdbarch) + 8; regi++)
- regcache_raw_supply (regcache, regi,
- FPREG_ADDR (fpregsetp,
- regi - gdbarch_fp0_regnum (gdbarch)));
- regcache_raw_supply (regcache, M68K_FPC_REGNUM, &fpregsetp->fpcntl[0]);
- regcache_raw_supply (regcache, M68K_FPS_REGNUM, &fpregsetp->fpcntl[1]);
- regcache_raw_supply (regcache, M68K_FPI_REGNUM, &fpregsetp->fpcntl[2]);
+ regcache->raw_supply
+ (regi, FPREG_ADDR (fpregsetp, regi - gdbarch_fp0_regnum (gdbarch)));
+ regcache->raw_supply (M68K_FPC_REGNUM, &fpregsetp->fpcntl[0]);
+ regcache->raw_supply (M68K_FPS_REGNUM, &fpregsetp->fpcntl[1]);
+ regcache->raw_supply (M68K_FPI_REGNUM, &fpregsetp->fpcntl[2]);
}
/* Fill register REGNO (if it is a floating-point register) in
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 84cc405..1dd9764 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -282,9 +282,9 @@ supply_64bit_reg (struct regcache *regcache, int regnum,
struct gdbarch *gdbarch = regcache->arch ();
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG
&& register_size (gdbarch, regnum) == 4)
- regcache_raw_supply (regcache, regnum, buf + 4);
+ regcache->raw_supply (regnum, buf + 4);
else
- regcache_raw_supply (regcache, regnum, buf);
+ regcache->raw_supply (regnum, buf);
}
/* Unpack a 64-bit elf_gregset_t into GDB's register cache. */
@@ -422,15 +422,12 @@ mips64_supply_fpregset (struct regcache *regcache,
= (const gdb_byte *) (*fpregsetp + (regi & ~1));
if ((gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) != (regi & 1))
reg_ptr += 4;
- regcache_raw_supply (regcache,
- gdbarch_fp0_regnum (gdbarch) + regi,
- reg_ptr);
+ regcache->raw_supply (gdbarch_fp0_regnum (gdbarch) + regi, reg_ptr);
}
else
for (regi = 0; regi < 32; regi++)
- regcache_raw_supply (regcache,
- gdbarch_fp0_regnum (gdbarch) + regi,
- (const char *) (*fpregsetp + regi));
+ regcache->raw_supply (gdbarch_fp0_regnum (gdbarch) + regi,
+ (const char *) (*fpregsetp + regi));
supply_32bit_reg (regcache, mips_regnum (gdbarch)->fp_control_status,
(const gdb_byte *) (*fpregsetp + 32));
diff --git a/gdb/mips-nbsd-tdep.c b/gdb/mips-nbsd-tdep.c
index d805f0d..5a14b2f 100644
--- a/gdb/mips-nbsd-tdep.c
+++ b/gdb/mips-nbsd-tdep.c
@@ -64,8 +64,7 @@ mipsnbsd_supply_fpregset (const struct regset *regset,
for (i = MIPS_FP0_REGNUM; i <= MIPS_FSR_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i,
- regs + (i - MIPS_FP0_REGNUM) * regsize);
+ regcache->raw_supply (i, regs + (i - MIPS_FP0_REGNUM) * regsize);
}
}
@@ -87,7 +86,7 @@ mipsnbsd_supply_gregset (const struct regset *regset,
for (i = 0; i <= MIPS_PC_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * regsize);
+ regcache->raw_supply (i, regs + i * regsize);
}
if (len >= (MIPSNBSD_NUM_GREGS + MIPSNBSD_NUM_FPREGS) * regsize)
@@ -145,10 +144,10 @@ mipsnbsd_supply_reg (struct regcache *regcache, const char *regs, int regno)
if (regno == i || regno == -1)
{
if (gdbarch_cannot_fetch_register (gdbarch, i))
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
else
- regcache_raw_supply (regcache, i,
- regs + (i * mips_isa_regsize (gdbarch)));
+ regcache->raw_supply
+ (i, regs + (i * mips_isa_regsize (gdbarch)));
}
}
}
@@ -180,10 +179,10 @@ mipsnbsd_supply_fpreg (struct regcache *regcache,
if (regno == i || regno == -1)
{
if (gdbarch_cannot_fetch_register (gdbarch, i))
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
else
- regcache_raw_supply (regcache, i,
- fpregs
+ regcache->raw_supply (i,
+ fpregs
+ ((i - gdbarch_fp0_regnum (gdbarch))
* mips_isa_regsize (gdbarch)));
}
diff --git a/gdb/mips64-obsd-nat.c b/gdb/mips64-obsd-nat.c
index 27e1ab6..9c306dd 100644
--- a/gdb/mips64-obsd-nat.c
+++ b/gdb/mips64-obsd-nat.c
@@ -52,10 +52,10 @@ mips64obsd_supply_gregset (struct regcache *regcache, const void *gregs)
int regnum;
for (regnum = MIPS_ZERO_REGNUM; regnum <= MIPS_PC_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, regs + regnum * 8);
+ regcache->raw_supply (regnum, regs + regnum * 8);
for (regnum = MIPS_FP0_REGNUM; regnum <= MIPS_FSR_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, regs + (regnum + 2) * 8);
+ regcache->raw_supply (regnum, regs + (regnum + 2) * 8);
}
/* Collect the general-purpose registers from REGCACHE and store them
diff --git a/gdb/mips64-obsd-tdep.c b/gdb/mips64-obsd-tdep.c
index ef706e3..ab910ed 100644
--- a/gdb/mips64-obsd-tdep.c
+++ b/gdb/mips64-obsd-tdep.c
@@ -52,7 +52,7 @@ mips64obsd_supply_gregset (const struct regset *regset,
for (i = 0; i < MIPS64OBSD_NUM_REGS; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * 8);
+ regcache->raw_supply (i, regs + i * 8);
}
}
diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c
index 32f34ce..a79f1f2 100644
--- a/gdb/mn10300-linux-tdep.c
+++ b/gdb/mn10300-linux-tdep.c
@@ -93,96 +93,96 @@ am33_supply_gregset_method (const struct regset *regset,
switch (regnum) {
case E_D0_REGNUM:
- regcache_raw_supply (regcache, E_D0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
+ regcache->raw_supply (E_D0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0));
break;
case E_D1_REGNUM:
- regcache_raw_supply (regcache, E_D1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
+ regcache->raw_supply (E_D1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1));
break;
case E_D2_REGNUM:
- regcache_raw_supply (regcache, E_D2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
+ regcache->raw_supply (E_D2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2));
break;
case E_D3_REGNUM:
- regcache_raw_supply (regcache, E_D3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
+ regcache->raw_supply (E_D3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3));
break;
case E_A0_REGNUM:
- regcache_raw_supply (regcache, E_A0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
+ regcache->raw_supply (E_A0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0));
break;
case E_A1_REGNUM:
- regcache_raw_supply (regcache, E_A1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
+ regcache->raw_supply (E_A1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1));
break;
case E_A2_REGNUM:
- regcache_raw_supply (regcache, E_A2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
+ regcache->raw_supply (E_A2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2));
break;
case E_A3_REGNUM:
- regcache_raw_supply (regcache, E_A3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
+ regcache->raw_supply (E_A3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3));
break;
case E_SP_REGNUM:
- regcache_raw_supply (regcache, E_SP_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
+ regcache->raw_supply (E_SP_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP));
break;
case E_PC_REGNUM:
- regcache_raw_supply (regcache, E_PC_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
+ regcache->raw_supply (E_PC_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC));
break;
case E_MDR_REGNUM:
- regcache_raw_supply (regcache, E_MDR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
+ regcache->raw_supply (E_MDR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR));
break;
case E_PSW_REGNUM:
- regcache_raw_supply (regcache, E_PSW_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
+ regcache->raw_supply (E_PSW_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW));
break;
case E_LIR_REGNUM:
- regcache_raw_supply (regcache, E_LIR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
+ regcache->raw_supply (E_LIR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR));
break;
case E_LAR_REGNUM:
- regcache_raw_supply (regcache, E_LAR_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
+ regcache->raw_supply (E_LAR_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR));
break;
case E_MDRQ_REGNUM:
- regcache_raw_supply (regcache, E_MDRQ_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
+ regcache->raw_supply (E_MDRQ_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ));
break;
case E_E0_REGNUM:
- regcache_raw_supply (regcache, E_E0_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
+ regcache->raw_supply (E_E0_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0));
break;
case E_E1_REGNUM:
- regcache_raw_supply (regcache, E_E1_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
+ regcache->raw_supply (E_E1_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1));
break;
case E_E2_REGNUM:
- regcache_raw_supply (regcache, E_E2_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
+ regcache->raw_supply (E_E2_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2));
break;
case E_E3_REGNUM:
- regcache_raw_supply (regcache, E_E3_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
+ regcache->raw_supply (E_E3_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3));
break;
case E_E4_REGNUM:
- regcache_raw_supply (regcache, E_E4_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
+ regcache->raw_supply (E_E4_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4));
break;
case E_E5_REGNUM:
- regcache_raw_supply (regcache, E_E5_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
+ regcache->raw_supply (E_E5_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5));
break;
case E_E6_REGNUM:
- regcache_raw_supply (regcache, E_E6_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
+ regcache->raw_supply (E_E6_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6));
break;
case E_E7_REGNUM:
- regcache_raw_supply (regcache, E_E7_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
+ regcache->raw_supply (E_E7_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7));
break;
/* ssp, msp, and usp are inaccessible. */
@@ -196,16 +196,16 @@ am33_supply_gregset_method (const struct regset *regset,
regcache->raw_supply_zeroed (E_E10_REGNUM);
break;
case E_MCRH_REGNUM:
- regcache_raw_supply (regcache, E_MCRH_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
+ regcache->raw_supply (E_MCRH_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH));
break;
case E_MCRL_REGNUM:
- regcache_raw_supply (regcache, E_MCRL_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
+ regcache->raw_supply (E_MCRL_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL));
break;
case E_MCVF_REGNUM:
- regcache_raw_supply (regcache, E_MCVF_REGNUM,
- (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
+ regcache->raw_supply (E_MCVF_REGNUM,
+ (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF));
break;
case E_FPCR_REGNUM:
/* FPCR is numbered among the GP regs, but handled as an FP reg.
@@ -252,12 +252,10 @@ am33_supply_fpregset_method (const struct regset *regset,
E_FPCR_REGNUM, fpregs, len);
}
else if (regnum == E_FPCR_REGNUM)
- regcache_raw_supply (regcache, E_FPCR_REGNUM,
- &fpregset->fpcr);
+ regcache->raw_supply (E_FPCR_REGNUM, &fpregset->fpcr);
else if (E_FS0_REGNUM <= regnum
&& regnum < E_FS0_REGNUM + MN10300_ELF_NFPREG)
- regcache_raw_supply (regcache, regnum,
- &fpregset->fpregs[regnum - E_FS0_REGNUM]);
+ regcache->raw_supply (regnum, &fpregset->fpregs[regnum - E_FS0_REGNUM]);
return;
}
diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index 005c82a..7ee6f14 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -67,10 +67,9 @@ nios2_supply_gregset (const struct regset *regset,
if (regnum == -1 || regnum == regno)
{
if (reg_offsets[regno] != -1)
- regcache_raw_supply (regcache, regno,
- gregs + 4 * reg_offsets[regno]);
+ regcache->raw_supply (regno, gregs + 4 * reg_offsets[regno]);
else
- regcache_raw_supply (regcache, regno, zero_buf);
+ regcache->raw_supply (regno, zero_buf);
}
}
diff --git a/gdb/ppc-fbsd-nat.c b/gdb/ppc-fbsd-nat.c
index 89a7e6e..44661e9 100644
--- a/gdb/ppc-fbsd-nat.c
+++ b/gdb/ppc-fbsd-nat.c
@@ -192,11 +192,11 @@ ppcfbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
if (pcb->pcb_sp == 0)
return 0;
- regcache_raw_supply (regcache, gdbarch_sp_regnum (gdbarch), &pcb->pcb_sp);
- regcache_raw_supply (regcache, tdep->ppc_cr_regnum, &pcb->pcb_cr);
- regcache_raw_supply (regcache, tdep->ppc_lr_regnum, &pcb->pcb_lr);
+ regcache->raw_supply (gdbarch_sp_regnum (gdbarch), &pcb->pcb_sp);
+ regcache->raw_supply (tdep->ppc_cr_regnum, &pcb->pcb_cr);
+ regcache->raw_supply (tdep->ppc_lr_regnum, &pcb->pcb_lr);
for (i = 0, regnum = tdep->ppc_gp0_regnum + 14; i < 20; i++, regnum++)
- regcache_raw_supply (regcache, regnum, &pcb->pcb_context[i]);
+ regcache->raw_supply (regnum, &pcb->pcb_context[i]);
return 1;
}
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index 7606081..7f209f4 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -512,22 +512,20 @@ fetch_spe_register (struct regcache *regcache, int tid, int regno)
int i;
for (i = 0; i < ppc_num_gprs; i++)
- regcache_raw_supply (regcache, tdep->ppc_ev0_upper_regnum + i,
- &evrregs.evr[i]);
+ regcache->raw_supply (tdep->ppc_ev0_upper_regnum + i, &evrregs.evr[i]);
}
else if (tdep->ppc_ev0_upper_regnum <= regno
&& regno < tdep->ppc_ev0_upper_regnum + ppc_num_gprs)
- regcache_raw_supply (regcache, regno,
- &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
+ regcache->raw_supply (regno,
+ &evrregs.evr[regno - tdep->ppc_ev0_upper_regnum]);
if (regno == -1
|| regno == tdep->ppc_acc_regnum)
- regcache_raw_supply (regcache, tdep->ppc_acc_regnum, &evrregs.acc);
+ regcache->raw_supply (tdep->ppc_acc_regnum, &evrregs.acc);
if (regno == -1
|| regno == tdep->ppc_spefscr_regnum)
- regcache_raw_supply (regcache, tdep->ppc_spefscr_regnum,
- &evrregs.spefscr);
+ regcache->raw_supply (tdep->ppc_spefscr_regnum, &evrregs.spefscr);
}
static void
@@ -573,7 +571,7 @@ fetch_register (struct regcache *regcache, int tid, int regno)
if (regaddr == -1)
{
memset (buf, '\0', register_size (gdbarch, regno)); /* Supply zeroes */
- regcache_raw_supply (regcache, regno, buf);
+ regcache->raw_supply (regno, buf);
return;
}
@@ -606,14 +604,14 @@ fetch_register (struct regcache *regcache, int tid, int regno)
{
/* Little-endian values are always found at the left end of the
bytes transferred. */
- regcache_raw_supply (regcache, regno, buf);
+ regcache->raw_supply (regno, buf);
}
else if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
/* Big-endian values are found at the right end of the bytes
transferred. */
size_t padding = (bytes_transferred - register_size (gdbarch, regno));
- regcache_raw_supply (regcache, regno, buf + padding);
+ regcache->raw_supply (regno, buf + padding);
}
else
internal_error (__FILE__, __LINE__,
diff --git a/gdb/ppc-nbsd-nat.c b/gdb/ppc-nbsd-nat.c
index 037b261..ea163f3 100644
--- a/gdb/ppc-nbsd-nat.c
+++ b/gdb/ppc-nbsd-nat.c
@@ -162,20 +162,19 @@ ppcnbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
return 0;
read_memory (pcb->pcb_sp, (gdb_byte *)&sf, sizeof sf);
- regcache_raw_supply (regcache, tdep->ppc_cr_regnum, &sf.cr);
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 2, &sf.fixreg2);
+ regcache->raw_supply (tdep->ppc_cr_regnum, &sf.cr);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 2, &sf.fixreg2);
for (i = 0 ; i < 19 ; i++)
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 13 + i,
- &sf.fixreg[i]);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 13 + i, &sf.fixreg[i]);
read_memory(sf.sp, (gdb_byte *)&cf, sizeof(cf));
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 30, &cf.r30);
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 31, &cf.r31);
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 1, &cf.sp);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 30, &cf.r30);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 31, &cf.r31);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 1, &cf.sp);
read_memory(cf.sp, (gdb_byte *)&cf, sizeof(cf));
- regcache_raw_supply (regcache, tdep->ppc_lr_regnum, &cf.lr);
- regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch), &cf.lr);
+ regcache->raw_supply (tdep->ppc_lr_regnum, &cf.lr);
+ regcache->raw_supply (gdbarch_pc_regnum (gdbarch), &cf.lr);
return 1;
}
diff --git a/gdb/ppc-obsd-nat.c b/gdb/ppc-obsd-nat.c
index 88ba0c5..ee71b742 100644
--- a/gdb/ppc-obsd-nat.c
+++ b/gdb/ppc-obsd-nat.c
@@ -173,16 +173,16 @@ ppcobsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
return 0;
read_memory (pcb->pcb_sp, (gdb_byte *)&sf, sizeof sf);
- regcache_raw_supply (regcache, gdbarch_sp_regnum (gdbarch), &sf.sp);
- regcache_raw_supply (regcache, tdep->ppc_cr_regnum, &sf.cr);
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 2, &sf.fixreg2);
+ regcache->raw_supply (gdbarch_sp_regnum (gdbarch), &sf.sp);
+ regcache->raw_supply (tdep->ppc_cr_regnum, &sf.cr);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 2, &sf.fixreg2);
for (i = 0, regnum = tdep->ppc_gp0_regnum + 13; i < 19; i++, regnum++)
- regcache_raw_supply (regcache, regnum, &sf.fixreg[i]);
+ regcache->raw_supply (regnum, &sf.fixreg[i]);
read_memory (sf.sp, (gdb_byte *)&cf, sizeof cf);
- regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch), &cf.lr);
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 30, &cf.r30);
- regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 31, &cf.r31);
+ regcache->raw_supply (gdbarch_pc_regnum (gdbarch), &cf.lr);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 30, &cf.r30);
+ regcache->raw_supply (tdep->ppc_gp0_regnum + 31, &cf.r31);
return 1;
}
diff --git a/gdb/ppc-ravenscar-thread.c b/gdb/ppc-ravenscar-thread.c
index 38f2667..ae5ad24 100644
--- a/gdb/ppc-ravenscar-thread.c
+++ b/gdb/ppc-ravenscar-thread.c
@@ -125,7 +125,7 @@ supply_register_at_address (struct regcache *regcache, int regnum,
buf = (gdb_byte *) alloca (buf_size);
read_memory (register_addr, buf, buf_size);
- regcache_raw_supply (regcache, regnum, buf);
+ regcache->raw_supply (regnum, buf);
}
/* Return true if, for a non-running thread, REGNUM has been saved on the
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 35c8421..47a31b7 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -1558,7 +1558,7 @@ record_btrace_target::fetch_registers (struct regcache *regcache, int regno)
insn = btrace_insn_get (replay);
gdb_assert (insn != NULL);
- regcache_raw_supply (regcache, regno, &insn->pc);
+ regcache->raw_supply (regno, &insn->pc);
}
else
this->beneath->fetch_registers (regcache, regno);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 758f21c..8d47fda 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -879,15 +879,6 @@ regcache::cooked_write_part (int regnum, int offset, int len,
write_part (regnum, offset, len, buf, false);
}
-/* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE. */
-
-void
-regcache_raw_supply (struct regcache *regcache, int regnum, const void *buf)
-{
- gdb_assert (regcache != NULL);
- regcache->raw_supply (regnum, buf);
-}
-
void
detached_regcache::raw_supply (int regnum, const void *buf)
{
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 064930c..b60f031 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -71,8 +71,6 @@ extern void regcache_write_pc (struct regcache *regcache, CORE_ADDR pc);
target. These functions are called by the target in response to a
target_fetch_registers() or target_store_registers(). */
-extern void regcache_raw_supply (struct regcache *regcache,
- int regnum, const void *buf);
extern void regcache_raw_collect (const struct regcache *regcache,
int regnum, void *buf);
@@ -243,6 +241,7 @@ public:
: readable_regcache (gdbarch, has_pseudo)
{}
+ /* Supply register REGNUM, whose contents are stored in BUF, to REGCACHE. */
void raw_supply (int regnum, const void *buf);
void raw_supply (int regnum, const reg_buffer &src)
diff --git a/gdb/remote.c b/gdb/remote.c
index 3aca5fb..3f0b678 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7786,7 +7786,7 @@ remote_target::process_stop_reply (struct stop_reply *stop_reply,
VEC_iterate (cached_reg_t, stop_reply->regcache, ix, reg);
ix++)
{
- regcache_raw_supply (regcache, reg->num, reg->data);
+ regcache->raw_supply (reg->num, reg->data);
xfree (reg->data);
}
@@ -8080,7 +8080,7 @@ remote_target::fetch_register_using_p (struct regcache *regcache,
/* If this register is unfetchable, tell the regcache. */
if (buf[0] == 'x')
{
- regcache_raw_supply (regcache, reg->regnum, NULL);
+ regcache->raw_supply (reg->regnum, NULL);
return 1;
}
@@ -8095,7 +8095,7 @@ remote_target::fetch_register_using_p (struct regcache *regcache,
regp[i++] = fromhex (p[0]) * 16 + fromhex (p[1]);
p += 2;
}
- regcache_raw_supply (regcache, reg->regnum, regp);
+ regcache->raw_supply (reg->regnum, regp);
return 1;
}
@@ -8233,11 +8233,10 @@ remote_target::process_g_packet (struct regcache *regcache)
gdb_assert (r->offset * 2 < strlen (rs->buf));
/* The register isn't available, mark it as such (at
the same time setting the value to zero). */
- regcache_raw_supply (regcache, r->regnum, NULL);
+ regcache->raw_supply (r->regnum, NULL);
}
else
- regcache_raw_supply (regcache, r->regnum,
- regs + r->offset);
+ regcache->raw_supply (r->regnum, regs + r->offset);
}
}
}
@@ -8304,7 +8303,7 @@ remote_target::fetch_registers (struct regcache *regcache, int regnum)
return;
/* This register is not available. */
- regcache_raw_supply (regcache, reg->regnum, NULL);
+ regcache->raw_supply (reg->regnum, NULL);
return;
}
@@ -8316,7 +8315,7 @@ remote_target::fetch_registers (struct regcache *regcache, int regnum)
if (!fetch_register_using_p (regcache, &rsa->regs[i]))
{
/* This register is not available. */
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
}
}
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index 689d8e8..7e39d57 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -231,7 +231,7 @@ fetch_register (struct regcache *regcache, int regno)
}
if (!errno)
- regcache_raw_supply (regcache, regno, (char *) addr);
+ regcache->raw_supply (regno, (char *) addr);
else
{
#if 0
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 2523ff6..e165d1b 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -389,7 +389,7 @@ ppc_supply_reg (struct regcache *regcache, int regnum,
&& gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
offset += regsize - gdb_regsize;
}
- regcache_raw_supply (regcache, regnum, regs + offset);
+ regcache->raw_supply (regnum, regs + offset);
}
}
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index abb06a9..303cbee 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -170,10 +170,10 @@ supply_gregset (struct regcache *regcache, const gregset_t *regp)
pswa = extract_unsigned_integer ((const gdb_byte *) regp
+ S390_PSWA_OFFSET, 8, byte_order);
store_unsigned_integer (buf, 4, byte_order, (pswm >> 32) | 0x80000);
- regcache_raw_supply (regcache, S390_PSWM_REGNUM, buf);
+ regcache->raw_supply (S390_PSWM_REGNUM, buf);
store_unsigned_integer (buf, 4, byte_order,
(pswa & 0x7fffffff) | (pswm & 0x80000000));
- regcache_raw_supply (regcache, S390_PSWA_REGNUM, buf);
+ regcache->raw_supply (S390_PSWA_REGNUM, buf);
return;
}
#endif
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index a3a3cb6..e4e08c7 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1074,10 +1074,10 @@ s390_guess_tracepoint_registers (struct gdbarch *gdbarch,
}
store_unsigned_integer (reg, sz, gdbarch_byte_order (gdbarch), pswa);
- regcache_raw_supply (regcache, S390_PSWA_REGNUM, reg);
+ regcache->raw_supply (S390_PSWA_REGNUM, reg);
store_unsigned_integer (reg, sz, gdbarch_byte_order (gdbarch), pswm);
- regcache_raw_supply (regcache, S390_PSWM_REGNUM, reg);
+ regcache->raw_supply (S390_PSWM_REGNUM, reg);
}
/* Return the name of register REGNO. Return the empty string for
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index e764c65..16bf00e 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -1428,9 +1428,8 @@ score7_linux_supply_gregset(const struct regset *regset,
collect function will store the PC in that slot. */
if ((regnum == -1 || regnum == SCORE_EPC_REGNUM)
&& size >= SCORE7_LINUX_EPC_OFFSET + 4)
- regcache_raw_supply (regcache, SCORE_EPC_REGNUM,
- (const gdb_byte *) buf
- + SCORE7_LINUX_EPC_OFFSET);
+ regcache->raw_supply
+ (SCORE_EPC_REGNUM, (const gdb_byte *) buf + SCORE7_LINUX_EPC_OFFSET);
}
static const struct regset score7_linux_gregset =
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 97e4a75..5e9fd09 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -2175,8 +2175,8 @@ sh_corefile_supply_regset (const struct regset *regset,
{
if ((regnum == -1 || regnum == regmap[i].regnum)
&& regmap[i].offset + 4 <= len)
- regcache_raw_supply (regcache, regmap[i].regnum,
- (char *)regs + regmap[i].offset);
+ regcache->raw_supply
+ (regmap[i].regnum, (char *) regs + regmap[i].offset);
}
}
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 86a6b5a..c133a3e 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -158,7 +158,7 @@ sparc_fetch_inferior_registers (struct regcache *regcache, int regnum)
{
gdb_byte zero[8] = { 0 };
- regcache_raw_supply (regcache, SPARC_G0_REGNUM, &zero);
+ regcache->raw_supply (SPARC_G0_REGNUM, &zero);
return;
}
diff --git a/gdb/sparc-nbsd-nat.c b/gdb/sparc-nbsd-nat.c
index e1ed442..c8ed129 100644
--- a/gdb/sparc-nbsd-nat.c
+++ b/gdb/sparc-nbsd-nat.c
@@ -44,11 +44,11 @@ sparc32nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
if (pcb->pcb_sp == 0)
return 0;
- regcache_raw_supply (regcache, SPARC_SP_REGNUM, &pcb->pcb_sp);
- regcache_raw_supply (regcache, SPARC_O7_REGNUM, &pcb->pcb_pc);
- regcache_raw_supply (regcache, SPARC32_PSR_REGNUM, &pcb->pcb_psr);
- regcache_raw_supply (regcache, SPARC32_WIM_REGNUM, &pcb->pcb_wim);
- regcache_raw_supply (regcache, SPARC32_PC_REGNUM, &pcb->pcb_pc);
+ regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp);
+ regcache->raw_supply (SPARC_O7_REGNUM, &pcb->pcb_pc);
+ regcache->raw_supply (SPARC32_PSR_REGNUM, &pcb->pcb_psr);
+ regcache->raw_supply (SPARC32_WIM_REGNUM, &pcb->pcb_wim);
+ regcache->raw_supply (SPARC32_PC_REGNUM, &pcb->pcb_pc);
sparc_supply_rwindow (regcache, pcb->pcb_sp, -1);
diff --git a/gdb/sparc-obsd-tdep.c b/gdb/sparc-obsd-tdep.c
index 3ef2fb9..c821562 100644
--- a/gdb/sparc-obsd-tdep.c
+++ b/gdb/sparc-obsd-tdep.c
@@ -163,7 +163,7 @@ sparc32obsd_supply_uthread (struct regcache *regcache,
if (regnum == SPARC_SP_REGNUM || regnum == -1)
{
store_unsigned_integer (buf, 4, byte_order, fp);
- regcache_raw_supply (regcache, SPARC_SP_REGNUM, buf);
+ regcache->raw_supply (SPARC_SP_REGNUM, buf);
if (regnum == SPARC_SP_REGNUM)
return;
@@ -178,12 +178,12 @@ sparc32obsd_supply_uthread (struct regcache *regcache,
if (regnum == SPARC32_PC_REGNUM || regnum == -1)
{
store_unsigned_integer (buf, 4, byte_order, i7 + 8);
- regcache_raw_supply (regcache, SPARC32_PC_REGNUM, buf);
+ regcache->raw_supply (SPARC32_PC_REGNUM, buf);
}
if (regnum == SPARC32_NPC_REGNUM || regnum == -1)
{
store_unsigned_integer (buf, 4, byte_order, i7 + 12);
- regcache_raw_supply (regcache, SPARC32_NPC_REGNUM, buf);
+ regcache->raw_supply (SPARC32_NPC_REGNUM, buf);
}
if (regnum == SPARC32_PC_REGNUM || regnum == SPARC32_NPC_REGNUM)
diff --git a/gdb/sparc-ravenscar-thread.c b/gdb/sparc-ravenscar-thread.c
index 1cd1915..129b4b6 100644
--- a/gdb/sparc-ravenscar-thread.c
+++ b/gdb/sparc-ravenscar-thread.c
@@ -68,7 +68,7 @@ supply_register_at_address (struct regcache *regcache, int regnum,
buf = (gdb_byte *) alloca (buf_size);
read_memory (register_addr, buf, buf_size);
- regcache_raw_supply (regcache, regnum, buf);
+ regcache->raw_supply (regnum, buf);
}
/* Return true if, for a non-running thread, REGNUM has been saved on the
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 40d213f..ad0d2b4 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -1970,7 +1970,7 @@ sparc_supply_rwindow (struct regcache *regcache, CORE_ADDR sp, int regnum)
i7 ^ wcookie);
}
- regcache_raw_supply (regcache, i, buf);
+ regcache->raw_supply (i, buf);
}
}
}
@@ -2006,7 +2006,7 @@ sparc_supply_rwindow (struct regcache *regcache, CORE_ADDR sp, int regnum)
i7 ^ wcookie);
}
- regcache_raw_supply (regcache, i, buf);
+ regcache->raw_supply (i, buf);
}
}
}
@@ -2093,23 +2093,19 @@ sparc32_supply_gregset (const struct sparc_gregmap *gregmap,
int i;
if (regnum == SPARC32_PSR_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_PSR_REGNUM,
- regs + gregmap->r_psr_offset);
+ regcache->raw_supply (SPARC32_PSR_REGNUM, regs + gregmap->r_psr_offset);
if (regnum == SPARC32_PC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_PC_REGNUM,
- regs + gregmap->r_pc_offset);
+ regcache->raw_supply (SPARC32_PC_REGNUM, regs + gregmap->r_pc_offset);
if (regnum == SPARC32_NPC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_NPC_REGNUM,
- regs + gregmap->r_npc_offset);
+ regcache->raw_supply (SPARC32_NPC_REGNUM, regs + gregmap->r_npc_offset);
if (regnum == SPARC32_Y_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_Y_REGNUM,
- regs + gregmap->r_y_offset);
+ regcache->raw_supply (SPARC32_Y_REGNUM, regs + gregmap->r_y_offset);
if (regnum == SPARC_G0_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC_G0_REGNUM, &zero);
+ regcache->raw_supply (SPARC_G0_REGNUM, &zero);
if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_O7_REGNUM) || regnum == -1)
{
@@ -2118,7 +2114,7 @@ sparc32_supply_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_G1_REGNUM; i <= SPARC_O7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + offset);
+ regcache->raw_supply (i, regs + offset);
offset += 4;
}
}
@@ -2141,7 +2137,7 @@ sparc32_supply_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + offset);
+ regcache->raw_supply (i, regs + offset);
offset += 4;
}
}
@@ -2214,13 +2210,12 @@ sparc32_supply_fpregset (const struct sparc_fpregmap *fpregmap,
for (i = 0; i < 32; i++)
{
if (regnum == (SPARC_F0_REGNUM + i) || regnum == -1)
- regcache_raw_supply (regcache, SPARC_F0_REGNUM + i,
- regs + fpregmap->r_f0_offset + (i * 4));
+ regcache->raw_supply (SPARC_F0_REGNUM + i,
+ regs + fpregmap->r_f0_offset + (i * 4));
}
if (regnum == SPARC32_FSR_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_FSR_REGNUM,
- regs + fpregmap->r_fsr_offset);
+ regcache->raw_supply (SPARC32_FSR_REGNUM, regs + fpregmap->r_fsr_offset);
}
void
diff --git a/gdb/sparc64-fbsd-nat.c b/gdb/sparc64-fbsd-nat.c
index 20c6a28..4be8cde 100644
--- a/gdb/sparc64-fbsd-nat.c
+++ b/gdb/sparc64-fbsd-nat.c
@@ -46,12 +46,12 @@ sparc64fbsd_kvm_supply_pcb (struct regcache *regcache, struct pcb *pcb)
if (pcb->pcb_sp == 0)
return 0;
- regcache_raw_supply (regcache, SPARC_SP_REGNUM, &pcb->pcb_sp);
- regcache_raw_supply (regcache, SPARC64_PC_REGNUM, &pcb->pcb_pc);
+ regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp);
+ regcache->raw_supply (SPARC64_PC_REGNUM, &pcb->pcb_pc);
/* Synthesize %npc. */
pcb->pcb_pc += 4;
- regcache_raw_supply (regcache, SPARC64_NPC_REGNUM, &pcb->pcb_pc);
+ regcache->raw_supply (SPARC64_NPC_REGNUM, &pcb->pcb_pc);
/* Read `local' and `in' registers from the stack. */
sparc_supply_rwindow (regcache, pcb->pcb_sp, -1);
diff --git a/gdb/sparc64-nbsd-nat.c b/gdb/sparc64-nbsd-nat.c
index ac760b3..cb8643a 100644
--- a/gdb/sparc64-nbsd-nat.c
+++ b/gdb/sparc64-nbsd-nat.c
@@ -156,11 +156,11 @@ sparc64nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8),
(gdb_byte *)&pcb->pcb_pc, sizeof pcb->pcb_pc);
- regcache_raw_supply (regcache, SPARC_SP_REGNUM, &pcb->pcb_sp);
- regcache_raw_supply (regcache, SPARC64_PC_REGNUM, &pcb->pcb_pc);
+ regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp);
+ regcache->raw_supply (SPARC64_PC_REGNUM, &pcb->pcb_pc);
state = pcb->pcb_pstate << 8 | pcb->pcb_cwp;
- regcache_raw_supply (regcache, SPARC64_STATE_REGNUM, &state);
+ regcache->raw_supply (SPARC64_STATE_REGNUM, &state);
sparc_supply_rwindow (regcache, pcb->pcb_sp, -1);
diff --git a/gdb/sparc64-obsd-nat.c b/gdb/sparc64-obsd-nat.c
index eeef363..593a7ac 100644
--- a/gdb/sparc64-obsd-nat.c
+++ b/gdb/sparc64-obsd-nat.c
@@ -95,11 +95,11 @@ sparc64obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8),
(gdb_byte *)&pcb->pcb_pc, sizeof pcb->pcb_pc);
- regcache_raw_supply (regcache, SPARC_SP_REGNUM, &pcb->pcb_sp);
- regcache_raw_supply (regcache, SPARC64_PC_REGNUM, &pcb->pcb_pc);
+ regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp);
+ regcache->raw_supply (SPARC64_PC_REGNUM, &pcb->pcb_pc);
state = pcb->pcb_pstate << 8 | pcb->pcb_cwp;
- regcache_raw_supply (regcache, SPARC64_STATE_REGNUM, &state);
+ regcache->raw_supply (SPARC64_STATE_REGNUM, &state);
sparc_supply_rwindow (regcache, pcb->pcb_sp, -1);
diff --git a/gdb/sparc64-obsd-tdep.c b/gdb/sparc64-obsd-tdep.c
index f18b593..6af5f08 100644
--- a/gdb/sparc64-obsd-tdep.c
+++ b/gdb/sparc64-obsd-tdep.c
@@ -334,7 +334,7 @@ sparc64obsd_supply_uthread (struct regcache *regcache,
if (regnum == SPARC_SP_REGNUM || regnum == -1)
{
store_unsigned_integer (buf, 8, byte_order, fp);
- regcache_raw_supply (regcache, SPARC_SP_REGNUM, buf);
+ regcache->raw_supply (SPARC_SP_REGNUM, buf);
if (regnum == SPARC_SP_REGNUM)
return;
@@ -349,12 +349,12 @@ sparc64obsd_supply_uthread (struct regcache *regcache,
if (regnum == SPARC64_PC_REGNUM || regnum == -1)
{
store_unsigned_integer (buf, 8, byte_order, i7 + 8);
- regcache_raw_supply (regcache, SPARC64_PC_REGNUM, buf);
+ regcache->raw_supply (SPARC64_PC_REGNUM, buf);
}
if (regnum == SPARC64_NPC_REGNUM || regnum == -1)
{
store_unsigned_integer (buf, 8, byte_order, i7 + 12);
- regcache_raw_supply (regcache, SPARC64_NPC_REGNUM, buf);
+ regcache->raw_supply (SPARC64_NPC_REGNUM, buf);
}
if (regnum == SPARC64_PC_REGNUM || regnum == SPARC64_NPC_REGNUM)
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index dea8e4d..083ad72 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -1897,36 +1897,36 @@ sparc64_supply_gregset (const struct sparc_gregmap *gregmap,
psr = ((tstate & TSTATE_CWP) | PSR_S | ((tstate & TSTATE_ICC) >> 12)
| ((tstate & TSTATE_XCC) >> 20) | PSR_V8PLUS);
store_unsigned_integer (buf, 4, byte_order, psr);
- regcache_raw_supply (regcache, SPARC32_PSR_REGNUM, buf);
+ regcache->raw_supply (SPARC32_PSR_REGNUM, buf);
}
if (regnum == SPARC32_PC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_PC_REGNUM,
- regs + gregmap->r_pc_offset + 4);
+ regcache->raw_supply (SPARC32_PC_REGNUM,
+ regs + gregmap->r_pc_offset + 4);
if (regnum == SPARC32_NPC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_NPC_REGNUM,
- regs + gregmap->r_npc_offset + 4);
+ regcache->raw_supply (SPARC32_NPC_REGNUM,
+ regs + gregmap->r_npc_offset + 4);
if (regnum == SPARC32_Y_REGNUM || regnum == -1)
{
int offset = gregmap->r_y_offset + 8 - gregmap->r_y_size;
- regcache_raw_supply (regcache, SPARC32_Y_REGNUM, regs + offset);
+ regcache->raw_supply (SPARC32_Y_REGNUM, regs + offset);
}
}
else
{
if (regnum == SPARC64_STATE_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC64_STATE_REGNUM,
- regs + gregmap->r_tstate_offset);
+ regcache->raw_supply (SPARC64_STATE_REGNUM,
+ regs + gregmap->r_tstate_offset);
if (regnum == SPARC64_PC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC64_PC_REGNUM,
- regs + gregmap->r_pc_offset);
+ regcache->raw_supply (SPARC64_PC_REGNUM,
+ regs + gregmap->r_pc_offset);
if (regnum == SPARC64_NPC_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC64_NPC_REGNUM,
- regs + gregmap->r_npc_offset);
+ regcache->raw_supply (SPARC64_NPC_REGNUM,
+ regs + gregmap->r_npc_offset);
if (regnum == SPARC64_Y_REGNUM || regnum == -1)
{
@@ -1935,17 +1935,17 @@ sparc64_supply_gregset (const struct sparc_gregmap *gregmap,
memset (buf, 0, 8);
memcpy (buf + 8 - gregmap->r_y_size,
regs + gregmap->r_y_offset, gregmap->r_y_size);
- regcache_raw_supply (regcache, SPARC64_Y_REGNUM, buf);
+ regcache->raw_supply (SPARC64_Y_REGNUM, buf);
}
if ((regnum == SPARC64_FPRS_REGNUM || regnum == -1)
&& gregmap->r_fprs_offset != -1)
- regcache_raw_supply (regcache, SPARC64_FPRS_REGNUM,
- regs + gregmap->r_fprs_offset);
+ regcache->raw_supply (SPARC64_FPRS_REGNUM,
+ regs + gregmap->r_fprs_offset);
}
if (regnum == SPARC_G0_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC_G0_REGNUM, &zero);
+ regcache->raw_supply (SPARC_G0_REGNUM, &zero);
if ((regnum >= SPARC_G1_REGNUM && regnum <= SPARC_O7_REGNUM) || regnum == -1)
{
@@ -1957,7 +1957,7 @@ sparc64_supply_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_G1_REGNUM; i <= SPARC_O7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + offset);
+ regcache->raw_supply (i, regs + offset);
offset += 8;
}
}
@@ -1983,7 +1983,7 @@ sparc64_supply_gregset (const struct sparc_gregmap *gregmap,
for (i = SPARC_L0_REGNUM; i <= SPARC_I7_REGNUM; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + offset);
+ regcache->raw_supply (i, regs + offset);
offset += 8;
}
}
@@ -2112,14 +2112,14 @@ sparc64_supply_fpregset (const struct sparc_fpregmap *fpregmap,
for (i = 0; i < 32; i++)
{
if (regnum == (SPARC_F0_REGNUM + i) || regnum == -1)
- regcache_raw_supply (regcache, SPARC_F0_REGNUM + i,
+ regcache->raw_supply (SPARC_F0_REGNUM + i,
regs + fpregmap->r_f0_offset + (i * 4));
}
if (sparc32)
{
if (regnum == SPARC32_FSR_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC32_FSR_REGNUM,
+ regcache->raw_supply (SPARC32_FSR_REGNUM,
regs + fpregmap->r_fsr_offset);
}
else
@@ -2127,14 +2127,14 @@ sparc64_supply_fpregset (const struct sparc_fpregmap *fpregmap,
for (i = 0; i < 16; i++)
{
if (regnum == (SPARC64_F32_REGNUM + i) || regnum == -1)
- regcache_raw_supply (regcache, SPARC64_F32_REGNUM + i,
- (regs + fpregmap->r_f0_offset
- + (32 * 4) + (i * 8)));
+ regcache->raw_supply
+ (SPARC64_F32_REGNUM + i,
+ regs + fpregmap->r_f0_offset + (32 * 4) + (i * 8));
}
if (regnum == SPARC64_FSR_REGNUM || regnum == -1)
- regcache_raw_supply (regcache, SPARC64_FSR_REGNUM,
- regs + fpregmap->r_fsr_offset);
+ regcache->raw_supply (SPARC64_FSR_REGNUM,
+ regs + fpregmap->r_fsr_offset);
}
}
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 81bb5dd..6a5be8b 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -529,7 +529,7 @@ spu_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
gdb_byte buf[4];
store_unsigned_integer (buf, 4, byte_order, fd);
- regcache_raw_supply (regcache, SPU_ID_REGNUM, buf);
+ regcache->raw_supply (SPU_ID_REGNUM, buf);
}
/* The NPC register is found at ADDR. */
@@ -537,7 +537,7 @@ spu_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
gdb_byte buf[4];
if (fetch_ppc_memory (addr, buf, 4) == 0)
- regcache_raw_supply (regcache, SPU_PC_REGNUM, buf);
+ regcache->raw_supply (SPU_PC_REGNUM, buf);
}
/* The GPRs are found in the "regs" spufs file. */
@@ -553,7 +553,7 @@ spu_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
== TARGET_XFER_OK)
&& len == sizeof buf)
for (i = 0; i < SPU_NUM_GPRS; i++)
- regcache_raw_supply (regcache, i, buf + i*16);
+ regcache->raw_supply (i, buf + i*16);
}
}
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index 4a4d500..dc99f60 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -207,7 +207,7 @@ spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno)
{
gdb_byte buf[4];
store_unsigned_integer (buf, 4, byte_order, spufs_fd);
- regcache_raw_supply (regcache, SPU_ID_REGNUM, buf);
+ regcache->raw_supply (SPU_ID_REGNUM, buf);
}
/* The NPC register is found in PPC memory at SPUFS_ADDR. */
@@ -217,7 +217,7 @@ spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno)
if (target_read (ops_beneath, TARGET_OBJECT_MEMORY, NULL,
buf, spufs_addr, sizeof buf) == sizeof buf)
- regcache_raw_supply (regcache, SPU_PC_REGNUM, buf);
+ regcache->raw_supply (SPU_PC_REGNUM, buf);
}
/* The GPRs are found in the "regs" spufs file. */
@@ -231,7 +231,7 @@ spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno)
if (target_read (ops_beneath, TARGET_OBJECT_SPU, annex,
buf, 0, sizeof buf) == sizeof buf)
for (i = 0; i < SPU_NUM_GPRS; i++)
- regcache_raw_supply (regcache, i, buf + i*16);
+ regcache->raw_supply (i, buf + i*16);
}
}
diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c
index 9b596c0..1ff6485 100644
--- a/gdb/tilegx-linux-nat.c
+++ b/gdb/tilegx-linux-nat.c
@@ -88,7 +88,7 @@ supply_gregset (struct regcache* regcache,
for (i = 0; i < sizeof (regmap) / sizeof (regmap[0]); i++)
if (regmap[i] >= 0)
- regcache_raw_supply (regcache, i, regp + regmap[i]);
+ regcache->raw_supply (i, regp + regmap[i]);
}
/* Fill registers in *GREGSETPS with the values in GDB's
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 32f5722..2327d9e 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -898,12 +898,12 @@ tfile_target::fetch_registers (struct regcache *regcache, int regno)
{
if (regno == regn)
{
- regcache_raw_supply (regcache, regno, regs + offset);
+ regcache->raw_supply (regno, regs + offset);
break;
}
else if (regno == -1)
{
- regcache_raw_supply (regcache, regn, regs + offset);
+ regcache->raw_supply (regn, regs + offset);
}
}
}
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
index f7e69f2..ab34ecf 100644
--- a/gdb/tracefile.c
+++ b/gdb/tracefile.c
@@ -394,7 +394,7 @@ tracefile_fetch_registers (struct regcache *regcache, int regno)
/* We get here if no register data has been found. Mark registers
as unavailable. */
for (regn = 0; regn < gdbarch_num_regs (gdbarch); regn++)
- regcache_raw_supply (regcache, regn, NULL);
+ regcache->raw_supply (regn, NULL);
/* We can often usefully guess that the PC is going to be the same
as the address of the tracepoint. */
diff --git a/gdb/vax-bsd-nat.c b/gdb/vax-bsd-nat.c
index 5f67061..527d718 100644
--- a/gdb/vax-bsd-nat.c
+++ b/gdb/vax-bsd-nat.c
@@ -46,7 +46,7 @@ vaxbsd_supply_gregset (struct regcache *regcache, const void *gregs)
int regnum;
for (regnum = 0; regnum < VAX_NUM_REGS; regnum++)
- regcache_raw_supply (regcache, regnum, regs + regnum * 4);
+ regcache->raw_supply (regnum, regs + regnum * 4);
}
/* Collect the general-purpose registers from REGCACHE and store them
@@ -122,12 +122,12 @@ vaxbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb)
return 0;
for (regnum = VAX_R0_REGNUM; regnum < VAX_AP_REGNUM; regnum++)
- regcache_raw_supply (regcache, regnum, &pcb->R[regnum - VAX_R0_REGNUM]);
- regcache_raw_supply (regcache, VAX_AP_REGNUM, &pcb->AP);
- regcache_raw_supply (regcache, VAX_FP_REGNUM, &pcb->FP);
- regcache_raw_supply (regcache, VAX_SP_REGNUM, &pcb->KSP);
- regcache_raw_supply (regcache, VAX_PC_REGNUM, &pcb->PC);
- regcache_raw_supply (regcache, VAX_PS_REGNUM, &pcb->PSL);
+ regcache->raw_supply (regnum, &pcb->R[regnum - VAX_R0_REGNUM]);
+ regcache->raw_supply (VAX_AP_REGNUM, &pcb->AP);
+ regcache->raw_supply (VAX_FP_REGNUM, &pcb->FP);
+ regcache->raw_supply (VAX_SP_REGNUM, &pcb->KSP);
+ regcache->raw_supply (VAX_PC_REGNUM, &pcb->PC);
+ regcache->raw_supply (VAX_PS_REGNUM, &pcb->PSL);
return 1;
}
diff --git a/gdb/vax-tdep.c b/gdb/vax-tdep.c
index de07fdb..d07a477 100644
--- a/gdb/vax-tdep.c
+++ b/gdb/vax-tdep.c
@@ -76,7 +76,7 @@ vax_supply_gregset (const struct regset *regset, struct regcache *regcache,
for (i = 0; i < VAX_NUM_REGS; i++)
{
if (regnum == i || regnum == -1)
- regcache_raw_supply (regcache, i, regs + i * 4);
+ regcache->raw_supply (i, regs + i * 4);
}
}
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 3fd8415..2d6ece0 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -555,12 +555,12 @@ do_windows_fetch_inferior_registers (struct regcache *regcache,
if (r == I387_FISEG_REGNUM (tdep))
{
l = *((long *) context_offset) & 0xffff;
- regcache_raw_supply (regcache, r, (char *) &l);
+ regcache->raw_supply (r, (char *) &l);
}
else if (r == I387_FOP_REGNUM (tdep))
{
l = (*((long *) context_offset) >> 16) & ((1 << 11) - 1);
- regcache_raw_supply (regcache, r, (char *) &l);
+ regcache->raw_supply (r, (char *) &l);
}
else if (segment_register_p (r))
{
@@ -568,10 +568,10 @@ do_windows_fetch_inferior_registers (struct regcache *regcache,
in fact only 16 bits long. Make sure we do not read extra
bits from our source buffer. */
l = *((long *) context_offset) & 0xffff;
- regcache_raw_supply (regcache, r, (char *) &l);
+ regcache->raw_supply (r, (char *) &l);
}
else if (r >= 0)
- regcache_raw_supply (regcache, r, context_offset);
+ regcache->raw_supply (r, context_offset);
else
{
for (r = 0; r < gdbarch_num_regs (gdbarch); r++)
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index 57a44e3..8737a9a 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -134,63 +134,54 @@ supply_gregset_reg (struct regcache *regcache,
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
- regcache_raw_supply (regcache, gdbarch_pc_regnum (gdbarch), ®s->pc);
+ regcache->raw_supply (gdbarch_pc_regnum (gdbarch), ®s->pc);
if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
- regcache_raw_supply (regcache, gdbarch_ps_regnum (gdbarch), ®s->ps);
+ regcache->raw_supply (gdbarch_ps_regnum (gdbarch), ®s->ps);
if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->wb_regnum,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->wb_regnum,
®s->windowbase);
if (regnum == gdbarch_tdep (gdbarch)->ws_regnum || regnum == -1)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->ws_regnum,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->ws_regnum,
®s->windowstart);
if (regnum == gdbarch_tdep (gdbarch)->lbeg_regnum || regnum == -1)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->lbeg_regnum,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->lbeg_regnum,
®s->lbeg);
if (regnum == gdbarch_tdep (gdbarch)->lend_regnum || regnum == -1)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->lend_regnum,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->lend_regnum,
®s->lend);
if (regnum == gdbarch_tdep (gdbarch)->lcount_regnum || regnum == -1)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->lcount_regnum,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->lcount_regnum,
®s->lcount);
if (regnum == gdbarch_tdep (gdbarch)->sar_regnum || regnum == -1)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->sar_regnum,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->sar_regnum,
®s->sar);
if (regnum == gdbarch_tdep (gdbarch)->threadptr_regnum || regnum == -1)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->threadptr_regnum,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->threadptr_regnum,
®s->threadptr);
if (regnum >=gdbarch_tdep (gdbarch)->ar_base
&& regnum < gdbarch_tdep (gdbarch)->ar_base
+ gdbarch_tdep (gdbarch)->num_aregs)
- regcache_raw_supply (regcache,regnum,
+ regcache->raw_supply (regnum,
®s->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]);
else if (regnum == -1)
{
for (i = 0; i < gdbarch_tdep (gdbarch)->num_aregs; ++i)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->ar_base + i,
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->ar_base + i,
®s->ar[i]);
}
if (regnum >= gdbarch_tdep (gdbarch)->a0_base
&& regnum < gdbarch_tdep (gdbarch)->a0_base + C0_NREGS)
- regcache_raw_supply (regcache, regnum,
- ®s->ar[(4 * regs->windowbase + regnum
- - gdbarch_tdep (gdbarch)->a0_base)
+ regcache->raw_supply (regnum,
+ ®s->ar[(4 * regs->windowbase + regnum
+ - gdbarch_tdep (gdbarch)->a0_base)
% gdbarch_tdep (gdbarch)->num_aregs]);
else if (regnum == -1)
{
for (i = 0; i < C0_NREGS; ++i)
- regcache_raw_supply (regcache,
- gdbarch_tdep (gdbarch)->a0_base + i,
- ®s->ar[(4 * regs->windowbase + i)
- % gdbarch_tdep (gdbarch)->num_aregs]);
+ regcache->raw_supply (gdbarch_tdep (gdbarch)->a0_base + i,
+ ®s->ar[(4 * regs->windowbase + i)
+ % gdbarch_tdep (gdbarch)->num_aregs]);
}
}
@@ -276,8 +267,7 @@ fetch_xtregs (struct regcache *regcache, int regnum)
for (ptr = xtensa_regmap_table; ptr->name; ptr++)
if (regnum == ptr->gdb_regnum || regnum == -1)
- regcache_raw_supply (regcache, ptr->gdb_regnum,
- xtregs + ptr->ptrace_offset);
+ regcache->raw_supply (ptr->gdb_regnum, xtregs + ptr->ptrace_offset);
}
static void
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index 1f87b9c..60e34c3 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -848,38 +848,37 @@ xtensa_supply_gregset (const struct regset *regset,
DEBUGTRACE ("xtensa_supply_gregset (..., regnum==%d, ...)\n", regnum);
if (regnum == gdbarch_pc_regnum (gdbarch) || regnum == -1)
- regcache_raw_supply (rc, gdbarch_pc_regnum (gdbarch), (char *) ®s->pc);
+ rc->raw_supply (gdbarch_pc_regnum (gdbarch), (char *) ®s->pc);
if (regnum == gdbarch_ps_regnum (gdbarch) || regnum == -1)
- regcache_raw_supply (rc, gdbarch_ps_regnum (gdbarch), (char *) ®s->ps);
+ rc->raw_supply (gdbarch_ps_regnum (gdbarch), (char *) ®s->ps);
if (regnum == gdbarch_tdep (gdbarch)->wb_regnum || regnum == -1)
- regcache_raw_supply (rc, gdbarch_tdep (gdbarch)->wb_regnum,
- (char *) ®s->windowbase);
+ rc->raw_supply (gdbarch_tdep (gdbarch)->wb_regnum,
+ (char *) ®s->windowbase);
if (regnum == gdbarch_tdep (gdbarch)->ws_regnum || regnum == -1)
- regcache_raw_supply (rc, gdbarch_tdep (gdbarch)->ws_regnum,
- (char *) ®s->windowstart);
+ rc->raw_supply (gdbarch_tdep (gdbarch)->ws_regnum,
+ (char *) ®s->windowstart);
if (regnum == gdbarch_tdep (gdbarch)->lbeg_regnum || regnum == -1)
- regcache_raw_supply (rc, gdbarch_tdep (gdbarch)->lbeg_regnum,
- (char *) ®s->lbeg);
+ rc->raw_supply (gdbarch_tdep (gdbarch)->lbeg_regnum,
+ (char *) ®s->lbeg);
if (regnum == gdbarch_tdep (gdbarch)->lend_regnum || regnum == -1)
- regcache_raw_supply (rc, gdbarch_tdep (gdbarch)->lend_regnum,
- (char *) ®s->lend);
+ rc->raw_supply (gdbarch_tdep (gdbarch)->lend_regnum,
+ (char *) ®s->lend);
if (regnum == gdbarch_tdep (gdbarch)->lcount_regnum || regnum == -1)
- regcache_raw_supply (rc, gdbarch_tdep (gdbarch)->lcount_regnum,
- (char *) ®s->lcount);
+ rc->raw_supply (gdbarch_tdep (gdbarch)->lcount_regnum,
+ (char *) ®s->lcount);
if (regnum == gdbarch_tdep (gdbarch)->sar_regnum || regnum == -1)
- regcache_raw_supply (rc, gdbarch_tdep (gdbarch)->sar_regnum,
- (char *) ®s->sar);
+ rc->raw_supply (gdbarch_tdep (gdbarch)->sar_regnum,
+ (char *) ®s->sar);
if (regnum >=gdbarch_tdep (gdbarch)->ar_base
&& regnum < gdbarch_tdep (gdbarch)->ar_base
+ gdbarch_tdep (gdbarch)->num_aregs)
- regcache_raw_supply (rc, regnum,
- (char *) ®s->ar[regnum - gdbarch_tdep
- (gdbarch)->ar_base]);
+ rc->raw_supply
+ (regnum, (char *) ®s->ar[regnum - gdbarch_tdep (gdbarch)->ar_base]);
else if (regnum == -1)
{
for (i = 0; i < gdbarch_tdep (gdbarch)->num_aregs; ++i)
- regcache_raw_supply (rc, gdbarch_tdep (gdbarch)->ar_base + i,
- (char *) ®s->ar[i]);
+ rc->raw_supply (gdbarch_tdep (gdbarch)->ar_base + i,
+ (char *) ®s->ar[i]);
}
}
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 11/15] Remove regcache_cooked_read_value
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (5 preceding siblings ...)
2018-05-30 19:05 ` [pushed 06/15] Remove regcache_cooked_read Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 03/15] Remove regcache_raw_update Simon Marchi
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_cooked_read_value, update callers to use
readable_regcache::cooked_read_value.
gdb/ChangeLog:
* regcache.h (regcache_cooked_read_value): Remove, update
callers to use readable_regcache::cooked_read_value.
* regcache.c (regcache_cooked_read_value): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/regcache.c | 6 ------
gdb/regcache.h | 8 ++------
gdb/sentinel-frame.c | 2 +-
4 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2d1dfb6..4e0b3a2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_cooked_read_value): Remove, update
+ callers to use readable_regcache::cooked_read_value.
+ * regcache.c (regcache_cooked_read_value): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_cooked_write): Remove, update callers to
use regcache::cooked_write.
* regcache.c (regcache_cooked_write): Remove.
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 0e2d040..ee27f9d 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -639,12 +639,6 @@ readable_regcache::cooked_read (int regnum, gdb_byte *buf)
}
struct value *
-regcache_cooked_read_value (struct regcache *regcache, int regnum)
-{
- return regcache->cooked_read_value (regnum);
-}
-
-struct value *
readable_regcache::cooked_read_value (int regnum)
{
gdb_assert (regnum >= 0);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 4be1ae1..3497207 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -50,12 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache,
extern LONGEST regcache_raw_get_signed (struct regcache *regcache,
int regnum);
-/* Read register REGNUM from REGCACHE and return a new value. This
- will call mark_value_bytes_unavailable as appropriate. */
-
-struct value *regcache_cooked_read_value (struct regcache *regcache,
- int regnum);
-
/* Read a register as a signed/unsigned quantity. */
extern enum register_status
regcache_cooked_read_signed (struct regcache *regcache,
@@ -239,6 +233,8 @@ public:
enum register_status cooked_read_part (int regnum, int offset, int len,
gdb_byte *buf);
+ /* Read register REGNUM from the regcache and return a new value. This
+ will call mark_value_bytes_unavailable as appropriate. */
struct value *cooked_read_value (int regnum);
protected:
diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c
index cbb4a09..282e29e 100644
--- a/gdb/sentinel-frame.c
+++ b/gdb/sentinel-frame.c
@@ -50,7 +50,7 @@ sentinel_frame_prev_register (struct frame_info *this_frame,
= (struct frame_unwind_cache *) *this_prologue_cache;
struct value *value;
- value = regcache_cooked_read_value (cache->regcache, regnum);
+ value = cache->regcache->cooked_read_value (regnum);
VALUE_NEXT_FRAME_ID (value) = sentinel_frame_id;
return value;
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 04/15] Remove regcache_raw_read
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (9 preceding siblings ...)
2018-05-30 19:05 ` [pushed 14/15] Remove regcache_raw_supply Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 07/15] Remove regcache_raw_read_part Simon Marchi
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_raw_read, update all callers to use
readable_regcache::raw_read instead.
gdb/ChangeLog:
* regcache.h (regcache_raw_read): Remove, update callers to use
readable_regcache::raw_read instead.
* regcache.c (regcache_raw_read): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/amd64-tdep.c | 11 +++++------
gdb/arm-tdep.c | 2 +-
gdb/bfin-tdep.c | 2 +-
gdb/frv-tdep.c | 2 +-
gdb/i386-tdep.c | 19 +++++++++----------
gdb/m68hc11-tdep.c | 6 +++---
gdb/m68k-tdep.c | 10 +++++-----
gdb/mn10300-tdep.c | 6 +++---
gdb/moxie-tdep.c | 25 ++++++++++++-------------
gdb/nds32-tdep.c | 2 +-
gdb/record-full.c | 2 +-
gdb/regcache.c | 6 ------
gdb/regcache.h | 5 +++--
gdb/s390-tdep.c | 2 +-
gdb/sh-tdep.c | 6 +++---
gdb/spu-tdep.c | 2 +-
gdb/tilegx-tdep.c | 2 +-
gdb/v850-tdep.c | 2 +-
gdb/xstormy16-tdep.c | 2 +-
gdb/xtensa-tdep.c | 4 ++--
21 files changed, 61 insertions(+), 63 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4f451a2..4b7bfad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_raw_read): Remove, update callers to use
+ readable_regcache::raw_read instead.
+ * regcache.c (regcache_raw_read): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_raw_update): Remove, update callers to
use readable_regcache::raw_update instead.
* regcache.c (regcache_raw_update): Remove.
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index d555465..0eac35e 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -422,8 +422,7 @@ amd64_pseudo_register_write (struct gdbarch *gdbarch,
if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
{
/* Read ... AH, BH, CH, DH. */
- regcache_raw_read (regcache,
- gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
+ regcache->raw_read (gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf + 1, buf, 1);
/* ... Write. */
@@ -433,7 +432,7 @@ amd64_pseudo_register_write (struct gdbarch *gdbarch,
else
{
/* Read ... */
- regcache_raw_read (regcache, gpnum, raw_buf);
+ regcache->raw_read (gpnum, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 1);
/* ... Write. */
@@ -445,7 +444,7 @@ amd64_pseudo_register_write (struct gdbarch *gdbarch,
int gpnum = regnum - tdep->eax_regnum;
/* Read ... */
- regcache_raw_read (regcache, gpnum, raw_buf);
+ regcache->raw_read (gpnum, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 4);
/* ... Write. */
@@ -771,8 +770,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
{
if (readbuf)
{
- regcache_raw_read (regcache, AMD64_ST0_REGNUM, readbuf);
- regcache_raw_read (regcache, AMD64_ST1_REGNUM, readbuf + 16);
+ regcache->raw_read (AMD64_ST0_REGNUM, readbuf);
+ regcache->raw_read (AMD64_ST1_REGNUM, readbuf + 16);
}
if (writebuf)
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 382080a..7fa0db3 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -8800,7 +8800,7 @@ arm_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
double_regnum = user_reg_map_name_to_regnum (gdbarch, name_buf,
strlen (name_buf));
- regcache_raw_read (regcache, double_regnum, reg_buf);
+ regcache->raw_read (double_regnum, reg_buf);
memcpy (reg_buf + offset, buf, 4);
regcache_raw_write (regcache, double_regnum, reg_buf);
}
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index 63fbf62..66a9465 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -719,7 +719,7 @@ bfin_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
_("invalid register number %d"), regnum);
/* Overlay the CC bit in the ASTAT register. */
- regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
+ regcache->raw_read (BFIN_ASTAT_REGNUM, buf);
buf[0] = (buf[0] & ~ASTAT_CC) | ((buffer[0] & 1) << ASTAT_CC_POS);
regcache_raw_write (regcache, BFIN_ASTAT_REGNUM, buf);
}
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 2f9a8d2..04bb43b 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -349,7 +349,7 @@ frv_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int byte_num = (reg - accg0_regnum) % 4;
gdb_byte buf[4];
- regcache_raw_read (regcache, raw_regnum, buf);
+ regcache->raw_read (raw_regnum, buf);
buf[byte_num] = ((bfd_byte *) buffer)[0];
regcache_raw_write (regcache, raw_regnum, buf);
}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 646f305..0a4e4d7 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2802,7 +2802,7 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
its contents to the desired type. This is probably not
exactly how it would happen on the target itself, but it is
the best we can do. */
- regcache_raw_read (regcache, I386_ST0_REGNUM, buf);
+ regcache->raw_read (I386_ST0_REGNUM, buf);
target_float_convert (buf, i387_ext_type (gdbarch), valbuf, type);
}
else
@@ -2812,14 +2812,14 @@ i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
if (len <= low_size)
{
- regcache_raw_read (regcache, LOW_RETURN_REGNUM, buf);
+ regcache->raw_read (LOW_RETURN_REGNUM, buf);
memcpy (valbuf, buf, len);
}
else if (len <= (low_size + high_size))
{
- regcache_raw_read (regcache, LOW_RETURN_REGNUM, buf);
+ regcache->raw_read (LOW_RETURN_REGNUM, buf);
memcpy (valbuf, buf, low_size);
- regcache_raw_read (regcache, HIGH_RETURN_REGNUM, buf);
+ regcache->raw_read (HIGH_RETURN_REGNUM, buf);
memcpy (valbuf + low_size, buf, len - low_size);
}
else
@@ -3474,7 +3474,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int fpnum = i386_mmx_regnum_to_fp_regnum (regcache, regnum);
/* Read ... */
- regcache_raw_read (regcache, fpnum, raw_buf);
+ regcache->raw_read (fpnum, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, register_size (gdbarch, regnum));
/* ... Write. */
@@ -3496,9 +3496,8 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
upper = extract_unsigned_integer (buf + size, size, byte_order);
/* Fetching register buffer. */
- regcache_raw_read (regcache,
- I387_BND0R_REGNUM (tdep) + regnum,
- raw_buf);
+ regcache->raw_read (I387_BND0R_REGNUM (tdep) + regnum,
+ raw_buf);
upper = ~upper;
@@ -3583,7 +3582,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int gpnum = regnum - tdep->ax_regnum;
/* Read ... */
- regcache_raw_read (regcache, gpnum, raw_buf);
+ regcache->raw_read (gpnum, raw_buf);
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 2);
/* ... Write. */
@@ -3594,7 +3593,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int gpnum = regnum - tdep->al_regnum;
/* Read ... We read both lower and upper registers. */
- regcache_raw_read (regcache, gpnum % 4, raw_buf);
+ regcache->raw_read (gpnum % 4, raw_buf);
/* ... Modify ... (always little endian). */
if (gpnum >= 4)
memcpy (raw_buf + 1, buf, 1);
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index d6f3593..bce95e9 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1280,7 +1280,7 @@ m68hc11_extract_return_value (struct type *type, struct regcache *regcache,
{
gdb_byte buf[M68HC11_REG_SIZE];
- regcache_raw_read (regcache, HARD_D_REGNUM, buf);
+ regcache->raw_read (HARD_D_REGNUM, buf);
switch (TYPE_LENGTH (type))
{
case 1:
@@ -1293,13 +1293,13 @@ m68hc11_extract_return_value (struct type *type, struct regcache *regcache,
case 3:
memcpy ((char*) valbuf + 1, buf, 2);
- regcache_raw_read (regcache, HARD_X_REGNUM, buf);
+ regcache->raw_read (HARD_X_REGNUM, buf);
memcpy (valbuf, buf + 1, 1);
break;
case 4:
memcpy ((char*) valbuf + 2, buf, 2);
- regcache_raw_read (regcache, HARD_X_REGNUM, buf);
+ regcache->raw_read (HARD_X_REGNUM, buf);
memcpy (valbuf, buf, 2);
break;
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index b9fa5e6..a6a1bb4 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -286,14 +286,14 @@ m68k_extract_return_value (struct type *type, struct regcache *regcache,
if (len <= 4)
{
- regcache_raw_read (regcache, M68K_D0_REGNUM, buf);
+ regcache->raw_read (M68K_D0_REGNUM, buf);
memcpy (valbuf, buf + (4 - len), len);
}
else if (len <= 8)
{
- regcache_raw_read (regcache, M68K_D0_REGNUM, buf);
+ regcache->raw_read (M68K_D0_REGNUM, buf);
memcpy (valbuf, buf + (8 - len), len - 4);
- regcache_raw_read (regcache, M68K_D1_REGNUM, valbuf + (len - 4));
+ regcache->raw_read (M68K_D1_REGNUM, valbuf + (len - 4));
}
else
internal_error (__FILE__, __LINE__,
@@ -311,11 +311,11 @@ m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache,
if (tdep->float_return && TYPE_CODE (type) == TYPE_CODE_FLT)
{
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
- regcache_raw_read (regcache, M68K_FP0_REGNUM, buf);
+ regcache->raw_read (M68K_FP0_REGNUM, buf);
target_float_convert (buf, fpreg_type, valbuf, type);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
- regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf);
+ regcache->raw_read (M68K_A0_REGNUM, valbuf);
else
m68k_extract_return_value (type, regcache, valbuf);
}
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index e12e01d..c8267cf 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -212,15 +212,15 @@ mn10300_extract_return_value (struct gdbarch *gdbarch, struct type *type,
gdb_assert (regsz <= MN10300_MAX_REGISTER_SIZE);
if (len <= regsz)
{
- regcache_raw_read (regcache, reg, buf);
+ regcache->raw_read (reg, buf);
memcpy (valbuf, buf, len);
}
else if (len <= 2 * regsz)
{
- regcache_raw_read (regcache, reg, buf);
+ regcache->raw_read (reg, buf);
memcpy (valbuf, buf, regsz);
gdb_assert (regsz == register_size (gdbarch, reg + 1));
- regcache_raw_read (regcache, reg + 1, buf);
+ regcache->raw_read (reg + 1, buf);
memcpy ((char *) valbuf + regsz, buf, len - regsz);
}
else
diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c
index 50cacfe..078ff39 100644
--- a/gdb/moxie-tdep.c
+++ b/gdb/moxie-tdep.c
@@ -433,8 +433,7 @@ moxie_software_single_step (struct regcache *regcache)
case 0x19: /* jsr */
case 0x25: /* jmp */
- regcache_raw_read (regcache,
- (inst >> 4) & 0xf, (gdb_byte *) & tmpu32);
+ regcache->raw_read ((inst >> 4) & 0xf, (gdb_byte *) & tmpu32);
next_pcs.push_back (tmpu32);
break;
@@ -734,7 +733,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
break;
case 0x03: /* jsra */
{
- regcache_raw_read (regcache,
+ regcache->raw_read (
MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
@@ -763,7 +762,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
case 0x06: /* push */
{
int reg = (inst >> 4) & 0xf;
- regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
+ regcache->raw_read (reg, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_reg (regcache, reg)
@@ -805,7 +804,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
case 0x0b: /* st.l */
{
int reg = (inst >> 4) & 0xf;
- regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
+ regcache->raw_read (reg, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_mem (tmpu32, 4))
@@ -824,7 +823,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
int reg = (inst >> 4) & 0xf;
uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2,
byte_order)) << 16 ) >> 16;
- regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
+ regcache->raw_read (reg, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
tmpu32 += offset;
@@ -864,7 +863,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
}
case 0x19: /* jsr */
{
- regcache_raw_read (regcache,
+ regcache->raw_read (
MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
@@ -892,7 +891,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
case 0x1e: /* st.b */
{
int reg = (inst >> 4) & 0xf;
- regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
+ regcache->raw_read (reg, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_mem (tmpu32, 1))
@@ -918,7 +917,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
case 0x23: /* st.s */
{
int reg = (inst >> 4) & 0xf;
- regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
+ regcache->raw_read (reg, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
if (record_full_arch_list_add_mem (tmpu32, 2))
@@ -978,12 +977,12 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
uint32_t length, ptr;
/* Read buffer pointer is in $r1. */
- regcache_raw_read (regcache, 3, (gdb_byte *) & ptr);
+ regcache->raw_read (3, (gdb_byte *) & ptr);
ptr = extract_unsigned_integer ((gdb_byte *) & ptr,
4, byte_order);
/* String length is at 0x12($fp). */
- regcache_raw_read (regcache,
+ regcache->raw_read (
MOXIE_FP_REGNUM, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
@@ -1029,7 +1028,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
int reg = (inst >> 4) & 0xf;
uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2,
byte_order)) << 16 ) >> 16;
- regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
+ regcache->raw_read (reg, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
tmpu32 += offset;
@@ -1049,7 +1048,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache,
int reg = (inst >> 4) & 0xf;
uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2,
byte_order)) << 16 ) >> 16;
- regcache_raw_read (regcache, reg, (gdb_byte *) & tmpu32);
+ regcache->raw_read (reg, (gdb_byte *) & tmpu32);
tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32,
4, byte_order);
tmpu32 += offset;
diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
index 8cc9d5b..991a870 100644
--- a/gdb/nds32-tdep.c
+++ b/gdb/nds32-tdep.c
@@ -500,7 +500,7 @@ nds32_pseudo_register_write (struct gdbarch *gdbarch,
offset = (regnum & 1) ? 0 : 4;
fdr_regnum = NDS32_FD0_REGNUM + (regnum >> 1);
- regcache_raw_read (regcache, fdr_regnum, reg_buf);
+ regcache->raw_read (fdr_regnum, reg_buf);
memcpy (reg_buf + offset, buf, 4);
regcache_raw_write (regcache, fdr_regnum, reg_buf);
return;
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 79f5c0f..9b67007 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -620,7 +620,7 @@ record_full_arch_list_add_reg (struct regcache *regcache, int regnum)
rec = record_full_reg_alloc (regcache, regnum);
- regcache_raw_read (regcache, regnum, record_full_get_loc (rec));
+ regcache->raw_read (regnum, record_full_get_loc (rec));
record_full_arch_list_add (rec);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 64d167a..5551408 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -511,12 +511,6 @@ regcache::raw_update (int regnum)
}
enum register_status
-regcache_raw_read (struct regcache *regcache, int regnum, gdb_byte *buf)
-{
- return regcache->raw_read (regnum, buf);
-}
-
-enum register_status
readable_regcache::raw_read (int regnum, gdb_byte *buf)
{
gdb_assert (buf != NULL);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index dffc27f..3735852 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -38,8 +38,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
regcache. The read variants return the status of the register. */
-enum register_status regcache_raw_read (struct regcache *regcache,
- int rawnum, gdb_byte *buf);
void regcache_raw_write (struct regcache *regcache, int rawnum,
const gdb_byte *buf);
extern enum register_status
@@ -246,6 +244,9 @@ public:
: reg_buffer (gdbarch, has_pseudo)
{}
+ /* Transfer a raw register [0..NUM_REGS) from core-gdb to this regcache,
+ return its value in *BUF and return its availability status. */
+
enum register_status raw_read (int regnum, gdb_byte *buf);
template<typename T, typename = RequireLongest<T>>
enum register_status raw_read (int regnum, T *val);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 4af035f..aecdbbd 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -2816,7 +2816,7 @@ s390_record_calc_disp_vsce (struct gdbarch *gdbarch, struct regcache *regcache,
if (vx < 16)
regcache_cooked_read (regcache, tdep->v0_full_regnum + vx, buf);
else
- regcache_raw_read (regcache, S390_V16_REGNUM + vx - 16, buf);
+ regcache->raw_read (S390_V16_REGNUM + vx - 16, buf);
x = extract_unsigned_integer (buf + el * es, es, byte_order);
*res = s390_record_calc_disp_common (gdbarch, regcache, x, bd, dh);
return 0;
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index edf7e94..c9439f8 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1324,7 +1324,7 @@ sh_extract_return_value_nofpu (struct type *type, struct regcache *regcache,
{
int i, regnum = R0_REGNUM;
for (i = 0; i < len; i += 4)
- regcache_raw_read (regcache, regnum++, valbuf + i);
+ regcache->raw_read (regnum++, valbuf + i);
}
else
error (_("bad size for return value"));
@@ -1341,10 +1341,10 @@ sh_extract_return_value_fpu (struct type *type, struct regcache *regcache,
int i, regnum = gdbarch_fp0_regnum (gdbarch);
for (i = 0; i < len; i += 4)
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
- regcache_raw_read (regcache, regnum++,
+ regcache->raw_read (regnum++,
valbuf + len - 4 - i);
else
- regcache_raw_read (regcache, regnum++, valbuf + i);
+ regcache->raw_read (regnum++, valbuf + i);
}
else
sh_extract_return_value_nofpu (type, regcache, valbuf);
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 2567c24..fd6d098 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -278,7 +278,7 @@ spu_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
switch (regnum)
{
case SPU_SP_REGNUM:
- regcache_raw_read (regcache, SPU_RAW_SP_REGNUM, reg);
+ regcache->raw_read (SPU_RAW_SP_REGNUM, reg);
memcpy (reg, buf, 4);
regcache_raw_write (regcache, SPU_RAW_SP_REGNUM, reg);
break;
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index 8f688b1..e11ecdd 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -219,7 +219,7 @@ tilegx_extract_return_value (struct type *type, struct regcache *regcache,
int i, regnum = TILEGX_R0_REGNUM;
for (i = 0; i < len; i += tilegx_reg_size)
- regcache_raw_read (regcache, regnum++, valbuf + i);
+ regcache->raw_read (regnum++, valbuf + i);
}
/* Copy the function return value from VALBUF into the proper
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index ac7d6aa..a8bc599 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1128,7 +1128,7 @@ v850_extract_return_value (struct type *type, struct regcache *regcache,
gdb_byte buf[v850_reg_size];
for (i = 0; len > 0; i += 4, len -= 4)
{
- regcache_raw_read (regcache, regnum++, buf);
+ regcache->raw_read (regnum++, buf);
memcpy (valbuf + i, buf, len > 4 ? 4 : len);
}
}
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 31650ac..805c7f2 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -163,7 +163,7 @@ xstormy16_extract_return_value (struct type *type, struct regcache *regcache,
int i, regnum = E_1ST_ARG_REGNUM;
for (i = 0; i < len; i += xstormy16_reg_size)
- regcache_raw_read (regcache, regnum++, valbuf + i);
+ regcache->raw_read (regnum++, valbuf + i);
}
/* Function: xstormy16_store_return_value
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index 01f9616..32533e8 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -1598,7 +1598,7 @@ xtensa_extract_return_value (struct type *type,
if (len < 4)
regcache_raw_read_part (regcache, areg, offset, len, valbuf);
else
- regcache_raw_read (regcache, areg, valbuf);
+ regcache->raw_read (areg, valbuf);
}
}
@@ -1928,7 +1928,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
to modify WINDOWSTART register to make it look like there
is only one register window corresponding to WINDOWEBASE. */
- regcache_raw_read (regcache, gdbarch_tdep (gdbarch)->wb_regnum, buf);
+ regcache->raw_read (gdbarch_tdep (gdbarch)->wb_regnum, buf);
regcache_cooked_write_unsigned
(regcache, gdbarch_tdep (gdbarch)->ws_regnum,
1 << extract_unsigned_integer (buf, 4, byte_order));
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 09/15] Remove regcache_invalidate
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (7 preceding siblings ...)
2018-05-30 19:05 ` [pushed 03/15] Remove regcache_raw_update Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 14/15] Remove regcache_raw_supply Simon Marchi
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_invalidate, update callers to use
detached_regcache::invalidate instead.
gdb/ChangeLog:
* regcache.h (regcache_invalidate): Remove, update callers to
use detached_regcache::invalidate instead.
* regcache.c (regcache_invalidate): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/record-full.c | 4 ++--
gdb/regcache.c | 9 +--------
gdb/regcache.h | 2 --
gdb/sh-tdep.c | 2 +-
5 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d1ae322..d0cc45a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_invalidate): Remove, update callers to
+ use detached_regcache::invalidate instead.
+ * regcache.c (regcache_invalidate): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_raw_write_part): Remove, update callers
to use regcache::raw_write_part instead.
* regcache.c (regcache_raw_write_part): Remove.
diff --git a/gdb/record-full.c b/gdb/record-full.c
index b8460d9..8c0534e 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -1609,10 +1609,10 @@ record_full_target::store_registers (struct regcache *regcache, int regno)
for (i = 0;
i < gdbarch_num_regs (regcache->arch ());
i++)
- regcache_invalidate (regcache, i);
+ regcache->invalidate (i);
}
else
- regcache_invalidate (regcache, regno);
+ regcache->invalidate (regno);
error (_("Process record canceled the operation."));
}
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 371322d..4dce978 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -238,7 +238,7 @@ public:
~regcache_invalidator ()
{
if (m_regcache != nullptr)
- regcache_invalidate (m_regcache, m_regnum);
+ m_regcache->invalidate (m_regnum);
}
DISABLE_COPY_AND_ASSIGN (regcache_invalidator);
@@ -329,13 +329,6 @@ reg_buffer::get_register_status (int regnum) const
}
void
-regcache_invalidate (struct regcache *regcache, int regnum)
-{
- gdb_assert (regcache != NULL);
- regcache->invalidate (regnum);
-}
-
-void
detached_regcache::invalidate (int regnum)
{
assert_regnum (regnum);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index af3adf8..64e4cd7 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -50,8 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache,
extern LONGEST regcache_raw_get_signed (struct regcache *regcache,
int regnum);
-void regcache_invalidate (struct regcache *regcache, int regnum);
-
/* Transfer of pseudo-registers. The read variants return a register
status, as an indication of when a ``cooked'' register was
constructed from valid, invalid or unavailable ``raw''
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index 7946430..97e4a75 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1703,7 +1703,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
regcache->raw_write (BANK_REGNUM, buffer);
for (bregnum = R0_BANK0_REGNUM; bregnum < MACLB_REGNUM; ++bregnum)
- regcache_invalidate (regcache, bregnum);
+ regcache->invalidate (bregnum);
}
else if (reg_nr >= DR0_REGNUM && reg_nr <= DR_LAST_REGNUM)
{
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 02/15] Remove regcache_register_status
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (2 preceding siblings ...)
2018-05-30 19:05 ` [pushed 05/15] Remove regcache_raw_write Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 15/15] Remove regcache_raw_collect Simon Marchi
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_register_status, change callers to use
reg_buffer::get_register_status directly.
gdb/ChangeLog:
* regcache.h (regcache_register_status): Remove, update callers
to use reg_buffer::get_register_status directly instead.
* regcache.c (regcache_register_status): Remove.
---
gdb/ChangeLog | 6 +++++
gdb/aarch32-linux-nat.c | 4 +--
gdb/aarch64-linux-nat.c | 8 +++---
gdb/aix-thread.c | 67 ++++++++++++++++++++++---------------------------
gdb/arm-linux-nat.c | 13 ++++------
gdb/corelow.c | 2 +-
gdb/ctf.c | 2 +-
gdb/i386-gnu-nat.c | 4 +--
gdb/regcache.c | 7 ------
gdb/regcache.h | 5 ++--
gdb/s390-linux-tdep.c | 10 +++-----
gdb/tracefile-tfile.c | 2 +-
12 files changed, 58 insertions(+), 72 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1c09d21..ef6d921 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_register_status): Remove, update callers
+ to use reg_buffer::get_register_status directly instead.
+ * regcache.c (regcache_register_status): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_get_ptid): Remove, update all callers to
call regcache::ptid instead.
* regcache.c (regcache_get_ptid): Remove.
diff --git a/gdb/aarch32-linux-nat.c b/gdb/aarch32-linux-nat.c
index 71f5cfa..d1c1314 100644
--- a/gdb/aarch32-linux-nat.c
+++ b/gdb/aarch32-linux-nat.c
@@ -61,12 +61,12 @@ aarch32_gp_regcache_collect (const struct regcache *regcache, uint32_t *regs,
for (regno = ARM_A1_REGNUM; regno <= ARM_PC_REGNUM; regno++)
{
- if (REG_VALID == regcache_register_status (regcache, regno))
+ if (REG_VALID == regcache->get_register_status (regno))
regcache_raw_collect (regcache, regno, ®s[regno]);
}
if (arm_apcs_32
- && REG_VALID == regcache_register_status (regcache, ARM_PS_REGNUM))
+ && REG_VALID == regcache->get_register_status (ARM_PS_REGNUM))
{
uint32_t cpsr = regs[ARM_CPSR_GREGNUM];
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 3672a2f..c1fb7ac 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -264,7 +264,7 @@ store_gregs_to_thread (const struct regcache *regcache)
int regno;
for (regno = AARCH64_X0_REGNUM; regno <= AARCH64_CPSR_REGNUM; regno++)
- if (REG_VALID == regcache_register_status (regcache, regno))
+ if (REG_VALID == regcache->get_register_status (regno))
regcache_raw_collect (regcache, regno,
®s[regno - AARCH64_X0_REGNUM]);
}
@@ -361,14 +361,14 @@ store_fpregs_to_thread (const struct regcache *regcache)
perror_with_name (_("Unable to fetch FP/SIMD registers."));
for (regno = AARCH64_V0_REGNUM; regno <= AARCH64_V31_REGNUM; regno++)
- if (REG_VALID == regcache_register_status (regcache, regno))
+ if (REG_VALID == regcache->get_register_status (regno))
regcache_raw_collect (regcache, regno,
(char *) ®s.vregs[regno - AARCH64_V0_REGNUM]);
- if (REG_VALID == regcache_register_status (regcache, AARCH64_FPSR_REGNUM))
+ if (REG_VALID == regcache->get_register_status (AARCH64_FPSR_REGNUM))
regcache_raw_collect (regcache, AARCH64_FPSR_REGNUM,
(char *) ®s.fpsr);
- if (REG_VALID == regcache_register_status (regcache, AARCH64_FPCR_REGNUM))
+ if (REG_VALID == regcache->get_register_status (AARCH64_FPCR_REGNUM))
regcache_raw_collect (regcache, AARCH64_FPCR_REGNUM,
(char *) ®s.fpcr);
}
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 6f4135b..749065c 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1389,8 +1389,8 @@ fill_gprs64 (const struct regcache *regcache, uint64_t *vals)
int regno;
for (regno = 0; regno < ppc_num_gprs; regno++)
- if (REG_VALID == regcache_register_status (regcache,
- tdep->ppc_gp0_regnum + regno))
+ if (REG_VALID == regcache->get_register_status
+ (tdep->ppc_gp0_regnum + regno))
regcache_raw_collect (regcache, tdep->ppc_gp0_regnum + regno,
vals + regno);
}
@@ -1402,8 +1402,8 @@ fill_gprs32 (const struct regcache *regcache, uint32_t *vals)
int regno;
for (regno = 0; regno < ppc_num_gprs; regno++)
- if (REG_VALID == regcache_register_status (regcache,
- tdep->ppc_gp0_regnum + regno))
+ if (REG_VALID == regcache->get_register_status
+ (tdep->ppc_gp0_regnum + regno))
regcache_raw_collect (regcache, tdep->ppc_gp0_regnum + regno,
vals + regno);
}
@@ -1423,7 +1423,7 @@ fill_fprs (const struct regcache *regcache, double *vals)
for (regno = tdep->ppc_fp0_regnum;
regno < tdep->ppc_fp0_regnum + ppc_num_fprs;
regno++)
- if (REG_VALID == regcache_register_status (regcache, regno))
+ if (REG_VALID == regcache->get_register_status (regno))
regcache_raw_collect (regcache, regno,
vals + regno - tdep->ppc_fp0_regnum);
}
@@ -1448,22 +1448,20 @@ fill_sprs64 (const struct regcache *regcache,
gdb_assert (sizeof (*iar) == register_size
(gdbarch, gdbarch_pc_regnum (gdbarch)));
- if (REG_VALID == regcache_register_status (regcache,
- gdbarch_pc_regnum (gdbarch)))
+ if (REG_VALID == regcache->get_register_status (gdbarch_pc_regnum (gdbarch)))
regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch), iar);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_ps_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_ps_regnum))
regcache_raw_collect (regcache, tdep->ppc_ps_regnum, msr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_cr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_cr_regnum))
regcache_raw_collect (regcache, tdep->ppc_cr_regnum, cr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_lr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_lr_regnum))
regcache_raw_collect (regcache, tdep->ppc_lr_regnum, lr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_ctr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_ctr_regnum))
regcache_raw_collect (regcache, tdep->ppc_ctr_regnum, ctr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_xer_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_xer_regnum))
regcache_raw_collect (regcache, tdep->ppc_xer_regnum, xer);
if (tdep->ppc_fpscr_regnum >= 0
- && REG_VALID == regcache_register_status (regcache,
- tdep->ppc_fpscr_regnum))
+ && REG_VALID == regcache->get_register_status (tdep->ppc_fpscr_regnum))
regcache_raw_collect (regcache, tdep->ppc_fpscr_regnum, fpscr);
}
@@ -1484,21 +1482,20 @@ fill_sprs32 (const struct regcache *regcache,
gdb_assert (sizeof (*iar) == register_size (gdbarch,
gdbarch_pc_regnum (gdbarch)));
- if (REG_VALID == regcache_register_status (regcache,
- gdbarch_pc_regnum (gdbarch)))
+ if (REG_VALID == regcache->get_register_status (gdbarch_pc_regnum (gdbarch)))
regcache_raw_collect (regcache, gdbarch_pc_regnum (gdbarch), iar);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_ps_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_ps_regnum))
regcache_raw_collect (regcache, tdep->ppc_ps_regnum, msr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_cr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_cr_regnum))
regcache_raw_collect (regcache, tdep->ppc_cr_regnum, cr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_lr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_lr_regnum))
regcache_raw_collect (regcache, tdep->ppc_lr_regnum, lr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_ctr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_ctr_regnum))
regcache_raw_collect (regcache, tdep->ppc_ctr_regnum, ctr);
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_xer_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_xer_regnum))
regcache_raw_collect (regcache, tdep->ppc_xer_regnum, xer);
if (tdep->ppc_fpscr_regnum >= 0
- && REG_VALID == regcache_register_status (regcache, tdep->ppc_fpscr_regnum))
+ && REG_VALID == regcache->get_register_status (tdep->ppc_fpscr_regnum))
regcache_raw_collect (regcache, tdep->ppc_fpscr_regnum, fpscr);
}
@@ -1533,8 +1530,7 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
/* Collect general-purpose register values from the regcache. */
for (i = 0; i < ppc_num_gprs; i++)
- if (REG_VALID == regcache_register_status (regcache,
- tdep->ppc_gp0_regnum + i))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_gp0_regnum + i))
{
if (arch64)
{
@@ -1569,23 +1565,20 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid)
fill_sprs32 (regcache, &tmp_iar, &tmp_msr, &tmp_cr, &tmp_lr, &tmp_ctr,
&tmp_xer, &tmp_fpscr);
- if (REG_VALID == regcache_register_status (regcache,
- gdbarch_pc_regnum (gdbarch)))
+ if (REG_VALID == regcache->get_register_status
+ (gdbarch_pc_regnum (gdbarch)))
ctx.iar = tmp_iar;
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_ps_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_ps_regnum))
ctx.msr = tmp_msr;
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_cr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_cr_regnum))
ctx.cr = tmp_cr;
- if (REG_VALID == regcache_register_status (regcache, tdep->ppc_lr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_lr_regnum))
ctx.lr = tmp_lr;
- if (REG_VALID == regcache_register_status (regcache,
- tdep->ppc_ctr_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_ctr_regnum))
ctx.ctr = tmp_ctr;
- if (REG_VALID == regcache_register_status (regcache,
- tdep->ppc_xer_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_xer_regnum))
ctx.xer = tmp_xer;
- if (REG_VALID == regcache_register_status (regcache,
- tdep->ppc_xer_regnum))
+ if (REG_VALID == regcache->get_register_status (tdep->ppc_xer_regnum))
ctx.fpscr = tmp_fpscr;
}
@@ -1699,8 +1692,8 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
sprs32.pt_fpscr = tmp_fpscr;
if (tdep->ppc_mq_regnum >= 0)
- if (REG_VALID == regcache_register_status (regcache,
- tdep->ppc_mq_regnum))
+ if (REG_VALID == regcache->get_register_status
+ (tdep->ppc_mq_regnum))
regcache_raw_collect (regcache, tdep->ppc_mq_regnum,
&sprs32.pt_mq);
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index ccf812b..a1bef7a 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -176,12 +176,12 @@ store_fpregs (const struct regcache *regcache)
perror_with_name (_("Unable to fetch the floating point registers."));
/* Store fpsr. */
- if (REG_VALID == regcache_register_status (regcache, ARM_FPS_REGNUM))
+ if (REG_VALID == regcache->get_register_status (ARM_FPS_REGNUM))
regcache_raw_collect (regcache, ARM_FPS_REGNUM, fp + NWFPE_FPSR_OFFSET);
/* Store the floating point registers. */
for (regno = ARM_F0_REGNUM; regno <= ARM_F7_REGNUM; regno++)
- if (REG_VALID == regcache_register_status (regcache, regno))
+ if (REG_VALID == regcache->get_register_status (regno))
collect_nwfpe_register (regcache, regno, fp);
if (have_ptrace_getregset == TRIBOOL_TRUE)
@@ -318,20 +318,17 @@ store_wmmx_regs (const struct regcache *regcache)
perror_with_name (_("Unable to fetch WMMX registers."));
for (regno = 0; regno < 16; regno++)
- if (REG_VALID == regcache_register_status (regcache,
- regno + ARM_WR0_REGNUM))
+ if (REG_VALID == regcache->get_register_status (regno + ARM_WR0_REGNUM))
regcache_raw_collect (regcache, regno + ARM_WR0_REGNUM,
®buf[regno * 8]);
for (regno = 0; regno < 2; regno++)
- if (REG_VALID == regcache_register_status (regcache,
- regno + ARM_WCSSF_REGNUM))
+ if (REG_VALID == regcache->get_register_status (regno + ARM_WCSSF_REGNUM))
regcache_raw_collect (regcache, regno + ARM_WCSSF_REGNUM,
®buf[16 * 8 + regno * 4]);
for (regno = 0; regno < 4; regno++)
- if (REG_VALID == regcache_register_status (regcache,
- regno + ARM_WCGR0_REGNUM))
+ if (REG_VALID == regcache->get_register_status (regno + ARM_WCGR0_REGNUM))
regcache_raw_collect (regcache, regno + ARM_WCGR0_REGNUM,
®buf[16 * 8 + 2 * 4 + regno * 4]);
diff --git a/gdb/corelow.c b/gdb/corelow.c
index c617527..0a7d742 100644
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
@@ -704,7 +704,7 @@ core_target::fetch_registers (struct regcache *regcache, int regno)
/* Mark all registers not found in the core as unavailable. */
for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
- if (regcache_register_status (regcache, i) == REG_UNKNOWN)
+ if (regcache->get_register_status (i) == REG_UNKNOWN)
regcache_raw_supply (regcache, i, NULL);
}
diff --git a/gdb/ctf.c b/gdb/ctf.c
index cae5d22..1ab095d 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1262,7 +1262,7 @@ ctf_target::fetch_registers (struct regcache *regcache, int regno)
/* Make sure we stay within block bounds. */
if (offset + regsize >= trace_regblock_size)
break;
- if (regcache_register_status (regcache, regn) == REG_UNKNOWN)
+ if (regcache->get_register_status (regn) == REG_UNKNOWN)
{
if (regno == regn)
{
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index e5195f3..a738308 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -265,7 +265,7 @@ gnu_store_registers (struct target_ops *ops,
proc_debug (thread, "storing all registers");
for (i = 0; i < I386_NUM_GREGS; i++)
- if (REG_VALID == regcache_register_status (regcache, i))
+ if (REG_VALID == regcache->get_register_status (i))
regcache_raw_collect (regcache, i, REG_ADDR (state, i));
}
else
@@ -273,7 +273,7 @@ gnu_store_registers (struct target_ops *ops,
proc_debug (thread, "storing register %s",
gdbarch_register_name (gdbarch, regno));
- gdb_assert (REG_VALID == regcache_register_status (regcache, regno));
+ gdb_assert (REG_VALID == regcache->get_register_status (regno));
regcache_raw_collect (regcache, regno, REG_ADDR (state, regno));
}
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 9881e92..dd1dde2 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -321,13 +321,6 @@ regcache::restore (readonly_detached_regcache *src)
}
enum register_status
-regcache_register_status (const struct regcache *regcache, int regnum)
-{
- gdb_assert (regcache != NULL);
- return regcache->get_register_status (regnum);
-}
-
-enum register_status
reg_buffer::get_register_status (int regnum) const
{
assert_regnum (regnum);
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 7fcc43a..fa177b5 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -35,9 +35,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
struct gdbarch *,
struct address_space *);
-enum register_status regcache_register_status (const struct regcache *regcache,
- int regnum);
-
/* Make certain that the register REGNUM in REGCACHE is up-to-date. */
void regcache_raw_update (struct regcache *regcache, int regnum);
@@ -210,6 +207,8 @@ public:
/* Return regcache's architecture. */
gdbarch *arch () const;
+ /* Get the availability status of the value of register REGNUM in this
+ buffer. */
enum register_status get_register_status (int regnum) const;
virtual ~reg_buffer ()
diff --git a/gdb/s390-linux-tdep.c b/gdb/s390-linux-tdep.c
index 0e85e71..cd840c8 100644
--- a/gdb/s390-linux-tdep.c
+++ b/gdb/s390-linux-tdep.c
@@ -295,8 +295,8 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
available. */
if (tdep->have_tdb
&& (regcache == NULL
- || REG_VALID == regcache_register_status (regcache,
- S390_TDB_DWORD0_REGNUM)))
+ || (REG_VALID
+ == regcache->get_register_status (S390_TDB_DWORD0_REGNUM))))
cb (".reg-s390-tdb", s390_sizeof_tdbregset, &s390_tdb_regset,
"s390 TDB", cb_data);
@@ -313,14 +313,12 @@ s390_iterate_over_regset_sections (struct gdbarch *gdbarch,
if (tdep->have_gs)
{
if (regcache == NULL
- || REG_VALID == regcache_register_status (regcache,
- S390_GSD_REGNUM))
+ || REG_VALID == regcache->get_register_status (S390_GSD_REGNUM))
cb (".reg-s390-gs-cb", 4 * 8, &s390_gs_regset,
"s390 guarded-storage registers", cb_data);
if (regcache == NULL
- || REG_VALID == regcache_register_status (regcache,
- S390_BC_GSD_REGNUM))
+ || REG_VALID == regcache->get_register_status (S390_BC_GSD_REGNUM))
cb (".reg-s390-gs-bc", 4 * 8, &s390_gsbc_regset,
"s390 guarded-storage broadcast control", cb_data);
}
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index f4fdd36..32f5722 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -894,7 +894,7 @@ tfile_target::fetch_registers (struct regcache *regcache, int regno)
/* Make sure we stay within block bounds. */
if (offset + regsize > trace_regblock_size)
break;
- if (regcache_register_status (regcache, regn) == REG_UNKNOWN)
+ if (regcache->get_register_status (regn) == REG_UNKNOWN)
{
if (regno == regn)
{
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 05/15] Remove regcache_raw_write
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
2018-05-30 19:04 ` [pushed 10/15] Remove regcache_cooked_write Simon Marchi
2018-05-30 19:05 ` [pushed 13/15] Remove regcache_cooked_write_part Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 02/15] Remove regcache_register_status Simon Marchi
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_raw_write, update all callers to use regcache::raw_write
instead.
gdb/ChangeLog:
* regcache.h (regcache_raw_write): Remove, update callers to use
regcache::raw_write instead.
* regcache.c (regcache_raw_write): Remove.
---
gdb/ChangeLog | 6 +++++
gdb/aarch64-tdep.c | 10 ++++-----
gdb/amd64-tdep.c | 11 +++++-----
gdb/arm-tdep.c | 6 ++---
gdb/bfin-tdep.c | 2 +-
gdb/frv-tdep.c | 6 ++---
gdb/h8300-tdep.c | 2 +-
gdb/i386-darwin-tdep.c | 3 +--
gdb/i386-tdep.c | 59 +++++++++++++++-----------------------------------
gdb/i387-tdep.c | 2 +-
gdb/iq2000-tdep.c | 8 +++----
gdb/m32c-tdep.c | 4 ++--
gdb/m68hc11-tdep.c | 2 +-
gdb/m68k-tdep.c | 8 +++----
gdb/mep-tdep.c | 6 ++---
gdb/mips-tdep.c | 2 +-
gdb/mn10300-tdep.c | 2 +-
gdb/nds32-tdep.c | 2 +-
gdb/regcache.c | 8 -------
gdb/regcache.h | 8 +++----
gdb/rl78-tdep.c | 22 +++++++++----------
gdb/rs6000-tdep.c | 20 ++++++++---------
gdb/s390-tdep.c | 4 ++--
gdb/sh-tdep.c | 12 +++++-----
gdb/sparc-tdep.c | 4 ++--
gdb/sparc64-tdep.c | 18 +++++++--------
gdb/spu-tdep.c | 2 +-
gdb/tilegx-tdep.c | 4 ++--
gdb/v850-tdep.c | 2 +-
gdb/xstormy16-tdep.c | 4 ++--
gdb/xtensa-tdep.c | 6 ++---
31 files changed, 113 insertions(+), 142 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4b7bfad..7142237 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_raw_write): Remove, update callers to use
+ regcache::raw_write instead.
+ * regcache.c (regcache_raw_write): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_raw_read): Remove, update callers to use
readable_regcache::raw_read instead.
* regcache.c (regcache_raw_read): Remove.
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index c5ed80c..8e16e3d 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -2342,7 +2342,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_Q0_REGNUM;
memcpy (reg_buf, buf, Q_REGISTER_SIZE);
- regcache_raw_write (regcache, v_regnum, reg_buf);
+ regcache->raw_write (v_regnum, reg_buf);
return;
}
@@ -2353,7 +2353,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_D0_REGNUM;
memcpy (reg_buf, buf, D_REGISTER_SIZE);
- regcache_raw_write (regcache, v_regnum, reg_buf);
+ regcache->raw_write (v_regnum, reg_buf);
return;
}
@@ -2363,7 +2363,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_S0_REGNUM;
memcpy (reg_buf, buf, S_REGISTER_SIZE);
- regcache_raw_write (regcache, v_regnum, reg_buf);
+ regcache->raw_write (v_regnum, reg_buf);
return;
}
@@ -2374,7 +2374,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_H0_REGNUM;
memcpy (reg_buf, buf, H_REGISTER_SIZE);
- regcache_raw_write (regcache, v_regnum, reg_buf);
+ regcache->raw_write (v_regnum, reg_buf);
return;
}
@@ -2385,7 +2385,7 @@ aarch64_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
v_regnum = AARCH64_V0_REGNUM + regnum - AARCH64_B0_REGNUM;
memcpy (reg_buf, buf, B_REGISTER_SIZE);
- regcache_raw_write (regcache, v_regnum, reg_buf);
+ regcache->raw_write (v_regnum, reg_buf);
return;
}
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 0eac35e..597bb0f 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -426,8 +426,7 @@ amd64_pseudo_register_write (struct gdbarch *gdbarch,
/* ... Modify ... (always little endian). */
memcpy (raw_buf + 1, buf, 1);
/* ... Write. */
- regcache_raw_write (regcache,
- gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
+ regcache->raw_write (gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
}
else
{
@@ -436,7 +435,7 @@ amd64_pseudo_register_write (struct gdbarch *gdbarch,
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 1);
/* ... Write. */
- regcache_raw_write (regcache, gpnum, raw_buf);
+ regcache->raw_write (gpnum, raw_buf);
}
}
else if (i386_dword_regnum_p (gdbarch, regnum))
@@ -448,7 +447,7 @@ amd64_pseudo_register_write (struct gdbarch *gdbarch,
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 4);
/* ... Write. */
- regcache_raw_write (regcache, gpnum, raw_buf);
+ regcache->raw_write (gpnum, raw_buf);
}
else
i386_pseudo_register_write (gdbarch, regcache, regnum, buf);
@@ -777,8 +776,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
if (writebuf)
{
i387_return_value (gdbarch, regcache);
- regcache_raw_write (regcache, AMD64_ST0_REGNUM, writebuf);
- regcache_raw_write (regcache, AMD64_ST1_REGNUM, writebuf + 16);
+ regcache->raw_write (AMD64_ST0_REGNUM, writebuf);
+ regcache->raw_write (AMD64_ST1_REGNUM, writebuf + 16);
/* Fix up the tag word such that both %st(0) and %st(1) are
marked as valid. */
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 7fa0db3..4eeb6ea 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -8765,9 +8765,9 @@ arm_neon_quad_write (struct gdbarch *gdbarch, struct regcache *regcache,
else
offset = 0;
- regcache_raw_write (regcache, double_regnum, buf + offset);
+ regcache->raw_write (double_regnum, buf + offset);
offset = 8 - offset;
- regcache_raw_write (regcache, double_regnum + 1, buf + offset);
+ regcache->raw_write (double_regnum + 1, buf + offset);
}
static void
@@ -8802,7 +8802,7 @@ arm_pseudo_write (struct gdbarch *gdbarch, struct regcache *regcache,
regcache->raw_read (double_regnum, reg_buf);
memcpy (reg_buf + offset, buf, 4);
- regcache_raw_write (regcache, double_regnum, reg_buf);
+ regcache->raw_write (double_regnum, reg_buf);
}
}
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
index 66a9465..a2b3464 100644
--- a/gdb/bfin-tdep.c
+++ b/gdb/bfin-tdep.c
@@ -721,7 +721,7 @@ bfin_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Overlay the CC bit in the ASTAT register. */
regcache->raw_read (BFIN_ASTAT_REGNUM, buf);
buf[0] = (buf[0] & ~ASTAT_CC) | ((buffer[0] & 1) << ASTAT_CC_POS);
- regcache_raw_write (regcache, BFIN_ASTAT_REGNUM, buf);
+ regcache->raw_write (BFIN_ASTAT_REGNUM, buf);
}
static CORE_ADDR
diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
index 04bb43b..7adffc4 100644
--- a/gdb/frv-tdep.c
+++ b/gdb/frv-tdep.c
@@ -337,8 +337,8 @@ frv_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
if (reg == iacc0_regnum)
{
- regcache_raw_write (regcache, iacc0h_regnum, buffer);
- regcache_raw_write (regcache, iacc0l_regnum, (bfd_byte *) buffer + 4);
+ regcache->raw_write (iacc0h_regnum, buffer);
+ regcache->raw_write (iacc0l_regnum, (bfd_byte *) buffer + 4);
}
else if (accg0_regnum <= reg && reg <= accg7_regnum)
{
@@ -351,7 +351,7 @@ frv_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
regcache->raw_read (raw_regnum, buf);
buf[byte_num] = ((bfd_byte *) buffer)[0];
- regcache_raw_write (regcache, raw_regnum, buf);
+ regcache->raw_write (raw_regnum, buf);
}
}
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 55e77b6..65d3362 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -1218,7 +1218,7 @@ h8300_pseudo_register_write (struct gdbarch *gdbarch,
else if (regno == E_PSEUDO_EXR_REGNUM (gdbarch))
raw_from_pseudo_register (gdbarch, regcache, buf, E_EXR_REGNUM, regno);
else
- regcache_raw_write (regcache, regno, buf);
+ regcache->raw_write (regno, buf);
}
static int
diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c
index 7ee2f4c..21f0a4c 100644
--- a/gdb/i386-darwin-tdep.c
+++ b/gdb/i386-darwin-tdep.c
@@ -189,8 +189,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (write_pass)
{
const gdb_byte *val = value_contents_all (args[i]);
- regcache_raw_write
- (regcache, I387_MM0_REGNUM(tdep) + num_m128, val);
+ regcache->raw_write (I387_MM0_REGNUM(tdep) + num_m128, val);
}
num_m128++;
}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 0a4e4d7..353fb89 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2859,7 +2859,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
not exactly how it would happen on the target itself, but
it is the best we can do. */
target_float_convert (valbuf, type, buf, i387_ext_type (gdbarch));
- regcache_raw_write (regcache, I386_ST0_REGNUM, buf);
+ regcache->raw_write (I386_ST0_REGNUM, buf);
/* Set the top of the floating-point register stack to 7. The
actual value doesn't really matter, but 7 is what a normal
@@ -2883,7 +2883,7 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
regcache_raw_write_part (regcache, LOW_RETURN_REGNUM, 0, len, valbuf);
else if (len <= (low_size + high_size))
{
- regcache_raw_write (regcache, LOW_RETURN_REGNUM, valbuf);
+ regcache->raw_write (LOW_RETURN_REGNUM, valbuf);
regcache_raw_write_part (regcache, HIGH_RETURN_REGNUM, 0,
len - low_size, valbuf + low_size);
}
@@ -3478,7 +3478,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, register_size (gdbarch, regnum));
/* ... Write. */
- regcache_raw_write (regcache, fpnum, raw_buf);
+ regcache->raw_write (fpnum, raw_buf);
}
else
{
@@ -3505,18 +3505,13 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
memcpy (raw_buf, &lower, 8);
memcpy (raw_buf + 8, &upper, 8);
-
- regcache_raw_write (regcache,
- I387_BND0R_REGNUM (tdep) + regnum,
- raw_buf);
+ regcache->raw_write (I387_BND0R_REGNUM (tdep) + regnum, raw_buf);
}
else if (i386_k_regnum_p (gdbarch, regnum))
{
regnum -= tdep->k0_regnum;
- regcache_raw_write (regcache,
- tdep->k0_regnum + regnum,
- buf);
+ regcache->raw_write (tdep->k0_regnum + regnum, buf);
}
else if (i386_zmm_regnum_p (gdbarch, regnum))
{
@@ -3525,57 +3520,39 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
if (regnum < num_lower_zmm_regs)
{
/* Write lower 128bits. */
- regcache_raw_write (regcache,
- I387_XMM0_REGNUM (tdep) + regnum,
- buf);
+ regcache->raw_write (I387_XMM0_REGNUM (tdep) + regnum, buf);
/* Write upper 128bits. */
- regcache_raw_write (regcache,
- I387_YMM0_REGNUM (tdep) + regnum,
- buf + 16);
+ regcache->raw_write (I387_YMM0_REGNUM (tdep) + regnum, buf + 16);
}
else
{
/* Write lower 128bits. */
- regcache_raw_write (regcache,
- I387_XMM16_REGNUM (tdep) + regnum
- - num_lower_zmm_regs,
- buf);
+ regcache->raw_write (I387_XMM16_REGNUM (tdep) + regnum
+ - num_lower_zmm_regs, buf);
/* Write upper 128bits. */
- regcache_raw_write (regcache,
- I387_YMM16H_REGNUM (tdep) + regnum
- - num_lower_zmm_regs,
- buf + 16);
+ regcache->raw_write (I387_YMM16H_REGNUM (tdep) + regnum
+ - num_lower_zmm_regs, buf + 16);
}
/* Write upper 256bits. */
- regcache_raw_write (regcache,
- tdep->zmm0h_regnum + regnum,
- buf + 32);
+ regcache->raw_write (tdep->zmm0h_regnum + regnum, buf + 32);
}
else if (i386_ymm_regnum_p (gdbarch, regnum))
{
regnum -= tdep->ymm0_regnum;
/* ... Write lower 128bits. */
- regcache_raw_write (regcache,
- I387_XMM0_REGNUM (tdep) + regnum,
- buf);
+ regcache->raw_write (I387_XMM0_REGNUM (tdep) + regnum, buf);
/* ... Write upper 128bits. */
- regcache_raw_write (regcache,
- tdep->ymm0h_regnum + regnum,
- buf + 16);
+ regcache->raw_write (tdep->ymm0h_regnum + regnum, buf + 16);
}
else if (i386_ymm_avx512_regnum_p (gdbarch, regnum))
{
regnum -= tdep->ymm16_regnum;
/* ... Write lower 128bits. */
- regcache_raw_write (regcache,
- I387_XMM16_REGNUM (tdep) + regnum,
- buf);
+ regcache->raw_write (I387_XMM16_REGNUM (tdep) + regnum, buf);
/* ... Write upper 128bits. */
- regcache_raw_write (regcache,
- tdep->ymm16h_regnum + regnum,
- buf + 16);
+ regcache->raw_write (tdep->ymm16h_regnum + regnum, buf + 16);
}
else if (i386_word_regnum_p (gdbarch, regnum))
{
@@ -3586,7 +3563,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* ... Modify ... (always little endian). */
memcpy (raw_buf, buf, 2);
/* ... Write. */
- regcache_raw_write (regcache, gpnum, raw_buf);
+ regcache->raw_write (gpnum, raw_buf);
}
else if (i386_byte_regnum_p (gdbarch, regnum))
{
@@ -3600,7 +3577,7 @@ i386_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
else
memcpy (raw_buf, buf, 1);
/* ... Write. */
- regcache_raw_write (regcache, gpnum % 4, raw_buf);
+ regcache->raw_write (gpnum % 4, raw_buf);
}
else
internal_error (__FILE__, __LINE__, _("invalid regnum"));
diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c
index fdd83f1..b465fda 100644
--- a/gdb/i387-tdep.c
+++ b/gdb/i387-tdep.c
@@ -1962,6 +1962,6 @@ i387_reset_bnd_regs (struct gdbarch *gdbarch, struct regcache *regcache)
memset (bnd_buf, 0, 16);
for (int i = 0; i < I387_NUM_BND_REGS; i++)
- regcache_raw_write (regcache, I387_BND0R_REGNUM (tdep) + i, bnd_buf);
+ regcache->raw_write (I387_BND0R_REGNUM (tdep) + i, bnd_buf);
}
}
diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c
index f8e2f23..9f7f35d 100644
--- a/gdb/iq2000-tdep.c
+++ b/gdb/iq2000-tdep.c
@@ -510,7 +510,7 @@ iq2000_store_return_value (struct type *type, struct regcache *regcache,
memset (buf, 0, 4);
memcpy (buf + 4 - size, valbuf, size);
- regcache_raw_write (regcache, regno++, buf);
+ regcache->raw_write (regno++, buf);
len -= size;
valbuf = ((char *) valbuf) + size;
}
@@ -737,7 +737,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (argreg <= E_LAST_ARGREG)
{
/* Passed in a register. */
- regcache_raw_write (regcache, argreg++, buf);
+ regcache->raw_write (argreg++, buf);
}
else
{
@@ -756,8 +756,8 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
(must start with an even-numbered reg). */
if (((argreg - E_1ST_ARGREG) % 2) != 0)
argreg++;
- regcache_raw_write (regcache, argreg++, val);
- regcache_raw_write (regcache, argreg++, val + 4);
+ regcache->raw_write (argreg++, val);
+ regcache->raw_write (argreg++, val + 4);
}
else
{
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index 173e8a4..2825efb 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -321,7 +321,7 @@ static enum register_status
m32c_raw_write (struct m32c_reg *reg, struct regcache *cache,
const gdb_byte *buf)
{
- regcache_raw_write (cache, reg->num, buf);
+ cache->raw_write (reg->num, buf);
return REG_VALID;
}
@@ -368,7 +368,7 @@ m32c_banked_write (struct m32c_reg *reg, struct regcache *cache,
const gdb_byte *buf)
{
struct m32c_reg *bank_reg = m32c_banked_register (reg, cache);
- regcache_raw_write (cache, bank_reg->num, buf);
+ cache->raw_write (bank_reg->num, buf);
return REG_VALID;
}
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index bce95e9..064bf5e 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1264,7 +1264,7 @@ m68hc11_store_return_value (struct type *type, struct regcache *regcache,
{
regcache_raw_write_part (regcache, HARD_X_REGNUM, 4 - len,
len - 2, valbuf);
- regcache_raw_write (regcache, HARD_D_REGNUM, valbuf + (len - 2));
+ regcache->raw_write (HARD_D_REGNUM, valbuf + (len - 2));
}
else
error (_("return of value > 4 is not supported."));
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index a6a1bb4..31c2771 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -334,7 +334,7 @@ m68k_store_return_value (struct type *type, struct regcache *regcache,
{
regcache_raw_write_part (regcache, M68K_D0_REGNUM, 8 - len,
len - 4, valbuf);
- regcache_raw_write (regcache, M68K_D1_REGNUM, valbuf + (len - 4));
+ regcache->raw_write (M68K_D1_REGNUM, valbuf + (len - 4));
}
else
internal_error (__FILE__, __LINE__,
@@ -353,12 +353,12 @@ m68k_svr4_store_return_value (struct type *type, struct regcache *regcache,
struct type *fpreg_type = register_type (gdbarch, M68K_FP0_REGNUM);
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
target_float_convert (valbuf, type, buf, fpreg_type);
- regcache_raw_write (regcache, M68K_FP0_REGNUM, buf);
+ regcache->raw_write (M68K_FP0_REGNUM, buf);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4)
{
- regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf);
- regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf);
+ regcache->raw_write (M68K_A0_REGNUM, valbuf);
+ regcache->raw_write (M68K_D0_REGNUM, valbuf);
}
else
m68k_store_return_value (type, regcache, valbuf);
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 0e8c3f9..727d247 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -1216,7 +1216,7 @@ mep_pseudo_cr32_write (struct gdbarch *gdbarch,
/* Slow, but legible. */
store_unsigned_integer (buf64, 8, byte_order,
extract_unsigned_integer (buf, 4, byte_order));
- regcache_raw_write (regcache, rawnum, buf64);
+ regcache->raw_write (rawnum, buf64);
}
@@ -1226,7 +1226,7 @@ mep_pseudo_cr64_write (struct gdbarch *gdbarch,
int cookednum,
const gdb_byte *buf)
{
- regcache_raw_write (regcache, mep_pseudo_to_raw[cookednum], buf);
+ regcache->raw_write (mep_pseudo_to_raw[cookednum], buf);
}
@@ -1245,7 +1245,7 @@ mep_pseudo_register_write (struct gdbarch *gdbarch,
|| IS_FP_CR64_REGNUM (cookednum))
mep_pseudo_cr64_write (gdbarch, regcache, cookednum, buf);
else if (IS_CCR_REGNUM (cookednum))
- regcache_raw_write (regcache, mep_pseudo_to_raw[cookednum], buf);
+ regcache->raw_write (mep_pseudo_to_raw[cookednum], buf);
else
gdb_assert_not_reached ("unexpected pseudo register");
}
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index cc67cd3..926b084 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -775,7 +775,7 @@ mips_pseudo_register_write (struct gdbarch *gdbarch,
gdb_assert (cookednum >= gdbarch_num_regs (gdbarch)
&& cookednum < 2 * gdbarch_num_regs (gdbarch));
if (register_size (gdbarch, rawnum) == register_size (gdbarch, cookednum))
- regcache_raw_write (regcache, rawnum, buf);
+ regcache->raw_write (rawnum, buf);
else if (register_size (gdbarch, rawnum) >
register_size (gdbarch, cookednum))
{
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index c8267cf..caaf8d4 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -185,7 +185,7 @@ mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type,
regcache_raw_write_part (regcache, reg, 0, len, valbuf);
else if (len <= 2 * regsz)
{
- regcache_raw_write (regcache, reg, valbuf);
+ regcache->raw_write (reg, valbuf);
gdb_assert (regsz == register_size (gdbarch, reg + 1));
regcache_raw_write_part (regcache, reg+1, 0,
len - regsz, valbuf + regsz);
diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
index 991a870..14b091c 100644
--- a/gdb/nds32-tdep.c
+++ b/gdb/nds32-tdep.c
@@ -502,7 +502,7 @@ nds32_pseudo_register_write (struct gdbarch *gdbarch,
fdr_regnum = NDS32_FD0_REGNUM + (regnum >> 1);
regcache->raw_read (fdr_regnum, reg_buf);
memcpy (reg_buf + offset, buf, 4);
- regcache_raw_write (regcache, fdr_regnum, reg_buf);
+ regcache->raw_write (fdr_regnum, reg_buf);
return;
}
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 5551408..470042c 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -752,14 +752,6 @@ regcache_cooked_write_unsigned (struct regcache *regcache, int regnum,
}
void
-regcache_raw_write (struct regcache *regcache, int regnum,
- const gdb_byte *buf)
-{
- gdb_assert (regcache != NULL && buf != NULL);
- regcache->raw_write (regnum, buf);
-}
-
-void
regcache::raw_write (int regnum, const gdb_byte *buf)
{
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 3735852..e9cbcbe 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -35,11 +35,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
struct gdbarch *,
struct address_space *);
-/* Transfer a raw register [0..NUM_REGS) between core-gdb and the
- regcache. The read variants return the status of the register. */
-
-void regcache_raw_write (struct regcache *regcache, int rawnum,
- const gdb_byte *buf);
extern enum register_status
regcache_raw_read_signed (struct regcache *regcache,
int regnum, LONGEST *val);
@@ -323,6 +318,9 @@ public:
void cooked_write (int regnum, const gdb_byte *buf);
+ /* Update the value of raw register REGNUM (in the range [0..NUM_REGS)) and
+ transfer its value to core-gdb. */
+
void raw_write (int regnum, const gdb_byte *buf);
template<typename T, typename = RequireLongest<T>>
diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c
index af6a089..ace01b1 100644
--- a/gdb/rl78-tdep.c
+++ b/gdb/rl78-tdep.c
@@ -730,28 +730,28 @@ rl78_pseudo_register_write (struct gdbarch *gdbarch,
int raw_regnum = RL78_RAW_BANK0_R0_REGNUM
+ (reg - RL78_BANK0_R0_REGNUM);
- regcache_raw_write (regcache, raw_regnum, buffer);
+ regcache->raw_write (raw_regnum, buffer);
}
else if (RL78_BANK0_RP0_REGNUM <= reg && reg <= RL78_BANK3_RP3_REGNUM)
{
int raw_regnum = 2 * (reg - RL78_BANK0_RP0_REGNUM)
+ RL78_RAW_BANK0_R0_REGNUM;
- regcache_raw_write (regcache, raw_regnum, buffer);
- regcache_raw_write (regcache, raw_regnum + 1, buffer + 1);
+ regcache->raw_write (raw_regnum, buffer);
+ regcache->raw_write (raw_regnum + 1, buffer + 1);
}
else if (RL78_BANK0_RP0_PTR_REGNUM <= reg && reg <= RL78_BANK3_RP3_PTR_REGNUM)
{
int raw_regnum = 2 * (reg - RL78_BANK0_RP0_PTR_REGNUM)
+ RL78_RAW_BANK0_R0_REGNUM;
- regcache_raw_write (regcache, raw_regnum, buffer);
- regcache_raw_write (regcache, raw_regnum + 1, buffer + 1);
+ regcache->raw_write (raw_regnum, buffer);
+ regcache->raw_write (raw_regnum + 1, buffer + 1);
}
else if (reg == RL78_SP_REGNUM)
{
- regcache_raw_write (regcache, RL78_SPL_REGNUM, buffer);
- regcache_raw_write (regcache, RL78_SPH_REGNUM, buffer + 1);
+ regcache->raw_write (RL78_SPL_REGNUM, buffer);
+ regcache->raw_write (RL78_SPH_REGNUM, buffer + 1);
}
else if (reg == RL78_PC_REGNUM)
{
@@ -759,7 +759,7 @@ rl78_pseudo_register_write (struct gdbarch *gdbarch,
memcpy (rawbuf, buffer, 3);
rawbuf[3] = 0;
- regcache_raw_write (regcache, RL78_RAW_PC_REGNUM, rawbuf);
+ regcache->raw_write (RL78_RAW_PC_REGNUM, rawbuf);
}
else if (RL78_X_REGNUM <= reg && reg <= RL78_H_REGNUM)
{
@@ -772,7 +772,7 @@ rl78_pseudo_register_write (struct gdbarch *gdbarch,
/* RSB0 is at bit 3; RSBS1 is at bit 5. */
raw_regnum = RL78_RAW_BANK0_R0_REGNUM + bank * RL78_REGS_PER_BANK
+ (reg - RL78_X_REGNUM);
- regcache_raw_write (regcache, raw_regnum, buffer);
+ regcache->raw_write (raw_regnum, buffer);
}
else if (RL78_AX_REGNUM <= reg && reg <= RL78_HL_REGNUM)
{
@@ -784,8 +784,8 @@ rl78_pseudo_register_write (struct gdbarch *gdbarch,
/* RSB0 is at bit 3; RSBS1 is at bit 5. */
raw_regnum = RL78_RAW_BANK0_R0_REGNUM + bank * RL78_REGS_PER_BANK
+ 2 * (reg - RL78_AX_REGNUM);
- regcache_raw_write (regcache, raw_regnum, buffer);
- regcache_raw_write (regcache, raw_regnum + 1, buffer + 1);
+ regcache->raw_write (raw_regnum, buffer);
+ regcache->raw_write (raw_regnum + 1, buffer + 1);
}
else
gdb_assert_not_reached ("invalid pseudo register number");
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index ff4699c..594f3c4 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2552,7 +2552,7 @@ e500_move_ev_register (move_ev_register_func move,
static enum register_status
do_regcache_raw_write (struct regcache *regcache, int regnum, void *buffer)
{
- regcache_raw_write (regcache, regnum, (const gdb_byte *) buffer);
+ regcache->raw_write (regnum, (const gdb_byte *) buffer);
return REG_VALID;
}
@@ -2640,16 +2640,16 @@ dfp_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
{
/* Write each half of the dl register into a separate
FP register. */
- regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
+ regcache->raw_write (tdep->ppc_fp0_regnum +
2 * reg_index, buffer);
- regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
+ regcache->raw_write (tdep->ppc_fp0_regnum +
2 * reg_index + 1, buffer + 8);
}
else
{
- regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
+ regcache->raw_write (tdep->ppc_fp0_regnum +
2 * reg_index + 1, buffer);
- regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
+ regcache->raw_write (tdep->ppc_fp0_regnum +
2 * reg_index, buffer + 8);
}
}
@@ -2699,22 +2699,22 @@ vsx_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Write the portion that overlaps the VMX registers. */
if (reg_index > 31)
- regcache_raw_write (regcache, tdep->ppc_vr0_regnum +
+ regcache->raw_write (tdep->ppc_vr0_regnum +
reg_index - 32, buffer);
else
/* Write the portion that overlaps the FPR registers. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
{
- regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
+ regcache->raw_write (tdep->ppc_fp0_regnum +
reg_index, buffer);
- regcache_raw_write (regcache, tdep->ppc_vsr0_upper_regnum +
+ regcache->raw_write (tdep->ppc_vsr0_upper_regnum +
reg_index, buffer + 8);
}
else
{
- regcache_raw_write (regcache, tdep->ppc_fp0_regnum +
+ regcache->raw_write (tdep->ppc_fp0_regnum +
reg_index, buffer + 8);
- regcache_raw_write (regcache, tdep->ppc_vsr0_upper_regnum +
+ regcache->raw_write (tdep->ppc_vsr0_upper_regnum +
reg_index, buffer);
}
}
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index aecdbbd..bbf696e 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1402,8 +1402,8 @@ s390_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
if (regnum_is_vxr_full (tdep, regnum))
{
regnum -= tdep->v0_full_regnum;
- regcache_raw_write (regcache, S390_F0_REGNUM + regnum, buf);
- regcache_raw_write (regcache, S390_V0_LOWER_REGNUM + regnum, buf + 8);
+ regcache->raw_write (S390_F0_REGNUM + regnum, buf);
+ regcache->raw_write (S390_V0_LOWER_REGNUM + regnum, buf + 8);
return;
}
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index c9439f8..7946430 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -1374,7 +1374,7 @@ sh_store_return_value_nofpu (struct type *type, struct regcache *regcache,
{
int i, regnum = R0_REGNUM;
for (i = 0; i < len; i += 4)
- regcache_raw_write (regcache, regnum++, valbuf + i);
+ regcache->raw_write (regnum++, valbuf + i);
}
}
@@ -1389,10 +1389,10 @@ sh_store_return_value_fpu (struct type *type, struct regcache *regcache,
int i, regnum = gdbarch_fp0_regnum (gdbarch);
for (i = 0; i < len; i += 4)
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_LITTLE)
- regcache_raw_write (regcache, regnum++,
+ regcache->raw_write (regnum++,
valbuf + len - 4 - i);
else
- regcache_raw_write (regcache, regnum++, valbuf + i);
+ regcache->raw_write (regnum++, valbuf + i);
}
else
sh_store_return_value_nofpu (type, regcache, valbuf);
@@ -1701,7 +1701,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
so that a re-read happens next time it's necessary. */
int bregnum;
- regcache_raw_write (regcache, BANK_REGNUM, buffer);
+ regcache->raw_write (BANK_REGNUM, buffer);
for (bregnum = R0_BANK0_REGNUM; bregnum < MACLB_REGNUM; ++bregnum)
regcache_invalidate (regcache, bregnum);
}
@@ -1717,7 +1717,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 2; portion++)
- regcache_raw_write (regcache, base_regnum + portion,
+ regcache->raw_write (base_regnum + portion,
(temp_buffer
+ register_size (gdbarch,
base_regnum) * portion));
@@ -1728,7 +1728,7 @@ sh_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
/* Write the real regs for which this one is an alias. */
for (portion = 0; portion < 4; portion++)
- regcache_raw_write (regcache, base_regnum + portion,
+ regcache->raw_write (base_regnum + portion,
(buffer
+ register_size (gdbarch,
base_regnum) * portion));
diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c
index 7300080..c61fa50 100644
--- a/gdb/sparc-tdep.c
+++ b/gdb/sparc-tdep.c
@@ -547,8 +547,8 @@ sparc32_pseudo_register_write (struct gdbarch *gdbarch,
gdb_assert (regnum >= SPARC32_D0_REGNUM && regnum <= SPARC32_D30_REGNUM);
regnum = SPARC_F0_REGNUM + 2 * (regnum - SPARC32_D0_REGNUM);
- regcache_raw_write (regcache, regnum, buf);
- regcache_raw_write (regcache, regnum + 1, buf + 4);
+ regcache->raw_write (regnum, buf);
+ regcache->raw_write (regnum + 1, buf + 4);
}
\f
/* Implement the stack_frame_destroyed_p gdbarch method. */
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 9fd6a66..7b1c1d5 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -988,27 +988,27 @@ sparc64_pseudo_register_write (struct gdbarch *gdbarch,
if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D30_REGNUM)
{
regnum = SPARC_F0_REGNUM + 2 * (regnum - SPARC64_D0_REGNUM);
- regcache_raw_write (regcache, regnum, buf);
- regcache_raw_write (regcache, regnum + 1, buf + 4);
+ regcache->raw_write (regnum, buf);
+ regcache->raw_write (regnum + 1, buf + 4);
}
else if (regnum >= SPARC64_D32_REGNUM && regnum <= SPARC64_D62_REGNUM)
{
regnum = SPARC64_F32_REGNUM + (regnum - SPARC64_D32_REGNUM);
- regcache_raw_write (regcache, regnum, buf);
+ regcache->raw_write (regnum, buf);
}
else if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q28_REGNUM)
{
regnum = SPARC_F0_REGNUM + 4 * (regnum - SPARC64_Q0_REGNUM);
- regcache_raw_write (regcache, regnum, buf);
- regcache_raw_write (regcache, regnum + 1, buf + 4);
- regcache_raw_write (regcache, regnum + 2, buf + 8);
- regcache_raw_write (regcache, regnum + 3, buf + 12);
+ regcache->raw_write (regnum, buf);
+ regcache->raw_write (regnum + 1, buf + 4);
+ regcache->raw_write (regnum + 2, buf + 8);
+ regcache->raw_write (regnum + 3, buf + 12);
}
else if (regnum >= SPARC64_Q32_REGNUM && regnum <= SPARC64_Q60_REGNUM)
{
regnum = SPARC64_F32_REGNUM + 2 * (regnum - SPARC64_Q32_REGNUM);
- regcache_raw_write (regcache, regnum, buf);
- regcache_raw_write (regcache, regnum + 1, buf + 8);
+ regcache->raw_write (regnum, buf);
+ regcache->raw_write (regnum + 1, buf + 8);
}
else if (regnum == SPARC64_CWP_REGNUM
|| regnum == SPARC64_PSTATE_REGNUM
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index fd6d098..55d262f 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -280,7 +280,7 @@ spu_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
case SPU_SP_REGNUM:
regcache->raw_read (SPU_RAW_SP_REGNUM, reg);
memcpy (reg, buf, 4);
- regcache_raw_write (regcache, SPU_RAW_SP_REGNUM, reg);
+ regcache->raw_write (SPU_RAW_SP_REGNUM, reg);
break;
case SPU_FPSCR_REGNUM:
diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c
index e11ecdd..9ed6966 100644
--- a/gdb/tilegx-tdep.c
+++ b/gdb/tilegx-tdep.c
@@ -236,7 +236,7 @@ tilegx_store_return_value (struct type *type, struct regcache *regcache,
gdb_byte buf[tilegx_reg_size] = { 0 };
memcpy (buf, valbuf, TYPE_LENGTH (type));
- regcache_raw_write (regcache, TILEGX_R0_REGNUM, buf);
+ regcache->raw_write (TILEGX_R0_REGNUM, buf);
}
else
{
@@ -244,7 +244,7 @@ tilegx_store_return_value (struct type *type, struct regcache *regcache,
int i, regnum = TILEGX_R0_REGNUM;
for (i = 0; i < len; i += tilegx_reg_size)
- regcache_raw_write (regcache, regnum++, (gdb_byte *) valbuf + i);
+ regcache->raw_write (regnum++, (gdb_byte *) valbuf + i);
}
}
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index a8bc599..2a3812d 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -1150,7 +1150,7 @@ v850_store_return_value (struct type *type, struct regcache *regcache,
{
int i, regnum = E_V0_REGNUM;
for (i = 0; i < len; i += 4)
- regcache_raw_write (regcache, regnum++, valbuf + i);
+ regcache->raw_write (regnum++, valbuf + i);
}
}
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index 805c7f2..b80d23e 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -181,7 +181,7 @@ xstormy16_store_return_value (struct type *type, struct regcache *regcache,
gdb_byte buf[xstormy16_reg_size];
memset (buf, 0, xstormy16_reg_size);
memcpy (buf, valbuf, 1);
- regcache_raw_write (regcache, E_1ST_ARG_REGNUM, buf);
+ regcache->raw_write (E_1ST_ARG_REGNUM, buf);
}
else
{
@@ -189,7 +189,7 @@ xstormy16_store_return_value (struct type *type, struct regcache *regcache,
int i, regnum = E_1ST_ARG_REGNUM;
for (i = 0; i < len; i += xstormy16_reg_size)
- regcache_raw_write (regcache, regnum++, valbuf + i);
+ regcache->raw_write (regnum++, valbuf + i);
}
}
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index 32533e8..c23d777 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -661,7 +661,7 @@ xtensa_pseudo_register_write (struct gdbarch *gdbarch,
/* We can always write 'core' registers.
Note: We might have converted Ax->ARy. */
if (regnum >= 0 && regnum < gdbarch_num_regs (gdbarch))
- regcache_raw_write (regcache, regnum, buffer);
+ regcache->raw_write (regnum, buffer);
/* We have to find out how to deal with priveleged registers.
Let's treat them as pseudo-registers, but we cannot read/write them. */
@@ -718,7 +718,7 @@ xtensa_pseudo_register_write (struct gdbarch *gdbarch,
}
/* Assume that we can write the register. */
- regcache_raw_write (regcache, regnum, buffer);
+ regcache->raw_write (regnum, buffer);
}
else
internal_error (__FILE__, __LINE__,
@@ -1648,7 +1648,7 @@ xtensa_store_return_value (struct type *type,
if (len < 4)
regcache_raw_write_part (regcache, areg, offset, len, valbuf);
else
- regcache_raw_write (regcache, areg, valbuf);
+ regcache->raw_write (areg, valbuf);
}
}
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 13/15] Remove regcache_cooked_write_part
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
2018-05-30 19:04 ` [pushed 10/15] Remove regcache_cooked_write Simon Marchi
@ 2018-05-30 19:05 ` Simon Marchi
2018-05-30 19:05 ` [pushed 05/15] Remove regcache_raw_write Simon Marchi
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_cooked_write_part, update callers to use
regcache::cooked_write_part.
gdb/ChangeLog:
* regcache.h (regcache_cooked_write_part): Remove, update
callers to use regcache::cooked_write_part.
* regcache.c (regcache_cooked_write_part): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/hppa-tdep.c | 15 +++++++--------
gdb/m32c-tdep.c | 2 +-
gdb/mep-tdep.c | 5 ++---
gdb/mips-tdep.c | 3 +--
gdb/ppc-sysv-tdep.c | 21 ++++++++++-----------
gdb/regcache.c | 7 -------
gdb/regcache.h | 8 ++------
gdb/s390-tdep.c | 17 ++++++-----------
gdb/score-tdep.c | 4 ++--
gdb/spu-tdep.c | 6 +++---
gdb/tic6x-tdep.c | 17 +++++++----------
12 files changed, 47 insertions(+), 64 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0f06926..b0fb0c6 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_cooked_write_part): Remove, update
+ callers to use regcache::cooked_write_part.
+ * regcache.c (regcache_cooked_write_part): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_cooked_read_part): Remove, update callers
to use readable_regcache::cooked_read_part.
* regcache.c (regcache_cooked_read_part): Remove.
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 81e8a4c..1ea3670 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1044,8 +1044,8 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
passed in floating-point registers, are passed in
the right halves of the floating point registers;
the left halves are unused." */
- regcache_cooked_write_part (regcache, regnum, offset % 8,
- len, value_contents (arg));
+ regcache->cooked_write_part (regnum, offset % 8, len,
+ value_contents (arg));
}
}
}
@@ -1086,8 +1086,8 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
regnum = HPPA_ARG0_REGNUM - offset / 8;
while (regnum > HPPA_ARG0_REGNUM - 8 && len > 0)
{
- regcache_cooked_write_part (regcache, regnum,
- offset % 8, std::min (len, 8), valbuf);
+ regcache->cooked_write_part (regnum, offset % 8, std::min (len, 8),
+ valbuf);
offset += std::min (len, 8);
valbuf += std::min (len, 8);
len -= std::min (len, 8);
@@ -1154,8 +1154,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf != NULL)
regcache->cooked_read_part (reg, 4 - part, part, readbuf);
if (writebuf != NULL)
- regcache_cooked_write_part (regcache, reg, 4 - part,
- part, writebuf);
+ regcache->cooked_write_part (reg, 4 - part, part, writebuf);
reg++;
}
/* Now transfer the remaining register values. */
@@ -1254,8 +1253,8 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function,
{
while (len > 0)
{
- regcache_cooked_write_part (regcache, regnum, offset,
- std::min (len, 8), writebuf);
+ regcache->cooked_write_part (regnum, offset, std::min (len, 8),
+ writebuf);
writebuf += std::min (len, 8);
len -= std::min (len, 8);
regnum++;
diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
index b7cba1c..f696568 100644
--- a/gdb/m32c-tdep.c
+++ b/gdb/m32c-tdep.c
@@ -463,7 +463,7 @@ m32c_part_write (struct m32c_reg *reg, struct regcache *cache,
int offset, len;
m32c_find_part (reg, &offset, &len);
- regcache_cooked_write_part (cache, reg->rx->num, offset, len, buf);
+ cache->cooked_write_part (reg->rx->num, offset, len, buf);
return REG_VALID;
}
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 1f3f2bb..c8a5ecf 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -2139,9 +2139,8 @@ mep_store_return_value (struct gdbarch *arch,
else
offset = 0;
- regcache_cooked_write_part (regcache, MEP_R0_REGNUM,
- offset, TYPE_LENGTH (type),
- valbuf);
+ regcache->cooked_write_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type),
+ valbuf);
}
/* Return values larger than a single register are returned in
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index fdf00f0..32b2d40 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -512,8 +512,7 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
if (in != NULL)
regcache->cooked_read_part (reg_num, reg_offset, length, in + buf_offset);
if (out != NULL)
- regcache_cooked_write_part (regcache, reg_num, reg_offset, length,
- out + buf_offset);
+ regcache->cooked_write_part (reg_num, reg_offset, length, out + buf_offset);
if (mips_debug && in != NULL)
{
int i;
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index b7dfdca..0bac225 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -1286,9 +1286,8 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
if (len > 0)
{
if (argpos->regcache && argpos->greg <= 10)
- regcache_cooked_write_part (argpos->regcache,
- tdep->ppc_gp0_regnum + argpos->greg,
- offset, len, val);
+ argpos->regcache->cooked_write_part
+ (tdep->ppc_gp0_regnum + argpos->greg, offset, len, val);
argpos->greg++;
}
}
@@ -1352,8 +1351,8 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch,
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
offset = 8 - TYPE_LENGTH (type);
- regcache_cooked_write_part (argpos->regcache, regnum,
- offset, TYPE_LENGTH (type), val);
+ argpos->regcache->cooked_write_part (regnum, offset,
+ TYPE_LENGTH (type), val);
}
argpos->freg++;
@@ -1802,8 +1801,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
offset = 8 - TYPE_LENGTH (valtype);
if (writebuf != NULL)
- regcache_cooked_write_part (regcache, regnum,
- offset, TYPE_LENGTH (valtype), writebuf);
+ regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype),
+ writebuf);
if (readbuf != NULL)
regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
readbuf);
@@ -1878,8 +1877,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
offset = 8 - TYPE_LENGTH (valtype);
if (writebuf != NULL)
- regcache_cooked_write_part (regcache, regnum,
- offset, TYPE_LENGTH (valtype), writebuf);
+ regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype),
+ writebuf);
if (readbuf != NULL)
regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
readbuf);
@@ -1983,8 +1982,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype));
if (writebuf != NULL)
- regcache_cooked_write_part (regcache, regnum,
- offset, TYPE_LENGTH (valtype), writebuf);
+ regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype),
+ writebuf);
if (readbuf != NULL)
regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
readbuf);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index d8fb36e..758f21c 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -872,13 +872,6 @@ readable_regcache::cooked_read_part (int regnum, int offset, int len,
}
void
-regcache_cooked_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const gdb_byte *buf)
-{
- regcache->cooked_write_part (regnum, offset, len, buf);
-}
-
-void
regcache::cooked_write_part (int regnum, int offset, int len,
const gdb_byte *buf)
{
diff --git a/gdb/regcache.h b/gdb/regcache.h
index f1a3b24..064930c 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -62,12 +62,6 @@ extern void regcache_cooked_write_signed (struct regcache *regcache,
extern void regcache_cooked_write_unsigned (struct regcache *regcache,
int regnum, ULONGEST val);
-/* Partial transfer of a cooked register. These perform read, modify,
- write style operations. */
-
-void regcache_cooked_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const gdb_byte *buf);
-
/* Special routines to read/write the PC. */
/* For regcache_read_pc see common/common-regcache.h. */
@@ -315,6 +309,8 @@ public:
operations. */
void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
+ /* Partial transfer of a cooked register. Perform read, modify, write style
+ operations. */
void cooked_write_part (int regnum, int offset, int len,
const gdb_byte *buf);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index a894b4b..a3a3cb6 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1723,10 +1723,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
/* When we store a single-precision value in an FP register,
it occupies the leftmost bits. */
if (write_mode)
- regcache_cooked_write_part (as->regcache,
- S390_F0_REGNUM + as->fr,
- 0, length,
- value_contents (arg));
+ as->regcache->cooked_write_part (S390_F0_REGNUM + as->fr, 0, length,
+ value_contents (arg));
as->fr += 2;
}
else
@@ -1749,9 +1747,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
int regnum = S390_V24_REGNUM + use_vr[as->vr] - 24;
if (write_mode)
- regcache_cooked_write_part (as->regcache, regnum,
- 0, length,
- value_contents (arg));
+ as->regcache->cooked_write_part (regnum, 0, length,
+ value_contents (arg));
as->vr++;
}
else
@@ -1980,8 +1977,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
{
/* Float-like value: left-aligned in f0. */
if (in != NULL)
- regcache_cooked_write_part (regcache, S390_F0_REGNUM,
- 0, length, in);
+ regcache->cooked_write_part (S390_F0_REGNUM, 0, length, in);
else
regcache->cooked_read_part (S390_F0_REGNUM, 0, length, out);
}
@@ -1989,8 +1985,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
{
/* Vector: left-aligned in v24. */
if (in != NULL)
- regcache_cooked_write_part (regcache, S390_V24_REGNUM,
- 0, length, in);
+ regcache->cooked_write_part (S390_V24_REGNUM, 0, length, in);
else
regcache->cooked_read_part (S390_V24_REGNUM, 0, length, out);
}
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index aa50126..e764c65 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -445,8 +445,8 @@ score_xfer_register (struct regcache *regcache, int regnum, int length,
regcache->cooked_read_part (regnum, reg_offset, length,
readbuf + buf_offset);
if (writebuf != NULL)
- regcache_cooked_write_part (regcache, regnum, reg_offset, length,
- writebuf + buf_offset);
+ regcache->cooked_write_part (regnum, reg_offset, length,
+ writebuf + buf_offset);
}
static enum return_value_convention
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index 583cb62..80458ab 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1356,7 +1356,7 @@ spu_value_to_regcache (struct regcache *regcache, int regnum,
if (spu_scalar_value_p (type))
{
int preferred_slot = len < 4 ? 4 - len : 0;
- regcache_cooked_write_part (regcache, regnum, preferred_slot, len, in);
+ regcache->cooked_write_part (regnum, preferred_slot, len, in);
}
else
{
@@ -1368,7 +1368,7 @@ spu_value_to_regcache (struct regcache *regcache, int regnum,
}
if (len > 0)
- regcache_cooked_write_part (regcache, regnum, 0, len, in);
+ regcache->cooked_write_part (regnum, 0, len, in);
}
}
@@ -1540,7 +1540,7 @@ spu_return_value (struct gdbarch *gdbarch, struct value *function,
{
case RETURN_VALUE_REGISTER_CONVENTION:
if (opencl_vector && TYPE_LENGTH (type) == 2)
- regcache_cooked_write_part (regcache, SPU_ARG1_REGNUM, 2, 2, in);
+ regcache->cooked_write_part (SPU_ARG1_REGNUM, 2, 2, in);
else
spu_value_to_regcache (regcache, SPU_ARG1_REGNUM, type, in);
break;
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index 274b02f..efb8b05 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -760,8 +760,7 @@ tic6x_store_return_value (struct type *valtype, struct regcache *regcache,
if (len <= 4)
{
if (len < 3 && byte_order == BFD_ENDIAN_BIG)
- regcache_cooked_write_part (regcache, TIC6X_A4_REGNUM, 4 - len, len,
- valbuf);
+ regcache->cooked_write_part (TIC6X_A4_REGNUM, 4 - len, len, valbuf);
else
regcache->cooked_write (TIC6X_A4_REGNUM, valbuf);
}
@@ -957,8 +956,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
so, we write the contents in VAL to the lsp of
register. */
if (len < 3 && byte_order == BFD_ENDIAN_BIG)
- regcache_cooked_write_part (regcache, arg_regs[argreg],
- 4 - len, len, val);
+ regcache->cooked_write_part (arg_regs[argreg], 4 - len, len,
+ val);
else
regcache->cooked_write (arg_regs[argreg], val);
}
@@ -988,16 +987,14 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
if (byte_order == BFD_ENDIAN_BIG)
{
regcache->cooked_write (arg_regs[argreg] + 1, val);
- regcache_cooked_write_part (regcache,
- arg_regs[argreg], 0,
- len - 4, val + 4);
+ regcache->cooked_write_part (arg_regs[argreg], 0,
+ len - 4, val + 4);
}
else
{
regcache->cooked_write (arg_regs[argreg], val);
- regcache_cooked_write_part (regcache,
- arg_regs[argreg] + 1, 0,
- len - 4, val + 4);
+ regcache->cooked_write_part (arg_regs[argreg] + 1, 0,
+ len - 4, val + 4);
}
}
else
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 01/15] Remove regcache_get_ptid
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (11 preceding siblings ...)
2018-05-30 19:05 ` [pushed 07/15] Remove regcache_raw_read_part Simon Marchi
@ 2018-05-30 19:06 ` Simon Marchi
2018-05-30 19:24 ` [pushed 12/15] Remove regcache_cooked_read_part Simon Marchi
2018-05-30 19:46 ` [pushed 08/15] Remove regcache_raw_write_part Simon Marchi
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:06 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_get_ptid, change all callers to call the regcache method
directly.
gdb/ChangeLog:
* regcache.h (regcache_get_ptid): Remove, update all callers to
call regcache::ptid instead.
* regcache.c (regcache_get_ptid): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/aarch64-fbsd-nat.c | 4 ++--
gdb/aarch64-linux-nat.c | 8 ++++----
gdb/aix-thread.c | 8 ++++----
gdb/alpha-bsd-nat.c | 12 ++++++------
gdb/amd64-bsd-nat.c | 4 ++--
gdb/amd64-linux-nat.c | 8 ++++----
gdb/arm-fbsd-nat.c | 4 ++--
gdb/arm-linux-nat.c | 16 ++++++++--------
gdb/arm-nbsd-nat.c | 20 ++++++++++----------
gdb/bsd-uthread.c | 4 ++--
gdb/hppa-linux-nat.c | 4 ++--
gdb/hppa-nbsd-nat.c | 4 ++--
gdb/hppa-obsd-nat.c | 2 +-
gdb/i386-bsd-nat.c | 4 ++--
gdb/i386-darwin-nat.c | 4 ++--
gdb/i386-gnu-nat.c | 4 ++--
gdb/i386-linux-nat.c | 8 ++++----
gdb/ia64-linux-nat.c | 4 ++--
gdb/linux-nat-trad.c | 4 ++--
gdb/m32r-linux-nat.c | 4 ++--
gdb/m68k-bsd-nat.c | 4 ++--
gdb/m68k-linux-nat.c | 8 ++++----
gdb/mips-fbsd-nat.c | 4 ++--
gdb/mips-linux-nat.c | 4 ++--
gdb/mips-nbsd-nat.c | 4 ++--
gdb/mips64-obsd-nat.c | 4 ++--
gdb/nto-procfs.c | 4 ++--
gdb/ppc-fbsd-nat.c | 4 ++--
gdb/ppc-linux-nat.c | 4 ++--
gdb/ppc-nbsd-nat.c | 4 ++--
gdb/ppc-obsd-nat.c | 4 ++--
gdb/procfs.c | 4 ++--
gdb/ravenscar-thread.c | 6 +++---
gdb/record-btrace.c | 6 +++---
gdb/regcache.c | 10 ----------
gdb/regcache.h | 8 ++++----
gdb/remote-sim.c | 4 ++--
gdb/remote.c | 4 ++--
gdb/rs6000-nat.c | 4 ++--
gdb/s390-linux-nat.c | 4 ++--
gdb/sh-nbsd-nat.c | 4 ++--
gdb/sol-thread.c | 4 ++--
gdb/sparc-nat.c | 4 ++--
gdb/spu-linux-nat.c | 4 ++--
gdb/spu-multiarch.c | 4 ++--
gdb/tilegx-linux-nat.c | 4 ++--
gdb/vax-bsd-nat.c | 4 ++--
gdb/windows-nat.c | 4 ++--
gdb/xtensa-linux-nat.c | 8 ++++----
50 files changed, 135 insertions(+), 139 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 634207b..1c09d21 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_get_ptid): Remove, update all callers to
+ call regcache::ptid instead.
+ * regcache.c (regcache_get_ptid): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* Makefile.in (ALL_TARGET_OBS): Add or1k-tdep.o.
2018-05-30 Pedro Alves <palves@redhat.com>
diff --git a/gdb/aarch64-fbsd-nat.c b/gdb/aarch64-fbsd-nat.c
index a506563..2d0da7f 100644
--- a/gdb/aarch64-fbsd-nat.c
+++ b/gdb/aarch64-fbsd-nat.c
@@ -60,7 +60,7 @@ void
aarch64_fbsd_nat_target::fetch_registers (struct regcache *regcache,
int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
@@ -93,7 +93,7 @@ void
aarch64_fbsd_nat_target::store_registers (struct regcache *regcache,
int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c
index 908b83a..3672a2f 100644
--- a/gdb/aarch64-linux-nat.c
+++ b/gdb/aarch64-linux-nat.c
@@ -208,7 +208,7 @@ fetch_gregs_from_thread (struct regcache *regcache)
and arm. */
gdb_static_assert (sizeof (regs) >= 18 * 4);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
@@ -245,7 +245,7 @@ store_gregs_to_thread (const struct regcache *regcache)
/* Make sure REGS can hold all registers contents on both aarch64
and arm. */
gdb_static_assert (sizeof (regs) >= 18 * 4);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32)
@@ -289,7 +289,7 @@ fetch_fpregs_from_thread (struct regcache *regcache)
and arm. */
gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
@@ -336,7 +336,7 @@ store_fpregs_to_thread (const struct regcache *regcache)
/* Make sure REGS can hold all VFP registers contents on both aarch64
and arm. */
gdb_static_assert (sizeof regs >= VFP_REGS_SIZE);
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
iovec.iov_base = ®s;
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index d328bdd..6f4135b 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1365,11 +1365,11 @@ aix_thread_target::fetch_registers (struct regcache *regcache, int regno)
pthdb_tid_t tid;
struct target_ops *beneath = find_target_beneath (this);
- if (!PD_TID (regcache_get_ptid (regcache)))
+ if (!PD_TID (regcache->ptid ()))
beneath->fetch_registers (regcache, regno);
else
{
- thread = find_thread_ptid (regcache_get_ptid (regcache));
+ thread = find_thread_ptid (regcache->ptid ());
aix_thread_info *priv = get_aix_thread_info (thread);
tid = priv->tid;
@@ -1719,11 +1719,11 @@ aix_thread_target::store_registers (struct regcache *regcache, int regno)
pthdb_tid_t tid;
struct target_ops *beneath = find_target_beneath (this);
- if (!PD_TID (regcache_get_ptid (regcache)))
+ if (!PD_TID (regcache->ptid ()))
beneath->store_registers (regcache, regno);
else
{
- thread = find_thread_ptid (regcache_get_ptid (regcache));
+ thread = find_thread_ptid (regcache->ptid ());
aix_thread_info *priv = get_aix_thread_info (thread);
tid = priv->tid;
diff --git a/gdb/alpha-bsd-nat.c b/gdb/alpha-bsd-nat.c
index 77271ec..e889d22 100644
--- a/gdb/alpha-bsd-nat.c
+++ b/gdb/alpha-bsd-nat.c
@@ -98,7 +98,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
struct reg gregs;
- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@@ -112,7 +112,7 @@ alpha_bsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
@@ -129,13 +129,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
if (regno == -1 || getregs_supplies (regno))
{
struct reg gregs;
- if (ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't get registers"));
alphabsd_fill_reg (regcache, (char *) &gregs, regno);
- if (ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &gregs, 0) == -1)
perror_with_name (_("Couldn't write registers"));
@@ -148,13 +148,13 @@ alpha_bsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
struct fpreg fpregs;
- if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't get floating point status"));
alphabsd_fill_fpreg (regcache, (char *) &fpregs, regno);
- if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ if (ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &fpregs, 0) == -1)
perror_with_name (_("Couldn't write floating point status"));
}
diff --git a/gdb/amd64-bsd-nat.c b/gdb/amd64-bsd-nat.c
index 74a1842..81ba835 100644
--- a/gdb/amd64-bsd-nat.c
+++ b/gdb/amd64-bsd-nat.c
@@ -42,7 +42,7 @@ void
amd64bsd_fetch_inferior_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
@@ -115,7 +115,7 @@ void
amd64bsd_store_inferior_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 1cb4c2c..17de388 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
@@ -148,9 +148,9 @@ amd64_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
int tid;
/* GNU/Linux LWP ID's are process ID's. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (tid == 0)
- tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program. */
+ tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
@@ -226,9 +226,9 @@ amd64_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
int tid;
/* GNU/Linux LWP ID's are process ID's. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (tid == 0)
- tid = ptid_get_pid (regcache_get_ptid (regcache)); /* Not a threaded program. */
+ tid = ptid_get_pid (regcache->ptid ()); /* Not a threaded program. */
if (regnum == -1 || amd64_native_gregset_supplies_p (gdbarch, regnum))
{
diff --git a/gdb/arm-fbsd-nat.c b/gdb/arm-fbsd-nat.c
index be733ff..34b1335 100644
--- a/gdb/arm-fbsd-nat.c
+++ b/gdb/arm-fbsd-nat.c
@@ -64,7 +64,7 @@ getvfpregs_supplies (struct gdbarch *gdbarch, int regnum)
void
arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
@@ -98,7 +98,7 @@ arm_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
void
arm_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index 30030b4..ccf812b 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -119,7 +119,7 @@ fetch_fpregs (struct regcache *regcache)
gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE];
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
/* Read the floating point state. */
if (have_ptrace_getregset == TRIBOOL_TRUE)
@@ -156,7 +156,7 @@ store_fpregs (const struct regcache *regcache)
gdb_byte fp[ARM_LINUX_SIZEOF_NWFPE];
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
/* Read the floating point state. */
if (have_ptrace_getregset == TRIBOOL_TRUE)
@@ -210,7 +210,7 @@ fetch_regs (struct regcache *regcache)
elf_gregset_t regs;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (have_ptrace_getregset == TRIBOOL_TRUE)
{
@@ -237,7 +237,7 @@ store_regs (const struct regcache *regcache)
elf_gregset_t regs;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
/* Fetch the general registers. */
if (have_ptrace_getregset == TRIBOOL_TRUE)
@@ -285,7 +285,7 @@ fetch_wmmx_regs (struct regcache *regcache)
int ret, regno, tid;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
ret = ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf);
if (ret < 0)
@@ -311,7 +311,7 @@ store_wmmx_regs (const struct regcache *regcache)
int ret, regno, tid;
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
ret = ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf);
if (ret < 0)
@@ -350,7 +350,7 @@ fetch_vfp_regs (struct regcache *regcache)
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (have_ptrace_getregset == TRIBOOL_TRUE)
{
@@ -379,7 +379,7 @@ store_vfp_regs (const struct regcache *regcache)
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
/* Get the thread id for the ptrace call. */
- tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ tid = ptid_get_lwp (regcache->ptid ());
if (have_ptrace_getregset == TRIBOOL_TRUE)
{
diff --git a/gdb/arm-nbsd-nat.c b/gdb/arm-nbsd-nat.c
index 3a1ddea..3d64346 100644
--- a/gdb/arm-nbsd-nat.c
+++ b/gdb/arm-nbsd-nat.c
@@ -87,7 +87,7 @@ fetch_register (struct regcache *regcache, int regno)
struct reg inferior_registers;
int ret;
- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
@@ -140,7 +140,7 @@ fetch_regs (struct regcache *regcache)
int ret;
int regno;
- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
@@ -158,7 +158,7 @@ fetch_fp_register (struct regcache *regcache, int regno)
struct fpreg inferior_fp_registers;
int ret;
- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
@@ -188,7 +188,7 @@ fetch_fp_regs (struct regcache *regcache)
int ret;
int regno;
- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
@@ -225,7 +225,7 @@ store_register (const struct regcache *regcache, int regno)
struct reg inferior_registers;
int ret;
- ret = ptrace (PT_GETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
@@ -288,7 +288,7 @@ store_register (const struct regcache *regcache, int regno)
break;
}
- ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
@@ -336,7 +336,7 @@ store_regs (const struct regcache *regcache)
inferior_registers.r_pc = pc_val | psr_val;
}
- ret = ptrace (PT_SETREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_registers, 0);
if (ret < 0)
@@ -349,7 +349,7 @@ store_fp_register (const struct regcache *regcache, int regno)
struct fpreg inferior_fp_registers;
int ret;
- ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_GETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
@@ -371,7 +371,7 @@ store_fp_register (const struct regcache *regcache, int regno)
break;
}
- ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
@@ -393,7 +393,7 @@ store_fp_regs (const struct regcache *regcache)
regcache_raw_collect (regcache, ARM_FPS_REGNUM,
(char *) &inferior_fp_registers.fpr_fpsr);
- ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache_get_ptid (regcache)),
+ ret = ptrace (PT_SETFPREGS, ptid_get_pid (regcache->ptid ()),
(PTRACE_TYPE_ARG3) &inferior_fp_registers, 0);
if (ret < 0)
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 1505cfe..9ead7c2 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -321,7 +321,7 @@ bsd_uthread_target::fetch_registers (struct regcache *regcache, int regnum)
struct gdbarch *gdbarch = regcache->arch ();
struct bsd_uthread_ops *uthread_ops
= (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
CORE_ADDR addr = ptid_get_tid (ptid);
struct target_ops *beneath = find_target_beneath (this);
CORE_ADDR active_addr;
@@ -355,7 +355,7 @@ bsd_uthread_target::store_registers (struct regcache *regcache, int regnum)
struct bsd_uthread_ops *uthread_ops
= (struct bsd_uthread_ops *) gdbarch_data (gdbarch, bsd_uthread_data);
struct target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
CORE_ADDR addr = ptid_get_tid (ptid);
CORE_ADDR active_addr;
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c
index bc6c234..39ae83f 100644
--- a/gdb/hppa-linux-nat.c
+++ b/gdb/hppa-linux-nat.c
@@ -233,7 +233,7 @@ fetch_register (struct regcache *regcache, int regno)
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0);
@@ -257,7 +257,7 @@ store_register (const struct regcache *regcache, int regno)
if (gdbarch_cannot_store_register (gdbarch, regno))
return;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
regcache_raw_collect (regcache, regno, &val);
diff --git a/gdb/hppa-nbsd-nat.c b/gdb/hppa-nbsd-nat.c
index 3547d65..2ffa5bc 100644
--- a/gdb/hppa-nbsd-nat.c
+++ b/gdb/hppa-nbsd-nat.c
@@ -170,7 +170,7 @@ void
hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum))
{
@@ -199,7 +199,7 @@ hppa_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
void
hppa_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || hppanbsd_gregset_supplies_p (regnum))
{
diff --git a/gdb/hppa-obsd-nat.c b/gdb/hppa-obsd-nat.c
index 43c2dcc..2ef2f7e 100644
--- a/gdb/hppa-obsd-nat.c
+++ b/gdb/hppa-obsd-nat.c
@@ -196,7 +196,7 @@ hppaobsd_collect_fpregset (struct regcache *regcache,
void
hppa_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || hppaobsd_gregset_supplies_p (regnum))
{
diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c
index f7f27ceb..cca4629 100644
--- a/gdb/i386-bsd-nat.c
+++ b/gdb/i386-bsd-nat.c
@@ -130,7 +130,7 @@ i386bsd_collect_gregset (const struct regcache *regcache,
void
i386bsd_fetch_inferior_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || GETREGS_SUPPLIES (regnum))
{
@@ -193,7 +193,7 @@ i386bsd_fetch_inferior_registers (struct regcache *regcache, int regnum)
void
i386bsd_store_inferior_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || GETREGS_SUPPLIES (regnum))
{
diff --git a/gdb/i386-darwin-nat.c b/gdb/i386-darwin-nat.c
index e57b126..03adb20 100644
--- a/gdb/i386-darwin-nat.c
+++ b/gdb/i386-darwin-nat.c
@@ -59,7 +59,7 @@ static struct i386_darwin_nat_target darwin_target;
void
i386_darwin_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache));
+ thread_t current_thread = ptid_get_tid (regcache->ptid ());
int fetched = 0;
struct gdbarch *gdbarch = regcache->arch ();
@@ -176,7 +176,7 @@ void
i386_darwin_nat_target::store_registers (struct regcache *regcache,
int regno)
{
- thread_t current_thread = ptid_get_tid (regcache_get_ptid (regcache));
+ thread_t current_thread = ptid_get_tid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
#ifdef BFD64
diff --git a/gdb/i386-gnu-nat.c b/gdb/i386-gnu-nat.c
index 8bb036d..e5195f3 100644
--- a/gdb/i386-gnu-nat.c
+++ b/gdb/i386-gnu-nat.c
@@ -108,7 +108,7 @@ gnu_fetch_registers (struct target_ops *ops,
struct regcache *regcache, int regno)
{
struct proc *thread;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
/* Make sure we know about new threads. */
inf_update_procs (gnu_current_inf);
@@ -201,7 +201,7 @@ gnu_store_registers (struct target_ops *ops,
{
struct proc *thread;
struct gdbarch *gdbarch = regcache->arch ();
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
/* Make sure we know about new threads. */
inf_update_procs (gnu_current_inf);
diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c
index 6538324..054638b 100644
--- a/gdb/i386-linux-nat.c
+++ b/gdb/i386-linux-nat.c
@@ -116,7 +116,7 @@ fetch_register (struct regcache *regcache, int regno)
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
val = ptrace (PTRACE_PEEKUSER, tid,
@@ -141,7 +141,7 @@ store_register (const struct regcache *regcache, int regno)
if (i386_linux_gregset_reg_offset[regno] == -1)
return;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
errno = 0;
regcache_raw_collect (regcache, regno, &val);
@@ -475,7 +475,7 @@ i386_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_GETFPXREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
@@ -552,7 +552,7 @@ i386_linux_nat_target::store_registers (struct regcache *regcache, int regno)
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_SETFPXREGS requests whenever possible, since it
transfers more registers in one system call. But remember that
diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c
index f73e17a..d095bde 100644
--- a/gdb/ia64-linux-nat.c
+++ b/gdb/ia64-linux-nat.c
@@ -779,7 +779,7 @@ ia64_linux_fetch_register (struct regcache *regcache, int regnum)
return;
}
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
/* This isn't really an address, but ptrace thinks of it as one. */
addr = ia64_register_addr (gdbarch, regnum);
@@ -833,7 +833,7 @@ ia64_linux_store_register (const struct regcache *regcache, int regnum)
if (ia64_cannot_store_register (gdbarch, regnum))
return;
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
/* This isn't really an address, but ptrace thinks of it as one. */
addr = ia64_register_addr (gdbarch, regnum);
diff --git a/gdb/linux-nat-trad.c b/gdb/linux-nat-trad.c
index ce6788c..ed75eed 100644
--- a/gdb/linux-nat-trad.c
+++ b/gdb/linux-nat-trad.c
@@ -45,7 +45,7 @@ linux_nat_trad_target::fetch_register (struct regcache *regcache, int regnum)
return;
}
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
size = register_size (gdbarch, regnum);
buf = (gdb_byte *) alloca (size);
@@ -104,7 +104,7 @@ linux_nat_trad_target::store_register (const struct regcache *regcache,
|| gdbarch_cannot_store_register (gdbarch, regnum))
return;
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
size = register_size (gdbarch, regnum);
buf = (gdb_byte *) alloca (size);
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 09a019a..9d833fa 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -202,7 +202,7 @@ fill_fpregset (const struct regcache *regcache,
void
m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_GETREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
@@ -223,7 +223,7 @@ m32r_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
void
m32r_linux_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_SETREGS request whenever possible, since it
transfers more registers in one system call. */
diff --git a/gdb/m68k-bsd-nat.c b/gdb/m68k-bsd-nat.c
index af907ad..c44f736 100644
--- a/gdb/m68k-bsd-nat.c
+++ b/gdb/m68k-bsd-nat.c
@@ -118,7 +118,7 @@ m68kbsd_collect_fpregset (struct regcache *regcache,
void
m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
{
@@ -147,7 +147,7 @@ m68k_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
void
m68k_bsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || m68kbsd_gregset_supplies_p (regnum))
{
diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c
index e25154c..409a4fd 100644
--- a/gdb/m68k-linux-nat.c
+++ b/gdb/m68k-linux-nat.c
@@ -119,7 +119,7 @@ fetch_register (struct regcache *regcache, int regno)
long regaddr, val;
int i;
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
regaddr = 4 * regmap[regno];
for (i = 0; i < register_size (gdbarch, regno); i += sizeof (long))
@@ -167,7 +167,7 @@ store_register (const struct regcache *regcache, int regno)
long regaddr, val;
int i;
gdb_byte buf[M68K_MAX_REGISTER_SIZE];
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
regaddr = 4 * regmap[regno];
@@ -416,7 +416,7 @@ m68k_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_GETFPXREGS request whenever possible, since it
transfers more registers in one system call, and we'll cache the
@@ -469,7 +469,7 @@ m68k_linux_nat_target::store_registers (struct regcache *regcache, int regno)
return;
}
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
/* Use the PTRACE_SETFPREGS requests whenever possible, since it
transfers more registers in one system call. But remember that
diff --git a/gdb/mips-fbsd-nat.c b/gdb/mips-fbsd-nat.c
index 04fbb2a..7761301 100644
--- a/gdb/mips-fbsd-nat.c
+++ b/gdb/mips-fbsd-nat.c
@@ -63,7 +63,7 @@ getfpregs_supplies (struct gdbarch *gdbarch, int regnum)
void
mips_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
@@ -94,7 +94,7 @@ mips_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
void
mips_fbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t pid = get_ptrace_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 3683107..beb0ea0 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -270,7 +270,7 @@ mips_linux_nat_target::mips64_regsets_fetch_registers
else
is_dsp = 0;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
if (regno == -1 || (!is_fp && !is_dsp))
{
@@ -357,7 +357,7 @@ mips_linux_nat_target::mips64_regsets_store_registers
else
is_dsp = 0;
- tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ tid = get_ptrace_pid (regcache->ptid ());
if (regno == -1 || (!is_fp && !is_dsp))
{
diff --git a/gdb/mips-nbsd-nat.c b/gdb/mips-nbsd-nat.c
index b9fc627..4c61081 100644
--- a/gdb/mips-nbsd-nat.c
+++ b/gdb/mips-nbsd-nat.c
@@ -49,7 +49,7 @@ getregs_supplies (struct gdbarch *gdbarch, int regno)
void
mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regno == -1 || getregs_supplies (gdbarch, regno))
@@ -79,7 +79,7 @@ mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
void
mips_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
struct gdbarch *gdbarch = regcache->arch ();
if (regno == -1 || getregs_supplies (gdbarch, regno))
diff --git a/gdb/mips64-obsd-nat.c b/gdb/mips64-obsd-nat.c
index 7f14b09..27e1ab6 100644
--- a/gdb/mips64-obsd-nat.c
+++ b/gdb/mips64-obsd-nat.c
@@ -89,7 +89,7 @@ void
mips64_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@@ -104,7 +104,7 @@ static void
mips64_obsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index f0ef9b9..fcd3001 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -917,7 +917,7 @@ nto_procfs_target::fetch_registers (struct regcache *regcache, int regno)
reg;
int regsize;
- procfs_set_thread (regcache_get_ptid (regcache));
+ procfs_set_thread (regcache->ptid ());
if (devctl (ctl_fd, DCMD_PROC_GETGREG, ®, sizeof (reg), ®size) == EOK)
nto_supply_gregset (regcache, (char *) ®.greg);
if (devctl (ctl_fd, DCMD_PROC_GETFPREG, ®, sizeof (reg), ®size)
@@ -1393,7 +1393,7 @@ nto_procfs_target::store_registers (struct regcache *regcache, int regno)
unsigned off;
int len, regset, regsize, dev_set, err;
char *data;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ptid_equal (ptid, null_ptid))
return;
diff --git a/gdb/ppc-fbsd-nat.c b/gdb/ppc-fbsd-nat.c
index 6ca4bba..89a7e6e 100644
--- a/gdb/ppc-fbsd-nat.c
+++ b/gdb/ppc-fbsd-nat.c
@@ -127,7 +127,7 @@ void
ppc_fbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
gdb_gregset_t regs;
- pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_lwp (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@@ -153,7 +153,7 @@ void
ppc_fbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
gdb_gregset_t regs;
- pid_t pid = ptid_get_lwp (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_lwp (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c
index eb21f91..7606081 100644
--- a/gdb/ppc-linux-nat.c
+++ b/gdb/ppc-linux-nat.c
@@ -773,7 +773,7 @@ fetch_ppc_registers (struct regcache *regcache, int tid)
void
ppc_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regno == -1)
fetch_ppc_registers (regcache, tid);
@@ -2131,7 +2131,7 @@ ppc_linux_nat_target::masked_watch_num_registers (CORE_ADDR addr, CORE_ADDR mask
void
ppc_linux_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regno >= 0)
store_register (regcache, tid, regno);
diff --git a/gdb/ppc-nbsd-nat.c b/gdb/ppc-nbsd-nat.c
index f6e3884..037b261 100644
--- a/gdb/ppc-nbsd-nat.c
+++ b/gdb/ppc-nbsd-nat.c
@@ -88,7 +88,7 @@ void
ppc_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
@@ -117,7 +117,7 @@ void
ppc_nbsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct gdbarch *gdbarch = regcache->arch ();
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regnum == -1 || getregs_supplies (gdbarch, regnum))
{
diff --git a/gdb/ppc-obsd-nat.c b/gdb/ppc-obsd-nat.c
index 4428dab..88ba0c5 100644
--- a/gdb/ppc-obsd-nat.c
+++ b/gdb/ppc-obsd-nat.c
@@ -82,7 +82,7 @@ void
ppc_obsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@@ -116,7 +116,7 @@ void
ppc_obsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 70619f1..e01d664 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -2063,7 +2063,7 @@ procfs_target::fetch_registers (struct regcache *regcache, int regnum)
{
gdb_gregset_t *gregs;
procinfo *pi;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
int pid = ptid_get_pid (ptid);
int tid = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = regcache->arch ();
@@ -2112,7 +2112,7 @@ procfs_target::store_registers (struct regcache *regcache, int regnum)
{
gdb_gregset_t *gregs;
procinfo *pi;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
int pid = ptid_get_pid (ptid);
int tid = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = regcache->arch ();
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 5f3e179..b8630c3 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -416,7 +416,7 @@ void
ravenscar_thread_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ravenscar_runtime_initialized ()
&& is_ravenscar_task (ptid)
@@ -437,7 +437,7 @@ ravenscar_thread_target::store_registers (struct regcache *regcache,
int regnum)
{
target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ravenscar_runtime_initialized ()
&& is_ravenscar_task (ptid)
@@ -457,7 +457,7 @@ void
ravenscar_thread_target::prepare_to_store (struct regcache *regcache)
{
target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (ravenscar_runtime_initialized ()
&& is_ravenscar_task (ptid)
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index 0f01ace..35c8421 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -1536,7 +1536,7 @@ record_btrace_target::fetch_registers (struct regcache *regcache, int regno)
struct btrace_insn_iterator *replay;
struct thread_info *tp;
- tp = find_thread_ptid (regcache_get_ptid (regcache));
+ tp = find_thread_ptid (regcache->ptid ());
gdb_assert (tp != NULL);
replay = tp->btrace.replay;
@@ -1572,7 +1572,7 @@ record_btrace_target::store_registers (struct regcache *regcache, int regno)
struct target_ops *t;
if (!record_btrace_generating_corefile
- && record_is_replaying (regcache_get_ptid (regcache)))
+ && record_is_replaying (regcache->ptid ()))
error (_("Cannot write registers while replaying."));
gdb_assert (may_write_registers != 0);
@@ -1586,7 +1586,7 @@ void
record_btrace_target::prepare_to_store (struct regcache *regcache)
{
if (!record_btrace_generating_corefile
- && record_is_replaying (regcache_get_ptid (regcache)))
+ && record_is_replaying (regcache->ptid ()))
return;
this->beneath->prepare_to_store (regcache);
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 83bcbd2..9881e92 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -223,16 +223,6 @@ reg_buffer::arch () const
return m_descr->gdbarch;
}
-/* See regcache.h. */
-
-ptid_t
-regcache_get_ptid (const struct regcache *regcache)
-{
- gdb_assert (!ptid_equal (regcache->ptid (), minus_one_ptid));
-
- return regcache->ptid ();
-}
-
/* Cleanup class for invalidating a register. */
class regcache_invalidator
diff --git a/gdb/regcache.h b/gdb/regcache.h
index d7bb8b5..7fcc43a 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -35,10 +35,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
struct gdbarch *,
struct address_space *);
-/* Return REGCACHE's ptid. */
-
-extern ptid_t regcache_get_ptid (const struct regcache *regcache);
-
enum register_status regcache_register_status (const struct regcache *regcache,
int regnum);
@@ -357,8 +353,12 @@ public:
void collect_regset (const struct regset *regset, int regnum,
void *buf, size_t size) const;
+ /* Return REGCACHE's ptid. */
+
ptid_t ptid () const
{
+ gdb_assert (m_ptid != minus_one_ptid);
+
return m_ptid;
}
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 5fd24cb..9c89ab9 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -469,7 +469,7 @@ void
gdbsim_target::fetch_registers (struct regcache *regcache, int regno)
{
struct gdbarch *gdbarch = regcache->arch ();
- struct inferior *inf = find_inferior_ptid (regcache_get_ptid (regcache));
+ struct inferior *inf = find_inferior_ptid (regcache->ptid ());
struct sim_inferior_data *sim_data
= get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED);
@@ -538,7 +538,7 @@ void
gdbsim_target::store_registers (struct regcache *regcache, int regno)
{
struct gdbarch *gdbarch = regcache->arch ();
- struct inferior *inf = find_inferior_ptid (regcache_get_ptid (regcache));
+ struct inferior *inf = find_inferior_ptid (regcache->ptid ());
struct sim_inferior_data *sim_data
= get_sim_inferior_data (inf, SIM_INSTANCE_NEEDED);
diff --git a/gdb/remote.c b/gdb/remote.c
index e7ade41..3df9ad4 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8281,7 +8281,7 @@ remote_target::fetch_registers (struct regcache *regcache, int regnum)
int i;
set_remote_traceframe ();
- set_general_thread (regcache_get_ptid (regcache));
+ set_general_thread (regcache->ptid ());
if (regnum >= 0)
{
@@ -8438,7 +8438,7 @@ remote_target::store_registers (struct regcache *regcache, int regnum)
int i;
set_remote_traceframe ();
- set_general_thread (regcache_get_ptid (regcache));
+ set_general_thread (regcache->ptid ());
if (regnum >= 0)
{
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index e9f0647..689d8e8 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -191,7 +191,7 @@ fetch_register (struct regcache *regcache, int regno)
struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
/* Retrieved values may be -1, so infer errors from errno. */
errno = 0;
@@ -250,7 +250,7 @@ store_register (struct regcache *regcache, int regno)
struct gdbarch *gdbarch = regcache->arch ();
int addr[PPC_MAX_REGISTER_SIZE];
int nr, isfloat;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
/* Fetch the register's value from the register cache. */
regcache_raw_collect (regcache, regno, addr);
diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c
index 3c65c5e..abb06a9 100644
--- a/gdb/s390-linux-nat.c
+++ b/gdb/s390-linux-nat.c
@@ -408,7 +408,7 @@ check_regset (int tid, int regset, int regsize)
void
s390_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
fetch_regs (regcache, tid);
@@ -462,7 +462,7 @@ s390_linux_nat_target::fetch_registers (struct regcache *regcache, int regnum)
void
s390_linux_nat_target::store_registers (struct regcache *regcache, int regnum)
{
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || S390_IS_GREGSET_REGNUM (regnum))
store_regs (regcache, tid, regnum);
diff --git a/gdb/sh-nbsd-nat.c b/gdb/sh-nbsd-nat.c
index 6bd089e..062b522 100644
--- a/gdb/sh-nbsd-nat.c
+++ b/gdb/sh-nbsd-nat.c
@@ -51,7 +51,7 @@ static sh_nbsd_nat_target the_sh_nbsd_nat_target;
void
sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno))
{
@@ -73,7 +73,7 @@ sh_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno)
void
sh_nbsd_nat_target::store_registers (struct regcache *regcache, int regno)
{
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (regno == -1 || GETREGS_SUPPLIES (regcache->arch (), regno))
{
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 22dd8d6..1023f7d 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -488,7 +488,7 @@ sol_thread_target::fetch_registers (struct regcache *regcache, int regnum)
gdb_gregset_t *gregset_p = &gregset;
gdb_fpregset_t *fpregset_p = &fpregset;
struct target_ops *beneath = find_target_beneath (this);
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (!ptid_tid_p (ptid))
{
@@ -540,7 +540,7 @@ sol_thread_target::store_registers (struct regcache *regcache, int regnum)
td_err_e val;
prgregset_t gregset;
prfpregset_t fpregset;
- ptid_t ptid = regcache_get_ptid (regcache);
+ ptid_t ptid = regcache->ptid ();
if (!ptid_tid_p (ptid))
{
diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c
index 8b5c686..86a6b5a 100644
--- a/gdb/sparc-nat.c
+++ b/gdb/sparc-nat.c
@@ -152,7 +152,7 @@ sparc_fetch_inferior_registers (struct regcache *regcache, int regnum)
These functions should instead be paramaterized with an explicit
object (struct regcache, struct thread_info?) into which the LWPs
registers can be written. */
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
if (regnum == SPARC_G0_REGNUM)
{
@@ -193,7 +193,7 @@ sparc_store_inferior_registers (struct regcache *regcache, int regnum)
/* NOTE: cagney/2002-12-02: See comment in fetch_inferior_registers
about threaded assumptions. */
- pid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid = get_ptrace_pid (regcache->ptid ());
if (regnum == -1 || sparc_gregset_supplies_p (gdbarch, regnum))
{
diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index 45485b5..81bb5dd 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -516,7 +516,7 @@ spu_linux_nat_target::fetch_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
- = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* We must be stopped on a spu_run system call. */
if (!parse_spufs_run (&fd, &addr))
@@ -567,7 +567,7 @@ spu_linux_nat_target::store_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
- = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* We must be stopped on a spu_run system call. */
if (!parse_spufs_run (&fd, &addr))
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index 5da5e4e..4a4d500 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -189,7 +189,7 @@ spu_multiarch_target::fetch_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
- = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
@@ -248,7 +248,7 @@ spu_multiarch_target::store_registers (struct regcache *regcache, int regno)
/* Since we use functions that rely on inferior_ptid, we need to set and
restore it. */
scoped_restore save_ptid
- = make_scoped_restore (&inferior_ptid, regcache_get_ptid (regcache));
+ = make_scoped_restore (&inferior_ptid, regcache->ptid ());
/* This version applies only if we're currently in spu_run. */
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_spu)
diff --git a/gdb/tilegx-linux-nat.c b/gdb/tilegx-linux-nat.c
index 753d818..9b596c0 100644
--- a/gdb/tilegx-linux-nat.c
+++ b/gdb/tilegx-linux-nat.c
@@ -137,7 +137,7 @@ tilegx_linux_nat_target::fetch_registers (struct regcache *regcache,
int regnum)
{
elf_gregset_t regs;
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) ®s) < 0)
perror_with_name (_("Couldn't get registers"));
@@ -153,7 +153,7 @@ tilegx_linux_nat_target::store_registers (struct regcache *regcache,
int regnum)
{
elf_gregset_t regs;
- pid_t tid = get_ptrace_pid (regcache_get_ptid (regcache));
+ pid_t tid = get_ptrace_pid (regcache->ptid ());
if (ptrace (PTRACE_GETREGS, tid, 0, (PTRACE_TYPE_ARG3) ®s) < 0)
perror_with_name (_("Couldn't get registers"));
diff --git a/gdb/vax-bsd-nat.c b/gdb/vax-bsd-nat.c
index 7f7b54a..5f67061 100644
--- a/gdb/vax-bsd-nat.c
+++ b/gdb/vax-bsd-nat.c
@@ -74,7 +74,7 @@ void
vax_bsd_nat_target::fetch_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
@@ -89,7 +89,7 @@ void
vax_bsd_nat_target::store_registers (struct regcache *regcache, int regnum)
{
struct reg regs;
- pid_t pid = ptid_get_pid (regcache_get_ptid (regcache));
+ pid_t pid = ptid_get_pid (regcache->ptid ());
if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1)
perror_with_name (_("Couldn't get registers"));
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 608356e..3fd8415 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -582,7 +582,7 @@ do_windows_fetch_inferior_registers (struct regcache *regcache,
void
windows_nat_target::fetch_registers (struct regcache *regcache, int r)
{
- DWORD pid = ptid_get_tid (regcache_get_ptid (regcache));
+ DWORD pid = ptid_get_tid (regcache->ptid ());
windows_thread_info *th = thread_rec (pid, TRUE);
/* Check if TH exists. Windows sometimes uses a non-existent
@@ -611,7 +611,7 @@ do_windows_store_inferior_registers (const struct regcache *regcache,
void
windows_nat_target::store_registers (struct regcache *regcache, int r)
{
- DWORD pid = ptid_get_tid (regcache_get_ptid (regcache));
+ DWORD pid = ptid_get_tid (regcache->ptid ());
windows_thread_info *th = thread_rec (pid, TRUE);
/* Check if TH exists. Windows sometimes uses a non-existent
diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c
index 8d9659b..57a44e3 100644
--- a/gdb/xtensa-linux-nat.c
+++ b/gdb/xtensa-linux-nat.c
@@ -220,7 +220,7 @@ supply_fpregset (struct regcache *regcache,
static void
fetch_gregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
gdb_gregset_t regs;
int areg;
@@ -239,7 +239,7 @@ fetch_gregs (struct regcache *regcache, int regnum)
static void
store_gregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
gdb_gregset_t regs;
int areg;
@@ -267,7 +267,7 @@ static int xtreg_high;
static void
fetch_xtregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
const xtensa_regtable_t *ptr;
char xtregs [XTENSA_ELF_XTREG_SIZE];
@@ -283,7 +283,7 @@ fetch_xtregs (struct regcache *regcache, int regnum)
static void
store_xtregs (struct regcache *regcache, int regnum)
{
- int tid = ptid_get_lwp (regcache_get_ptid (regcache));
+ int tid = ptid_get_lwp (regcache->ptid ());
const xtensa_regtable_t *ptr;
char xtregs [XTENSA_ELF_XTREG_SIZE];
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 12/15] Remove regcache_cooked_read_part
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (12 preceding siblings ...)
2018-05-30 19:06 ` [pushed 01/15] Remove regcache_get_ptid Simon Marchi
@ 2018-05-30 19:24 ` Simon Marchi
2018-05-30 19:46 ` [pushed 08/15] Remove regcache_raw_write_part Simon Marchi
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:24 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_cooked_read_part, update callers to use
readable_regcache::cooked_read_part.
gdb/ChangeLog:
* regcache.h (regcache_cooked_read_part): Remove, update callers
to use readable_regcache::cooked_read_part.
* regcache.c (regcache_cooked_read_part): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/hppa-tdep.c | 7 +++----
gdb/mep-tdep.c | 5 ++---
gdb/mips-tdep.c | 3 +--
gdb/ppc-sysv-tdep.c | 12 ++++++------
gdb/regcache.c | 8 --------
gdb/regcache.h | 4 +---
gdb/s390-tdep.c | 10 ++++------
gdb/score-tdep.c | 4 ++--
gdb/spu-tdep.c | 6 +++---
gdb/tic6x-tdep.c | 3 +--
11 files changed, 29 insertions(+), 39 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4e0b3a2..0f06926 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_cooked_read_part): Remove, update callers
+ to use readable_regcache::cooked_read_part.
+ * regcache.c (regcache_cooked_read_part): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_cooked_read_value): Remove, update
callers to use readable_regcache::cooked_read_value.
* regcache.c (regcache_cooked_read_value): Remove.
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 1f3581e..81e8a4c 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1152,8 +1152,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
if (part > 0)
{
if (readbuf != NULL)
- regcache_cooked_read_part (regcache, reg, 4 - part,
- part, readbuf);
+ regcache->cooked_read_part (reg, 4 - part, part, readbuf);
if (writebuf != NULL)
regcache_cooked_write_part (regcache, reg, 4 - part,
part, writebuf);
@@ -1243,8 +1242,8 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function,
{
while (len > 0)
{
- regcache_cooked_read_part (regcache, regnum, offset,
- std::min (len, 8), readbuf);
+ regcache->cooked_read_part (regnum, offset, std::min (len, 8),
+ readbuf);
readbuf += std::min (len, 8);
len -= std::min (len, 8);
regnum++;
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index 727d247..1f3f2bb 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -2113,9 +2113,8 @@ mep_extract_return_value (struct gdbarch *arch,
offset = 0;
/* Return values that do fit in a single register are returned in R0. */
- regcache_cooked_read_part (regcache, MEP_R0_REGNUM,
- offset, TYPE_LENGTH (type),
- valbuf);
+ regcache->cooked_read_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type),
+ valbuf);
}
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 64b8da7..fdf00f0 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -510,8 +510,7 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
fprintf_unfiltered (gdb_stdlog, "%02x", out[buf_offset + i]);
}
if (in != NULL)
- regcache_cooked_read_part (regcache, reg_num, reg_offset, length,
- in + buf_offset);
+ regcache->cooked_read_part (reg_num, reg_offset, length, in + buf_offset);
if (out != NULL)
regcache_cooked_write_part (regcache, reg_num, reg_offset, length,
out + buf_offset);
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 42dc63c..b7dfdca 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -1805,8 +1805,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
regcache_cooked_write_part (regcache, regnum,
offset, TYPE_LENGTH (valtype), writebuf);
if (readbuf != NULL)
- regcache_cooked_read_part (regcache, regnum,
- offset, TYPE_LENGTH (valtype), readbuf);
+ regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
+ readbuf);
return 1;
}
@@ -1881,8 +1881,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
regcache_cooked_write_part (regcache, regnum,
offset, TYPE_LENGTH (valtype), writebuf);
if (readbuf != NULL)
- regcache_cooked_read_part (regcache, regnum,
- offset, TYPE_LENGTH (valtype), readbuf);
+ regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
+ readbuf);
return 1;
}
@@ -1986,8 +1986,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
regcache_cooked_write_part (regcache, regnum,
offset, TYPE_LENGTH (valtype), writebuf);
if (readbuf != NULL)
- regcache_cooked_read_part (regcache, regnum,
- offset, TYPE_LENGTH (valtype), readbuf);
+ regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
+ readbuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
diff --git a/gdb/regcache.c b/gdb/regcache.c
index ee27f9d..d8fb36e 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -864,14 +864,6 @@ regcache::raw_write_part (int regnum, int offset, int len,
}
enum register_status
-regcache_cooked_read_part (struct regcache *regcache, int regnum,
- int offset, int len, gdb_byte *buf)
-{
- return regcache->cooked_read_part (regnum, offset, len, buf);
-}
-
-
-enum register_status
readable_regcache::cooked_read_part (int regnum, int offset, int len,
gdb_byte *buf)
{
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 3497207..f1a3b24 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -65,9 +65,6 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache,
/* Partial transfer of a cooked register. These perform read, modify,
write style operations. */
-enum register_status regcache_cooked_read_part (struct regcache *regcache,
- int regnum, int offset,
- int len, gdb_byte *buf);
void regcache_cooked_write_part (struct regcache *regcache, int regnum,
int offset, int len, const gdb_byte *buf);
@@ -230,6 +227,7 @@ public:
template<typename T, typename = RequireLongest<T>>
enum register_status cooked_read (int regnum, T *val);
+ /* Partial transfer of a cooked register. */
enum register_status cooked_read_part (int regnum, int offset, int len,
gdb_byte *buf);
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index eaf1550..a894b4b 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -1983,8 +1983,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
regcache_cooked_write_part (regcache, S390_F0_REGNUM,
0, length, in);
else
- regcache_cooked_read_part (regcache, S390_F0_REGNUM,
- 0, length, out);
+ regcache->cooked_read_part (S390_F0_REGNUM, 0, length, out);
}
else if (code == TYPE_CODE_ARRAY)
{
@@ -1993,15 +1992,14 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
regcache_cooked_write_part (regcache, S390_V24_REGNUM,
0, length, in);
else
- regcache_cooked_read_part (regcache, S390_V24_REGNUM,
- 0, length, out);
+ regcache->cooked_read_part (S390_V24_REGNUM, 0, length, out);
}
else if (length <= word_size)
{
/* Integer: zero- or sign-extended in r2. */
if (out != NULL)
- regcache_cooked_read_part (regcache, S390_R2_REGNUM,
- word_size - length, length, out);
+ regcache->cooked_read_part (S390_R2_REGNUM, word_size - length, length,
+ out);
else if (TYPE_UNSIGNED (type))
regcache_cooked_write_unsigned
(regcache, S390_R2_REGNUM,
diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c
index a167932..aa50126 100644
--- a/gdb/score-tdep.c
+++ b/gdb/score-tdep.c
@@ -442,8 +442,8 @@ score_xfer_register (struct regcache *regcache, int regnum, int length,
}
if (readbuf != NULL)
- regcache_cooked_read_part (regcache, regnum, reg_offset, length,
- readbuf + buf_offset);
+ regcache->cooked_read_part (regnum, reg_offset, length,
+ readbuf + buf_offset);
if (writebuf != NULL)
regcache_cooked_write_part (regcache, regnum, reg_offset, length,
writebuf + buf_offset);
diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c
index d8a2107..583cb62 100644
--- a/gdb/spu-tdep.c
+++ b/gdb/spu-tdep.c
@@ -1381,7 +1381,7 @@ spu_regcache_to_value (struct regcache *regcache, int regnum,
if (spu_scalar_value_p (type))
{
int preferred_slot = len < 4 ? 4 - len : 0;
- regcache_cooked_read_part (regcache, regnum, preferred_slot, len, out);
+ regcache->cooked_read_part (regnum, preferred_slot, len, out);
}
else
{
@@ -1393,7 +1393,7 @@ spu_regcache_to_value (struct regcache *regcache, int regnum,
}
if (len > 0)
- regcache_cooked_read_part (regcache, regnum, 0, len, out);
+ regcache->cooked_read_part (regnum, 0, len, out);
}
}
@@ -1556,7 +1556,7 @@ spu_return_value (struct gdbarch *gdbarch, struct value *function,
{
case RETURN_VALUE_REGISTER_CONVENTION:
if (opencl_vector && TYPE_LENGTH (type) == 2)
- regcache_cooked_read_part (regcache, SPU_ARG1_REGNUM, 2, 2, out);
+ regcache->cooked_read_part (SPU_ARG1_REGNUM, 2, 2, out);
else
spu_regcache_to_value (regcache, SPU_ARG1_REGNUM, type, out);
break;
diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c
index 842fe3f..274b02f 100644
--- a/gdb/tic6x-tdep.c
+++ b/gdb/tic6x-tdep.c
@@ -722,8 +722,7 @@ tic6x_extract_return_value (struct type *valtype, struct regcache *regcache,
register and the second byte occupies byte 0.
so, we read the contents in VAL from the LSBs of register. */
if (len < 3 && byte_order == BFD_ENDIAN_BIG)
- regcache_cooked_read_part (regcache, TIC6X_A4_REGNUM, 4 - len, len,
- valbuf);
+ regcache->cooked_read_part (TIC6X_A4_REGNUM, 4 - len, len, valbuf);
else
regcache->cooked_read (TIC6X_A4_REGNUM, valbuf);
}
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [pushed 08/15] Remove regcache_raw_write_part
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
` (13 preceding siblings ...)
2018-05-30 19:24 ` [pushed 12/15] Remove regcache_cooked_read_part Simon Marchi
@ 2018-05-30 19:46 ` Simon Marchi
14 siblings, 0 replies; 16+ messages in thread
From: Simon Marchi @ 2018-05-30 19:46 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Remove regcache_raw_write_part, update callers to use
regcache::raw_write_part instead.
gdb/ChangeLog:
* regcache.h (regcache_raw_write_part): Remove, update callers
to use regcache::raw_write_part instead.
* regcache.c (regcache_raw_write_part): Remove.
---
gdb/ChangeLog | 6 ++++++
gdb/amd64-tdep.c | 6 +++---
gdb/amd64-windows-tdep.c | 2 +-
gdb/i386-tdep.c | 6 +++---
gdb/m68hc11-tdep.c | 5 ++---
gdb/m68k-tdep.c | 5 ++---
gdb/mips-tdep.c | 2 +-
gdb/mn10300-tdep.c | 5 ++---
gdb/regcache.c | 7 +------
gdb/regcache.h | 9 ++-------
gdb/rs6000-tdep.c | 5 ++---
gdb/xtensa-tdep.c | 2 +-
12 files changed, 26 insertions(+), 34 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e7a57c0..d1ae322 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+ * regcache.h (regcache_raw_write_part): Remove, update callers
+ to use regcache::raw_write_part instead.
+ * regcache.c (regcache_raw_write_part): Remove.
+
+2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
+
* regcache.h (regcache_raw_read_part): Remove, update callers to
use readable_regcache::raw_read_part instead.
* regcache.c (regcache_raw_read_part): Remove.
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index dfd1118..9a1e68e 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -847,8 +847,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
regcache->raw_read_part (regnum, offset, std::min (len, 8),
readbuf + i * 8);
if (writebuf)
- regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
- writebuf + i * 8);
+ regcache->raw_write_part (regnum, offset, std::min (len, 8),
+ writebuf + i * 8);
}
return RETURN_VALUE_REGISTER_CONVENTION;
@@ -956,7 +956,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
gdb_assert (regnum != -1);
memset (buf, 0, sizeof buf);
memcpy (buf, valbuf + j * 8, std::min (len, 8));
- regcache_raw_write_part (regcache, regnum, offset, 8, buf);
+ regcache->raw_write_part (regnum, offset, 8, buf);
}
}
}
diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
index bf351ee..7e0c086 100644
--- a/gdb/amd64-windows-tdep.c
+++ b/gdb/amd64-windows-tdep.c
@@ -331,7 +331,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf)
regcache->raw_read_part (regnum, 0, len, readbuf);
if (writebuf)
- regcache_raw_write_part (regcache, regnum, 0, len, writebuf);
+ regcache->raw_write_part (regnum, 0, len, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 353fb89..cdb5fc8 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2880,12 +2880,12 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
int high_size = register_size (gdbarch, HIGH_RETURN_REGNUM);
if (len <= low_size)
- regcache_raw_write_part (regcache, LOW_RETURN_REGNUM, 0, len, valbuf);
+ regcache->raw_write_part (LOW_RETURN_REGNUM, 0, len, valbuf);
else if (len <= (low_size + high_size))
{
regcache->raw_write (LOW_RETURN_REGNUM, valbuf);
- regcache_raw_write_part (regcache, HIGH_RETURN_REGNUM, 0,
- len - low_size, valbuf + low_size);
+ regcache->raw_write_part (HIGH_RETURN_REGNUM, 0, len - low_size,
+ valbuf + low_size);
}
else
internal_error (__FILE__, __LINE__,
diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c
index 064bf5e..1490ee2 100644
--- a/gdb/m68hc11-tdep.c
+++ b/gdb/m68hc11-tdep.c
@@ -1259,11 +1259,10 @@ m68hc11_store_return_value (struct type *type, struct regcache *regcache,
/* First argument is passed in D and X registers. */
if (len <= 2)
- regcache_raw_write_part (regcache, HARD_D_REGNUM, 2 - len, len, valbuf);
+ regcache->raw_write_part (HARD_D_REGNUM, 2 - len, len, valbuf);
else if (len <= 4)
{
- regcache_raw_write_part (regcache, HARD_X_REGNUM, 4 - len,
- len - 2, valbuf);
+ regcache->raw_write_part (HARD_X_REGNUM, 4 - len, len - 2, valbuf);
regcache->raw_write (HARD_D_REGNUM, valbuf + (len - 2));
}
else
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index 31c2771..432c37c 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -329,11 +329,10 @@ m68k_store_return_value (struct type *type, struct regcache *regcache,
int len = TYPE_LENGTH (type);
if (len <= 4)
- regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf);
+ regcache->raw_write_part (M68K_D0_REGNUM, 4 - len, len, valbuf);
else if (len <= 8)
{
- regcache_raw_write_part (regcache, M68K_D0_REGNUM, 8 - len,
- len - 4, valbuf);
+ regcache->raw_write_part (M68K_D0_REGNUM, 8 - len, len - 4, valbuf);
regcache->raw_write (M68K_D1_REGNUM, valbuf + (len - 4));
}
else
diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
index 926b084..64b8da7 100644
--- a/gdb/mips-tdep.c
+++ b/gdb/mips-tdep.c
@@ -780,7 +780,7 @@ mips_pseudo_register_write (struct gdbarch *gdbarch,
register_size (gdbarch, cookednum))
{
if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
- regcache_raw_write_part (regcache, rawnum, 0, 4, buf);
+ regcache->raw_write_part (rawnum, 0, 4, buf);
else
{
/* Sign extend the shortened version of the register prior
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index caaf8d4..edc99a2 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -182,13 +182,12 @@ mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type,
regsz = register_size (gdbarch, reg);
if (len <= regsz)
- regcache_raw_write_part (regcache, reg, 0, len, valbuf);
+ regcache->raw_write_part (reg, 0, len, valbuf);
else if (len <= 2 * regsz)
{
regcache->raw_write (reg, valbuf);
gdb_assert (regsz == register_size (gdbarch, reg + 1));
- regcache_raw_write_part (regcache, reg+1, 0,
- len - regsz, valbuf + regsz);
+ regcache->raw_write_part (reg + 1, 0, len - regsz, valbuf + regsz);
}
else
internal_error (__FILE__, __LINE__,
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 051bd48..371322d 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -873,12 +873,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf
return read_part (regnum, offset, len, buf, true);
}
-void
-regcache_raw_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const gdb_byte *buf)
-{
- regcache->raw_write_part (regnum, offset, len, buf);
-}
+/* See regcache.h. */
void
regcache::raw_write_part (int regnum, int offset, int len,
diff --git a/gdb/regcache.h b/gdb/regcache.h
index 4865d89..af3adf8 100644
--- a/gdb/regcache.h
+++ b/gdb/regcache.h
@@ -50,13 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache,
extern LONGEST regcache_raw_get_signed (struct regcache *regcache,
int regnum);
-/* Partial transfer of raw registers. These perform read, modify,
- write style operations. The read variant returns the status of the
- register. */
-
-void regcache_raw_write_part (struct regcache *regcache, int regnum,
- int offset, int len, const gdb_byte *buf);
-
void regcache_invalidate (struct regcache *regcache, int regnum);
/* Transfer of pseudo-registers. The read variants return a register
@@ -333,6 +326,8 @@ public:
void raw_collect_integer (int regnum, gdb_byte *addr, int addr_len,
bool is_signed) const;
+ /* Partial transfer of raw registers. Perform read, modify, write style
+ operations. */
void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
void cooked_write_part (int regnum, int offset, int len,
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 594f3c4..2523ff6 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -2744,9 +2744,8 @@ efpr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8;
/* Write the portion that overlaps the VMX register. */
- regcache_raw_write_part (regcache, tdep->ppc_vr0_regnum + reg_index,
- offset, register_size (gdbarch, reg_nr),
- buffer);
+ regcache->raw_write_part (tdep->ppc_vr0_regnum + reg_index, offset,
+ register_size (gdbarch, reg_nr), buffer);
}
static enum register_status
diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c
index bee4969..3785c44 100644
--- a/gdb/xtensa-tdep.c
+++ b/gdb/xtensa-tdep.c
@@ -1646,7 +1646,7 @@ xtensa_store_return_value (struct type *type,
for (; len > 0; len -= 4, areg++, valbuf += 4)
{
if (len < 4)
- regcache_raw_write_part (regcache, areg, offset, len, valbuf);
+ regcache->raw_write_part (areg, offset, len, valbuf);
else
regcache->raw_write (areg, valbuf);
}
--
2.7.4
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2018-05-30 19:06 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-30 19:04 [pushed 00/15] Remove some regcache functions Simon Marchi
2018-05-30 19:04 ` [pushed 10/15] Remove regcache_cooked_write Simon Marchi
2018-05-30 19:05 ` [pushed 13/15] Remove regcache_cooked_write_part Simon Marchi
2018-05-30 19:05 ` [pushed 05/15] Remove regcache_raw_write Simon Marchi
2018-05-30 19:05 ` [pushed 02/15] Remove regcache_register_status Simon Marchi
2018-05-30 19:05 ` [pushed 15/15] Remove regcache_raw_collect Simon Marchi
2018-05-30 19:05 ` [pushed 06/15] Remove regcache_cooked_read Simon Marchi
2018-05-30 19:05 ` [pushed 11/15] Remove regcache_cooked_read_value Simon Marchi
2018-05-30 19:05 ` [pushed 03/15] Remove regcache_raw_update Simon Marchi
2018-05-30 19:05 ` [pushed 09/15] Remove regcache_invalidate Simon Marchi
2018-05-30 19:05 ` [pushed 14/15] Remove regcache_raw_supply Simon Marchi
2018-05-30 19:05 ` [pushed 04/15] Remove regcache_raw_read Simon Marchi
2018-05-30 19:05 ` [pushed 07/15] Remove regcache_raw_read_part Simon Marchi
2018-05-30 19:06 ` [pushed 01/15] Remove regcache_get_ptid Simon Marchi
2018-05-30 19:24 ` [pushed 12/15] Remove regcache_cooked_read_part Simon Marchi
2018-05-30 19:46 ` [pushed 08/15] Remove regcache_raw_write_part Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).