From: Simon Marchi Date: Wed, 30 May 2018 18:54:40 +0000 (-0400) Subject: Remove regcache_raw_write_part X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4f0420fdabda76f462bd29a02d9be575e0e0cce7;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e7a57c0100b..d1ae322a107 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-05-30 Simon Marchi + + * 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 * regcache.h (regcache_raw_read_part): Remove, update callers to diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index dfd1118b69c..9a1e68ecb17 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -847,8 +847,8 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function, regcache->raw_read_part (regnum, offset, std::min (len, 8), readbuf + i * 8); if (writebuf) - regcache_raw_write_part (regcache, regnum, offset, std::min (len, 8), - writebuf + i * 8); + regcache->raw_write_part (regnum, offset, std::min (len, 8), + writebuf + i * 8); } return RETURN_VALUE_REGISTER_CONVENTION; @@ -956,7 +956,7 @@ amd64_push_arguments (struct regcache *regcache, int nargs, gdb_assert (regnum != -1); memset (buf, 0, sizeof buf); memcpy (buf, valbuf + j * 8, std::min (len, 8)); - regcache_raw_write_part (regcache, regnum, offset, 8, buf); + regcache->raw_write_part (regnum, offset, 8, buf); } } } diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c index bf351ee21d4..7e0c086a1e5 100644 --- a/gdb/amd64-windows-tdep.c +++ b/gdb/amd64-windows-tdep.c @@ -331,7 +331,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function, if (readbuf) regcache->raw_read_part (regnum, 0, len, readbuf); if (writebuf) - regcache_raw_write_part (regcache, regnum, 0, len, writebuf); + regcache->raw_write_part (regnum, 0, len, writebuf); return RETURN_VALUE_REGISTER_CONVENTION; } } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index 353fb894a03..cdb5fc8f59b 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2880,12 +2880,12 @@ i386_store_return_value (struct gdbarch *gdbarch, struct type *type, int high_size = register_size (gdbarch, HIGH_RETURN_REGNUM); if (len <= low_size) - regcache_raw_write_part (regcache, LOW_RETURN_REGNUM, 0, len, valbuf); + regcache->raw_write_part (LOW_RETURN_REGNUM, 0, len, valbuf); else if (len <= (low_size + high_size)) { regcache->raw_write (LOW_RETURN_REGNUM, valbuf); - regcache_raw_write_part (regcache, HIGH_RETURN_REGNUM, 0, - len - low_size, valbuf + low_size); + regcache->raw_write_part (HIGH_RETURN_REGNUM, 0, len - low_size, + valbuf + low_size); } else internal_error (__FILE__, __LINE__, diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index 064bf5e5658..1490ee28668 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1259,11 +1259,10 @@ m68hc11_store_return_value (struct type *type, struct regcache *regcache, /* First argument is passed in D and X registers. */ if (len <= 2) - regcache_raw_write_part (regcache, HARD_D_REGNUM, 2 - len, len, valbuf); + regcache->raw_write_part (HARD_D_REGNUM, 2 - len, len, valbuf); else if (len <= 4) { - regcache_raw_write_part (regcache, HARD_X_REGNUM, 4 - len, - len - 2, valbuf); + regcache->raw_write_part (HARD_X_REGNUM, 4 - len, len - 2, valbuf); regcache->raw_write (HARD_D_REGNUM, valbuf + (len - 2)); } else diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 31c27714cbf..432c37cbdec 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -329,11 +329,10 @@ m68k_store_return_value (struct type *type, struct regcache *regcache, int len = TYPE_LENGTH (type); if (len <= 4) - regcache_raw_write_part (regcache, M68K_D0_REGNUM, 4 - len, len, valbuf); + regcache->raw_write_part (M68K_D0_REGNUM, 4 - len, len, valbuf); else if (len <= 8) { - regcache_raw_write_part (regcache, M68K_D0_REGNUM, 8 - len, - len - 4, valbuf); + regcache->raw_write_part (M68K_D0_REGNUM, 8 - len, len - 4, valbuf); regcache->raw_write (M68K_D1_REGNUM, valbuf + (len - 4)); } else diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 926b084fc1e..64b8da764b3 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -780,7 +780,7 @@ mips_pseudo_register_write (struct gdbarch *gdbarch, register_size (gdbarch, cookednum)) { if (gdbarch_tdep (gdbarch)->mips64_transfers_32bit_regs_p) - regcache_raw_write_part (regcache, rawnum, 0, 4, buf); + regcache->raw_write_part (rawnum, 0, 4, buf); else { /* Sign extend the shortened version of the register prior diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index caaf8d4581f..edc99a2faba 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -182,13 +182,12 @@ mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type, regsz = register_size (gdbarch, reg); if (len <= regsz) - regcache_raw_write_part (regcache, reg, 0, len, valbuf); + regcache->raw_write_part (reg, 0, len, valbuf); else if (len <= 2 * regsz) { regcache->raw_write (reg, valbuf); gdb_assert (regsz == register_size (gdbarch, reg + 1)); - regcache_raw_write_part (regcache, reg+1, 0, - len - regsz, valbuf + regsz); + regcache->raw_write_part (reg + 1, 0, len - regsz, valbuf + regsz); } else internal_error (__FILE__, __LINE__, diff --git a/gdb/regcache.c b/gdb/regcache.c index 051bd4855dd..371322d9a1e 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -873,12 +873,7 @@ readable_regcache::raw_read_part (int regnum, int offset, int len, gdb_byte *buf return read_part (regnum, offset, len, buf, true); } -void -regcache_raw_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf) -{ - regcache->raw_write_part (regnum, offset, len, buf); -} +/* See regcache.h. */ void regcache::raw_write_part (int regnum, int offset, int len, diff --git a/gdb/regcache.h b/gdb/regcache.h index 4865d89cf2e..af3adf8d212 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -50,13 +50,6 @@ extern void regcache_raw_write_unsigned (struct regcache *regcache, extern LONGEST regcache_raw_get_signed (struct regcache *regcache, int regnum); -/* Partial transfer of raw registers. These perform read, modify, - write style operations. The read variant returns the status of the - register. */ - -void regcache_raw_write_part (struct regcache *regcache, int regnum, - int offset, int len, const gdb_byte *buf); - void regcache_invalidate (struct regcache *regcache, int regnum); /* Transfer of pseudo-registers. The read variants return a register @@ -333,6 +326,8 @@ public: void raw_collect_integer (int regnum, gdb_byte *addr, int addr_len, bool is_signed) const; + /* Partial transfer of raw registers. Perform read, modify, write style + operations. */ void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf); void cooked_write_part (int regnum, int offset, int len, diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 594f3c41ef8..2523ff60761 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -2744,9 +2744,8 @@ efpr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; /* Write the portion that overlaps the VMX register. */ - regcache_raw_write_part (regcache, tdep->ppc_vr0_regnum + reg_index, - offset, register_size (gdbarch, reg_nr), - buffer); + regcache->raw_write_part (tdep->ppc_vr0_regnum + reg_index, offset, + register_size (gdbarch, reg_nr), buffer); } static enum register_status diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index bee4969c6dc..3785c44c878 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -1646,7 +1646,7 @@ xtensa_store_return_value (struct type *type, for (; len > 0; len -= 4, areg++, valbuf += 4) { if (len < 4) - regcache_raw_write_part (regcache, areg, offset, len, valbuf); + regcache->raw_write_part (areg, offset, len, valbuf); else regcache->raw_write (areg, valbuf); }