From 73bb0000525a67694c1e8921e7c34ee0d985787e Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Wed, 30 May 2018 14:54:43 -0400 Subject: [PATCH] Remove regcache_cooked_read_part Remove regcache_cooked_read_part, update callers to use readable_regcache::cooked_read_part. gdb/ChangeLog: * regcache.h (regcache_cooked_read_part): Remove, update callers to use readable_regcache::cooked_read_part. * regcache.c (regcache_cooked_read_part): Remove. --- gdb/ChangeLog | 6 ++++++ gdb/hppa-tdep.c | 7 +++---- gdb/mep-tdep.c | 5 ++--- gdb/mips-tdep.c | 3 +-- gdb/ppc-sysv-tdep.c | 12 ++++++------ gdb/regcache.c | 8 -------- gdb/regcache.h | 4 +--- gdb/s390-tdep.c | 10 ++++------ gdb/score-tdep.c | 4 ++-- gdb/spu-tdep.c | 6 +++--- gdb/tic6x-tdep.c | 3 +-- 11 files changed, 29 insertions(+), 39 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4e0b3a2213f..0f069263746 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-05-30 Simon Marchi + + * regcache.h (regcache_cooked_read_part): Remove, update callers + to use readable_regcache::cooked_read_part. + * regcache.c (regcache_cooked_read_part): Remove. + 2018-05-30 Simon Marchi * regcache.h (regcache_cooked_read_value): Remove, update diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 1f3581e5aa3..81e8a4cc6f8 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -1152,8 +1152,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function, if (part > 0) { if (readbuf != NULL) - regcache_cooked_read_part (regcache, reg, 4 - part, - part, readbuf); + regcache->cooked_read_part (reg, 4 - part, part, readbuf); if (writebuf != NULL) regcache_cooked_write_part (regcache, reg, 4 - part, part, writebuf); @@ -1243,8 +1242,8 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function, { while (len > 0) { - regcache_cooked_read_part (regcache, regnum, offset, - std::min (len, 8), readbuf); + regcache->cooked_read_part (regnum, offset, std::min (len, 8), + readbuf); readbuf += std::min (len, 8); len -= std::min (len, 8); regnum++; diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 727d24751bb..1f3f2bb96f6 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2113,9 +2113,8 @@ mep_extract_return_value (struct gdbarch *arch, offset = 0; /* Return values that do fit in a single register are returned in R0. */ - regcache_cooked_read_part (regcache, MEP_R0_REGNUM, - offset, TYPE_LENGTH (type), - valbuf); + regcache->cooked_read_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type), + valbuf); } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 64b8da764b3..fdf00f0ca72 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -510,8 +510,7 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, fprintf_unfiltered (gdb_stdlog, "%02x", out[buf_offset + i]); } if (in != NULL) - regcache_cooked_read_part (regcache, reg_num, reg_offset, length, - in + buf_offset); + regcache->cooked_read_part (reg_num, reg_offset, length, in + buf_offset); if (out != NULL) regcache_cooked_write_part (regcache, reg_num, reg_offset, length, out + buf_offset); diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c index 42dc63c9485..b7dfdca854b 100644 --- a/gdb/ppc-sysv-tdep.c +++ b/gdb/ppc-sysv-tdep.c @@ -1805,8 +1805,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, regcache_cooked_write_part (regcache, regnum, offset, TYPE_LENGTH (valtype), writebuf); if (readbuf != NULL) - regcache_cooked_read_part (regcache, regnum, - offset, TYPE_LENGTH (valtype), readbuf); + regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype), + readbuf); return 1; } @@ -1881,8 +1881,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype, regcache_cooked_write_part (regcache, regnum, offset, TYPE_LENGTH (valtype), writebuf); if (readbuf != NULL) - regcache_cooked_read_part (regcache, regnum, - offset, TYPE_LENGTH (valtype), readbuf); + regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype), + readbuf); return 1; } @@ -1986,8 +1986,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function, regcache_cooked_write_part (regcache, regnum, offset, TYPE_LENGTH (valtype), writebuf); if (readbuf != NULL) - regcache_cooked_read_part (regcache, regnum, - offset, TYPE_LENGTH (valtype), readbuf); + regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype), + readbuf); return RETURN_VALUE_REGISTER_CONVENTION; } diff --git a/gdb/regcache.c b/gdb/regcache.c index ee27f9d3f09..d8fb36ef362 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -863,14 +863,6 @@ regcache::raw_write_part (int regnum, int offset, int len, write_part (regnum, offset, len, buf, true); } -enum register_status -regcache_cooked_read_part (struct regcache *regcache, int regnum, - int offset, int len, gdb_byte *buf) -{ - return regcache->cooked_read_part (regnum, offset, len, buf); -} - - enum register_status readable_regcache::cooked_read_part (int regnum, int offset, int len, gdb_byte *buf) diff --git a/gdb/regcache.h b/gdb/regcache.h index 34972079a14..f1a3b24d228 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -65,9 +65,6 @@ extern void regcache_cooked_write_unsigned (struct regcache *regcache, /* Partial transfer of a cooked register. These perform read, modify, write style operations. */ -enum register_status regcache_cooked_read_part (struct regcache *regcache, - int regnum, int offset, - int len, gdb_byte *buf); void regcache_cooked_write_part (struct regcache *regcache, int regnum, int offset, int len, const gdb_byte *buf); @@ -230,6 +227,7 @@ public: template> enum register_status cooked_read (int regnum, T *val); + /* Partial transfer of a cooked register. */ enum register_status cooked_read_part (int regnum, int offset, int len, gdb_byte *buf); diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index eaf15504d5c..a894b4ba27b 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -1983,8 +1983,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type, regcache_cooked_write_part (regcache, S390_F0_REGNUM, 0, length, in); else - regcache_cooked_read_part (regcache, S390_F0_REGNUM, - 0, length, out); + regcache->cooked_read_part (S390_F0_REGNUM, 0, length, out); } else if (code == TYPE_CODE_ARRAY) { @@ -1993,15 +1992,14 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type, regcache_cooked_write_part (regcache, S390_V24_REGNUM, 0, length, in); else - regcache_cooked_read_part (regcache, S390_V24_REGNUM, - 0, length, out); + regcache->cooked_read_part (S390_V24_REGNUM, 0, length, out); } else if (length <= word_size) { /* Integer: zero- or sign-extended in r2. */ if (out != NULL) - regcache_cooked_read_part (regcache, S390_R2_REGNUM, - word_size - length, length, out); + regcache->cooked_read_part (S390_R2_REGNUM, word_size - length, length, + out); else if (TYPE_UNSIGNED (type)) regcache_cooked_write_unsigned (regcache, S390_R2_REGNUM, diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index a1679323273..aa50126916a 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -442,8 +442,8 @@ score_xfer_register (struct regcache *regcache, int regnum, int length, } if (readbuf != NULL) - regcache_cooked_read_part (regcache, regnum, reg_offset, length, - readbuf + buf_offset); + regcache->cooked_read_part (regnum, reg_offset, length, + readbuf + buf_offset); if (writebuf != NULL) regcache_cooked_write_part (regcache, regnum, reg_offset, length, writebuf + buf_offset); diff --git a/gdb/spu-tdep.c b/gdb/spu-tdep.c index d8a210726b9..583cb62987f 100644 --- a/gdb/spu-tdep.c +++ b/gdb/spu-tdep.c @@ -1381,7 +1381,7 @@ spu_regcache_to_value (struct regcache *regcache, int regnum, if (spu_scalar_value_p (type)) { int preferred_slot = len < 4 ? 4 - len : 0; - regcache_cooked_read_part (regcache, regnum, preferred_slot, len, out); + regcache->cooked_read_part (regnum, preferred_slot, len, out); } else { @@ -1393,7 +1393,7 @@ spu_regcache_to_value (struct regcache *regcache, int regnum, } if (len > 0) - regcache_cooked_read_part (regcache, regnum, 0, len, out); + regcache->cooked_read_part (regnum, 0, len, out); } } @@ -1556,7 +1556,7 @@ spu_return_value (struct gdbarch *gdbarch, struct value *function, { case RETURN_VALUE_REGISTER_CONVENTION: if (opencl_vector && TYPE_LENGTH (type) == 2) - regcache_cooked_read_part (regcache, SPU_ARG1_REGNUM, 2, 2, out); + regcache->cooked_read_part (SPU_ARG1_REGNUM, 2, 2, out); else spu_regcache_to_value (regcache, SPU_ARG1_REGNUM, type, out); break; diff --git a/gdb/tic6x-tdep.c b/gdb/tic6x-tdep.c index 842fe3f5bbb..274b02fa52a 100644 --- a/gdb/tic6x-tdep.c +++ b/gdb/tic6x-tdep.c @@ -722,8 +722,7 @@ tic6x_extract_return_value (struct type *valtype, struct regcache *regcache, register and the second byte occupies byte 0. so, we read the contents in VAL from the LSBs of register. */ if (len < 3 && byte_order == BFD_ENDIAN_BIG) - regcache_cooked_read_part (regcache, TIC6X_A4_REGNUM, 4 - len, len, - valbuf); + regcache->cooked_read_part (TIC6X_A4_REGNUM, 4 - len, len, valbuf); else regcache->cooked_read (TIC6X_A4_REGNUM, valbuf); } -- 2.30.2