aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-05-30 14:54:42 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2018-05-30 14:54:42 -0400
commitb66f5587de2a096f357124b20376b2bab980238b (patch)
tree54bff71969b64a818820a645ce4ee8046401cbb8
parent6aa7d72401387cacc5a7699520045ce9083a526a (diff)
downloadgdb-b66f5587de2a096f357124b20376b2bab980238b.zip
gdb-b66f5587de2a096f357124b20376b2bab980238b.tar.gz
gdb-b66f5587de2a096f357124b20376b2bab980238b.tar.bz2
Remove regcache_cooked_write
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.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/aarch64-tdep.c14
-rw-r--r--gdb/alpha-tdep.c18
-rw-r--r--gdb/amd64-tdep.c6
-rw-r--r--gdb/amd64-windows-tdep.c8
-rw-r--r--gdb/arc-tdep.c2
-rw-r--r--gdb/arm-tdep.c19
-rw-r--r--gdb/avr-tdep.c2
-rw-r--r--gdb/bfin-tdep.c2
-rw-r--r--gdb/cris-tdep.c4
-rw-r--r--gdb/frame.c2
-rw-r--r--gdb/frv-tdep.c6
-rw-r--r--gdb/hppa-tdep.c14
-rw-r--r--gdb/i386-darwin-tdep.c4
-rw-r--r--gdb/i386-tdep.c4
-rw-r--r--gdb/ia64-tdep.c4
-rw-r--r--gdb/m32c-tdep.c26
-rw-r--r--gdb/m68k-tdep.c6
-rw-r--r--gdb/microblaze-tdep.c4
-rw-r--r--gdb/nds32-tdep.c16
-rw-r--r--gdb/nios2-tdep.c6
-rw-r--r--gdb/or1k-tdep.c6
-rw-r--r--gdb/ppc-sysv-tdep.c180
-rw-r--r--gdb/record-full.c3
-rw-r--r--gdb/regcache.c7
-rw-r--r--gdb/regcache.h13
-rw-r--r--gdb/riscv-tdep.c14
-rw-r--r--gdb/rs6000-aix-tdep.c22
-rw-r--r--gdb/rs6000-lynx178-tdep.c22
-rw-r--r--gdb/s390-tdep.c15
-rw-r--r--gdb/sparc-tdep.c24
-rw-r--r--gdb/sparc64-tdep.c35
-rw-r--r--gdb/spu-tdep.c8
-rw-r--r--gdb/tic6x-tdep.c18
-rw-r--r--gdb/vax-tdep.c10
-rw-r--r--gdb/xtensa-tdep.c6
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;