Remove regcache_cooked_read_part
authorSimon Marchi <simon.marchi@ericsson.com>
Wed, 30 May 2018 18:54:43 +0000 (14:54 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 30 May 2018 18:54:43 +0000 (14:54 -0400)
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
gdb/hppa-tdep.c
gdb/mep-tdep.c
gdb/mips-tdep.c
gdb/ppc-sysv-tdep.c
gdb/regcache.c
gdb/regcache.h
gdb/s390-tdep.c
gdb/score-tdep.c
gdb/spu-tdep.c
gdb/tic6x-tdep.c

index 4e0b3a2213fbdeef17540ae873919b994bc12fde..0f0692637465799813c0e2cdeea6e9f7c4e41ebf 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * 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  <simon.marchi@ericsson.com>
 
        * regcache.h (regcache_cooked_read_value): Remove, update
index 1f3581e5aa3fd1a75002f96abc45fb03af1007f2..81e8a4cc6f805899d62c263d81c0fb4cba17c4a5 100644 (file)
@@ -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++;
index 727d24751bbd51e8241d1a467afbdad82867ea91..1f3f2bb96f63f73f7b166a86fd26cfef77b15248 100644 (file)
@@ -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);
 }
 
 
index 64b8da764b37b79ea0ab880bf1d07221ad82f848..fdf00f0ca72b025c591a48aced794fef5e40e0b1 100644 (file)
@@ -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);
index 42dc63c94858c145d869b22d76ed13e3408f63f7..b7dfdca854bb7bed1111561cf37884674f80786d 100644 (file)
@@ -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;
     }
 
index ee27f9d3f0996015adb7d54b58a1fdec25b60e78..d8fb36ef362db19188450e27f6ec9adf6efa2025 100644 (file)
@@ -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)
index 34972079a141f340d9561f5998ff4cd26d798158..f1a3b24d2285eda9b247461e0c00971b49a7983c 100644 (file)
@@ -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<typename T, typename = RequireLongest<T>>
   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);
 
index eaf15504d5cd9b38233e88d6d5633572249bf71b..a894b4ba27b2a5ff7b8756eb7221df1fdfb01304 100644 (file)
@@ -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,
index a16793232734684955b8a029f710173e2818655d..aa50126916af4f1dac3fbf24ab54ff6322fee5aa 100644 (file)
@@ -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);
index d8a210726b984ef7afbbccc0d15b03e707ebe2dd..583cb62987f75e085beb4669ee589fb8edc1599f 100644 (file)
@@ -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;
index 842fe3f5bbbec2f4b9a563a0042c2b5b6634cda1..274b02fa52a58006ba295be82718cde4ca779509 100644 (file)
@@ -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);
     }