Remove regcache_raw_write_part

Remove regcache_raw_write_part, update callers to use
regcache::raw_write_part instead.

gdb/ChangeLog:

	* regcache.h (regcache_raw_write_part): Remove, update callers
	to use regcache::raw_write_part instead.
	* regcache.c (regcache_raw_write_part): Remove.
This commit is contained in:
Simon Marchi 2018-05-30 14:54:40 -04:00
parent 502fe83eb5
commit 4f0420fdab
12 changed files with 26 additions and 34 deletions

View File

@ -1,3 +1,9 @@
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
* regcache.h (regcache_raw_write_part): Remove, update callers
to use regcache::raw_write_part instead.
* regcache.c (regcache_raw_write_part): Remove.
2018-05-30 Simon Marchi <simon.marchi@ericsson.com>
* regcache.h (regcache_raw_read_part): Remove, update callers to

View File

@ -847,8 +847,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
regcache->raw_read_part (regnum, offset, std::min (len, 8),
readbuf + i * 8);
if (writebuf)
regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8),
writebuf + i * 8);
regcache->raw_write_part (regnum, offset, std::min (len, 8),
writebuf + i * 8);
}
return RETURN_VALUE_REGISTER_CONVENTION;
@ -956,7 +956,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs,
gdb_assert (regnum != -1);
memset (buf, 0, sizeof buf);
memcpy (buf, valbuf + j * 8, std::min (len, 8));
regcache_raw_write_part (regcache, regnum, offset, 8, buf);
regcache->raw_write_part (regnum, offset, 8, buf);
}
}
}

View File

@ -331,7 +331,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
if (readbuf)
regcache->raw_read_part (regnum, 0, len, readbuf);
if (writebuf)
regcache_raw_write_part (regcache, regnum, 0, len, writebuf);
regcache->raw_write_part (regnum, 0, len, writebuf);
return RETURN_VALUE_REGISTER_CONVENTION;
}
}

View File

@ -2880,12 +2880,12 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
int high_size = register_size (gdbarch, HIGH_RETURN_REGNUM);
if (len <= low_size)
regcache_raw_write_part (regcache, LOW_RETURN_REGNUM, 0, len, valbuf);
regcache->raw_write_part (LOW_RETURN_REGNUM, 0, len, valbuf);
else if (len <= (low_size + high_size))
{
regcache->raw_write (LOW_RETURN_REGNUM, valbuf);
regcache_raw_write_part (regcache, HIGH_RETURN_REGNUM, 0,
len - low_size, valbuf + low_size);
regcache->raw_write_part (HIGH_RETURN_REGNUM, 0, len - low_size,
valbuf + low_size);
}
else
internal_error (__FILE__, __LINE__,

View File

@ -1259,11 +1259,10 @@ m68hc11_store_return_value (struct type *type, struct regcache *regcache,
/* First argument is passed in D and X registers. */
if (len <= 2)
regcache_raw_write_part (regcache, HARD_D_REGNUM, 2 - len, len, valbuf);
regcache->raw_write_part (HARD_D_REGNUM, 2 - len, len, valbuf);
else if (len <= 4)
{
regcache_raw_write_part (regcache, HARD_X_REGNUM, 4 - len,
len - 2, valbuf);
regcache->raw_write_part (HARD_X_REGNUM, 4 - len, len - 2, valbuf);
regcache->raw_write (HARD_D_REGNUM, valbuf + (len - 2));
}
else

View File

@ -329,11 +329,10 @@ m68k_store_return_value (struct type *type, struct regcache *regcache,
int len = TYPE_LENGTH (type);
if (len <= 4)
regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf);
regcache->raw_write_part (M68K_D0_REGNUM, 4 - len, len, valbuf);
else if (len <= 8)
{
regcache_raw_write_part (regcache, M68K_D0_REGNUM, 8 - len,
len - 4, valbuf);
regcache->raw_write_part (M68K_D0_REGNUM, 8 - len, len - 4, valbuf);
regcache->raw_write (M68K_D1_REGNUM, valbuf + (len - 4));
}
else

View File

@ -780,7 +780,7 @@ mips_pseudo_register_write (struct gdbarch *gdbarch,
register_size (gdbarch, cookednum))
{
if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p)
regcache_raw_write_part (regcache, rawnum, 0, 4, buf);
regcache->raw_write_part (rawnum, 0, 4, buf);
else
{
/* Sign extend the shortened version of the register prior

View File

@ -182,13 +182,12 @@ mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type,
regsz = register_size (gdbarch, reg);
if (len <= regsz)
regcache_raw_write_part (regcache, reg, 0, len, valbuf);
regcache->raw_write_part (reg, 0, len, valbuf);
else if (len <= 2 * regsz)
{
regcache->raw_write (reg, valbuf);
gdb_assert (regsz == register_size (gdbarch, reg + 1));
regcache_raw_write_part (regcache, reg+1, 0,
len - regsz, valbuf + regsz);
regcache->raw_write_part (reg + 1, 0, len - regsz, valbuf + regsz);
}
else
internal_error (__FILE__, __LINE__,

View File

@ -873,12 +873,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf
return read_part (regnum, offset, len, buf, true);
}
void
regcache_raw_write_part (struct regcache *regcache, int regnum,
int offset, int len, const gdb_byte *buf)
{
regcache->raw_write_part (regnum, offset, len, buf);
}
/* See regcache.h. */
void
regcache::raw_write_part (int regnum, int offset, int len,

View File

@ -50,13 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache,
extern LONGEST regcache_raw_get_signed (struct regcache *regcache,
int regnum);
/* Partial transfer of raw registers. These perform read, modify,
write style operations. The read variant returns the status of the
register. */
void regcache_raw_write_part (struct regcache *regcache, int regnum,
int offset, int len, const gdb_byte *buf);
void regcache_invalidate (struct regcache *regcache, int regnum);
/* Transfer of pseudo-registers. The read variants return a register
@ -333,6 +326,8 @@ public:
void raw_collect_integer (int regnum, gdb_byte *addr, int addr_len,
bool is_signed) const;
/* Partial transfer of raw registers. Perform read, modify, write style
operations. */
void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
void cooked_write_part (int regnum, int offset, int len,

View File

@ -2744,9 +2744,8 @@ efpr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache,
int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8;
/* Write the portion that overlaps the VMX register. */
regcache_raw_write_part (regcache, tdep->ppc_vr0_regnum + reg_index,
offset, register_size (gdbarch, reg_nr),
buffer);
regcache->raw_write_part (tdep->ppc_vr0_regnum + reg_index, offset,
register_size (gdbarch, reg_nr), buffer);
}
static enum register_status

View File

@ -1646,7 +1646,7 @@ xtensa_store_return_value (struct type *type,
for (; len > 0; len -= 4, areg++, valbuf += 4)
{
if (len < 4)
regcache_raw_write_part (regcache, areg, offset, len, valbuf);
regcache->raw_write_part (areg, offset, len, valbuf);
else
regcache->raw_write (areg, valbuf);
}