Remove regcache_cooked_read

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.
This commit is contained in:
Simon Marchi 2018-05-30 14:54:38 -04:00
parent 10eaee5f56
commit dca08e1fe1
31 changed files with 127 additions and 143 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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);

View File

@ -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;

View File

@ -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:

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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++;

View File

@ -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);

View File

@ -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);

View File

@ -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:

View File

@ -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);

View File

@ -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);
}
}
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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)
@ -600,12 +600,6 @@ regcache_raw_get_signed (struct regcache *regcache, int regnum)
return value;
}
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)
{

View File

@ -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);

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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);

View File

@ -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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}
}

View File

@ -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. */

View File

@ -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);
}
}
}

View File

@ -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)