Remove regcache_cooked_write_part
authorSimon Marchi <simon.marchi@ericsson.com>
Wed, 30 May 2018 18:54:44 +0000 (14:54 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Wed, 30 May 2018 18:54:44 +0000 (14:54 -0400)
Remove regcache_cooked_write_part, update callers to use
regcache::cooked_write_part.

gdb/ChangeLog:

* regcache.h (regcache_cooked_write_part): Remove, update
callers to use regcache::cooked_write_part.
* regcache.c (regcache_cooked_write_part): Remove.

12 files changed:
gdb/ChangeLog
gdb/hppa-tdep.c
gdb/m32c-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 0f0692637465799813c0e2cdeea6e9f7c4e41ebf..b0fb0c6f64fa0e479be9100aeaaf751442d233ca 100644 (file)
@@ -1,3 +1,9 @@
+2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * regcache.h (regcache_cooked_write_part): Remove, update
+       callers to use regcache::cooked_write_part.
+       * regcache.c (regcache_cooked_write_part): Remove.
+
 2018-05-30  Simon Marchi  <simon.marchi@ericsson.com>
 
        * regcache.h (regcache_cooked_read_part): Remove, update callers
index 81e8a4cc6f805899d62c263d81c0fb4cba17c4a5..1ea367042792aa7db4f1e8c8a6a06602db735bad 100644 (file)
@@ -1044,8 +1044,8 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                     passed in floating-point registers, are passed in
                     the right halves of the floating point registers;
                     the left halves are unused."  */
-                 regcache_cooked_write_part (regcache, regnum, offset % 8,
-                                             len, value_contents (arg));
+                 regcache->cooked_write_part (regnum, offset % 8, len,
+                                              value_contents (arg));
                }
            }
        }
@@ -1086,8 +1086,8 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
       regnum = HPPA_ARG0_REGNUM - offset / 8;
       while (regnum > HPPA_ARG0_REGNUM - 8 && len > 0)
        {
-         regcache_cooked_write_part (regcache, regnum,
-                                     offset % 8, std::min (len, 8), valbuf);
+         regcache->cooked_write_part (regnum, offset % 8, std::min (len, 8),
+                                      valbuf);
          offset += std::min (len, 8);
          valbuf += std::min (len, 8);
          len -= std::min (len, 8);
@@ -1154,8 +1154,7 @@ hppa32_return_value (struct gdbarch *gdbarch, struct value *function,
          if (readbuf != NULL)
            regcache->cooked_read_part (reg, 4 - part, part, readbuf);
          if (writebuf != NULL)
-           regcache_cooked_write_part (regcache, reg, 4 - part,
-                                       part, writebuf);
+           regcache->cooked_write_part (reg, 4 - part, part, writebuf);
          reg++;
        }
       /* Now transfer the remaining register values.  */
@@ -1254,8 +1253,8 @@ hppa64_return_value (struct gdbarch *gdbarch, struct value *function,
     {
       while (len > 0)
        {
-         regcache_cooked_write_part (regcache, regnum, offset,
-                                     std::min (len, 8), writebuf);
+         regcache->cooked_write_part (regnum, offset, std::min (len, 8),
+                                      writebuf);
          writebuf += std::min (len, 8);
          len -= std::min (len, 8);
          regnum++;
index b7cba1c37708a9005fbe87274c19f6721438f9ab..f696568e3a76c42f1d9e0b8997c1df70238e6e72 100644 (file)
@@ -463,7 +463,7 @@ m32c_part_write (struct m32c_reg *reg, struct regcache *cache,
   int offset, len;
 
   m32c_find_part (reg, &offset, &len);
-  regcache_cooked_write_part (cache, reg->rx->num, offset, len, buf);
+  cache->cooked_write_part (reg->rx->num, offset, len, buf);
 
   return REG_VALID;
 }
index 1f3f2bb96f63f73f7b166a86fd26cfef77b15248..c8a5ecfbe07c678b2db4d8a2ec45a9f6183ad8d2 100644 (file)
@@ -2139,9 +2139,8 @@ mep_store_return_value (struct gdbarch *arch,
       else
         offset = 0;
 
-      regcache_cooked_write_part (regcache, MEP_R0_REGNUM,
-                                  offset, TYPE_LENGTH (type),
-                                  valbuf);
+      regcache->cooked_write_part (MEP_R0_REGNUM, offset, TYPE_LENGTH (type),
+                                  valbuf);
     }
 
   /* Return values larger than a single register are returned in
index fdf00f0ca72b025c591a48aced794fef5e40e0b1..32b2d4062c7e7207209e1072d83628fd0fd8defc 100644 (file)
@@ -512,8 +512,7 @@ mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache,
   if (in != NULL)
     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);
+    regcache->cooked_write_part (reg_num, reg_offset, length, out + buf_offset);
   if (mips_debug && in != NULL)
     {
       int i;
index b7dfdca854bb7bed1111561cf37884674f80786d..0bac225112b78fc65cfb5f693714b1b9a3aedb28 100644 (file)
@@ -1286,9 +1286,8 @@ ppc64_sysv_abi_push_val (struct gdbarch *gdbarch,
   if (len > 0)
     {
       if (argpos->regcache && argpos->greg <= 10)
-       regcache_cooked_write_part (argpos->regcache,
-                                   tdep->ppc_gp0_regnum + argpos->greg,
-                                   offset, len, val);
+       argpos->regcache->cooked_write_part
+         (tdep->ppc_gp0_regnum + argpos->greg, offset, len, val);
       argpos->greg++;
     }
 }
@@ -1352,8 +1351,8 @@ ppc64_sysv_abi_push_freg (struct gdbarch *gdbarch,
          if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
            offset = 8 - TYPE_LENGTH (type);
 
-         regcache_cooked_write_part (argpos->regcache, regnum,
-                                     offset, TYPE_LENGTH (type), val);
+         argpos->regcache->cooked_write_part (regnum, offset,
+                                              TYPE_LENGTH (type), val);
        }
 
       argpos->freg++;
@@ -1802,8 +1801,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
        offset = 8 - TYPE_LENGTH (valtype);
 
       if (writebuf != NULL)
-       regcache_cooked_write_part (regcache, regnum,
-                                   offset, TYPE_LENGTH (valtype), writebuf);
+       regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype),
+                                    writebuf);
       if (readbuf != NULL)
        regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
                                    readbuf);
@@ -1878,8 +1877,8 @@ ppc64_sysv_abi_return_value_base (struct gdbarch *gdbarch, struct type *valtype,
        offset = 8 - TYPE_LENGTH (valtype);
 
       if (writebuf != NULL)
-       regcache_cooked_write_part (regcache, regnum,
-                                   offset, TYPE_LENGTH (valtype), writebuf);
+       regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype),
+                                    writebuf);
       if (readbuf != NULL)
        regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
                                    readbuf);
@@ -1983,8 +1982,8 @@ ppc64_sysv_abi_return_value (struct gdbarch *gdbarch, struct value *function,
       int offset = (register_size (gdbarch, regnum) - TYPE_LENGTH (valtype));
 
       if (writebuf != NULL)
-       regcache_cooked_write_part (regcache, regnum,
-                                   offset, TYPE_LENGTH (valtype), writebuf);
+       regcache->cooked_write_part (regnum, offset, TYPE_LENGTH (valtype),
+                                    writebuf);
       if (readbuf != NULL)
        regcache->cooked_read_part (regnum, offset, TYPE_LENGTH (valtype),
                                    readbuf);
index d8fb36ef362db19188450e27f6ec9adf6efa2025..758f21c08989ccc51d239656458f6a583a30a7f1 100644 (file)
@@ -871,13 +871,6 @@ readable_regcache::cooked_read_part (int regnum, int offset, int len,
   return read_part (regnum, offset, len, buf, false);
 }
 
-void
-regcache_cooked_write_part (struct regcache *regcache, int regnum,
-                           int offset, int len, const gdb_byte *buf)
-{
-  regcache->cooked_write_part (regnum, offset, len, buf);
-}
-
 void
 regcache::cooked_write_part (int regnum, int offset, int len,
                             const gdb_byte *buf)
index f1a3b24d2285eda9b247461e0c00971b49a7983c..064930c6394e6a1be4457e56563d90f2b319a0a1 100644 (file)
@@ -62,12 +62,6 @@ extern void regcache_cooked_write_signed (struct regcache *regcache,
 extern void regcache_cooked_write_unsigned (struct regcache *regcache,
                                            int regnum, ULONGEST val);
 
-/* Partial transfer of a cooked register.  These perform read, modify,
-   write style operations.  */
-
-void regcache_cooked_write_part (struct regcache *regcache, int regnum,
-                                int offset, int len, const gdb_byte *buf);
-
 /* Special routines to read/write the PC.  */
 
 /* For regcache_read_pc see common/common-regcache.h.  */
@@ -315,6 +309,8 @@ public:
      operations.  */
   void raw_write_part (int regnum, int offset, int len, const gdb_byte *buf);
 
+  /* Partial transfer of a cooked register.  Perform read, modify, write style
+     operations.  */
   void cooked_write_part (int regnum, int offset, int len,
                          const gdb_byte *buf);
 
index a894b4ba27b2a5ff7b8756eb7221df1fdfb01304..a3a3cb6c6c89a03fef8d68a3773a9555559d0830 100644 (file)
@@ -1723,10 +1723,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
          /* When we store a single-precision value in an FP register,
             it occupies the leftmost bits.  */
          if (write_mode)
-           regcache_cooked_write_part (as->regcache,
-                                       S390_F0_REGNUM + as->fr,
-                                       0, length,
-                                       value_contents (arg));
+           as->regcache->cooked_write_part (S390_F0_REGNUM + as->fr, 0, length,
+                                            value_contents (arg));
          as->fr += 2;
        }
       else
@@ -1749,9 +1747,8 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
          int regnum = S390_V24_REGNUM + use_vr[as->vr] - 24;
 
          if (write_mode)
-           regcache_cooked_write_part (as->regcache, regnum,
-                                       0, length,
-                                       value_contents (arg));
+           as->regcache->cooked_write_part (regnum, 0, length,
+                                            value_contents (arg));
          as->vr++;
        }
       else
@@ -1980,8 +1977,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
     {
       /* Float-like value: left-aligned in f0.  */
       if (in != NULL)
-       regcache_cooked_write_part (regcache, S390_F0_REGNUM,
-                                   0, length, in);
+       regcache->cooked_write_part (S390_F0_REGNUM, 0, length, in);
       else
        regcache->cooked_read_part (S390_F0_REGNUM, 0, length, out);
     }
@@ -1989,8 +1985,7 @@ s390_register_return_value (struct gdbarch *gdbarch, struct type *type,
     {
       /* Vector: left-aligned in v24.  */
       if (in != NULL)
-       regcache_cooked_write_part (regcache, S390_V24_REGNUM,
-                                   0, length, in);
+       regcache->cooked_write_part (S390_V24_REGNUM, 0, length, in);
       else
        regcache->cooked_read_part (S390_V24_REGNUM, 0, length, out);
     }
index aa50126916af4f1dac3fbf24ab54ff6322fee5aa..e764c659f0d30eef5fabbe3b4b5d38a5f5693286 100644 (file)
@@ -445,8 +445,8 @@ score_xfer_register (struct regcache *regcache, int regnum, int length,
     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);
+    regcache->cooked_write_part (regnum, reg_offset, length,
+                                writebuf + buf_offset);
 }
 
 static enum return_value_convention
index 583cb62987f75e085beb4669ee589fb8edc1599f..80458ab38e0f76cc902608cfdcd25868cf90146f 100644 (file)
@@ -1356,7 +1356,7 @@ spu_value_to_regcache (struct regcache *regcache, int regnum,
   if (spu_scalar_value_p (type))
     {
       int preferred_slot = len < 4 ? 4 - len : 0;
-      regcache_cooked_write_part (regcache, regnum, preferred_slot, len, in);
+      regcache->cooked_write_part (regnum, preferred_slot, len, in);
     }
   else
     {
@@ -1368,7 +1368,7 @@ spu_value_to_regcache (struct regcache *regcache, int regnum,
        }
 
       if (len > 0)
-       regcache_cooked_write_part (regcache, regnum, 0, len, in);
+       regcache->cooked_write_part (regnum, 0, len, in);
     }
 }
 
@@ -1540,7 +1540,7 @@ spu_return_value (struct gdbarch *gdbarch, struct value *function,
        {
        case RETURN_VALUE_REGISTER_CONVENTION:
          if (opencl_vector && TYPE_LENGTH (type) == 2)
-           regcache_cooked_write_part (regcache, SPU_ARG1_REGNUM, 2, 2, in);
+           regcache->cooked_write_part (SPU_ARG1_REGNUM, 2, 2, in);
          else
            spu_value_to_regcache (regcache, SPU_ARG1_REGNUM, type, in);
          break;
index 274b02fa52a58006ba295be82718cde4ca779509..efb8b0561b4c2250c68630f3a5bf8e2cb12f8614 100644 (file)
@@ -760,8 +760,7 @@ tic6x_store_return_value (struct type *valtype, struct regcache *regcache,
   if (len <= 4)
     {
       if (len < 3 && byte_order == BFD_ENDIAN_BIG)
-       regcache_cooked_write_part (regcache, TIC6X_A4_REGNUM, 4 - len, len,
-                                   valbuf);
+       regcache->cooked_write_part (TIC6X_A4_REGNUM, 4 - len, len, valbuf);
       else
        regcache->cooked_write (TIC6X_A4_REGNUM, valbuf);
     }
@@ -957,8 +956,8 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                     so, we write the contents in VAL to the lsp of
                     register.  */
                  if (len < 3 && byte_order == BFD_ENDIAN_BIG)
-                   regcache_cooked_write_part (regcache, arg_regs[argreg],
-                                               4 - len, len, val);
+                   regcache->cooked_write_part (arg_regs[argreg], 4 - len, len,
+                                                val);
                  else
                    regcache->cooked_write (arg_regs[argreg], val);
                }
@@ -988,16 +987,14 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
                      if (byte_order == BFD_ENDIAN_BIG)
                        {
                          regcache->cooked_write (arg_regs[argreg] + 1, val);
-                         regcache_cooked_write_part (regcache,
-                                                     arg_regs[argreg], 0,
-                                                     len - 4, val + 4);
+                         regcache->cooked_write_part (arg_regs[argreg], 0,
+                                                      len - 4, val + 4);
                        }
                      else
                        {
                          regcache->cooked_write (arg_regs[argreg], val);
-                         regcache_cooked_write_part (regcache,
-                                                     arg_regs[argreg] + 1, 0,
-                                                     len - 4, val + 4);
+                         regcache->cooked_write_part (arg_regs[argreg] + 1, 0,
+                                                      len - 4, val + 4);
                        }
                    }
                  else