]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Turn some value_contents functions into methods
authorTom Tromey <tom@tromey.com>
Tue, 31 Jan 2023 20:45:40 +0000 (13:45 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 13 Feb 2023 22:21:08 +0000 (15:21 -0700)
This turns value_contents_raw, value_contents_writeable, and
value_contents_all_raw into methods on value.  The remaining functions
will be changed later in the series; they were a bit trickier and so I
didn't include them in this patch.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
32 files changed:
gdb/aarch64-linux-tdep.c
gdb/aarch64-tdep.c
gdb/ada-lang.c
gdb/amd64-tdep.c
gdb/amd64-windows-tdep.c
gdb/arch-utils.c
gdb/arm-tdep.c
gdb/c-lang.c
gdb/cp-valprint.c
gdb/dummy-frame.c
gdb/dwarf2/expr.c
gdb/dwarf2/loc.c
gdb/dwarf2/read.c
gdb/eval.c
gdb/findvar.c
gdb/frame-unwind.c
gdb/frame.c
gdb/i386-tdep.c
gdb/infrun.c
gdb/opencl-lang.c
gdb/ppc-linux-tdep.c
gdb/regcache.c
gdb/riscv-tdep.c
gdb/sparc-tdep.c
gdb/std-regs.c
gdb/tracepoint.c
gdb/valarith.c
gdb/valops.c
gdb/valprint.c
gdb/value.c
gdb/value.h
gdb/windows-tdep.c

index 20a041c599ea2da8e5cf6b45978f9f24dbaed9e1..9d6ed358597ca00a6a2d44db94d0cc2e1b1701b5 100644 (file)
@@ -1668,7 +1668,7 @@ aarch64_linux_set_memtags (struct gdbarch *gdbarch, struct value *address,
 
       /* Update the value's content with the tag.  */
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
-      gdb_byte *srcbuf = value_contents_raw (address).data ();
+      gdb_byte *srcbuf = address->contents_raw ().data ();
       store_unsigned_integer (srcbuf, sizeof (addr), byte_order, addr);
     }
   else
index 76c92fd99bde251b5251e344396380972713426e..1a6fdbebc7622c2bf8f298352ed2e85ac4bd715c 100644 (file)
@@ -2494,7 +2494,7 @@ aarch64_return_value (struct gdbarch *gdbarch, struct value *func_value,
     {
       *read_value = value::allocate (valtype);
       aarch64_extract_return_value (valtype, regcache,
-                                   value_contents_raw (*read_value).data ());
+                                   (*read_value)->contents_raw ().data ());
     }
 
   aarch64_debug_printf ("return value in registers");
@@ -2769,7 +2769,7 @@ aarch64_pseudo_read_value_1 (struct gdbarch *gdbarch,
     mark_value_bytes_unavailable (result_value, 0,
                                  result_value->type ()->length ());
   else
-    memcpy (value_contents_raw (result_value).data (), reg_buf, regsize);
+    memcpy (result_value->contents_raw ().data (), reg_buf, regsize);
 
   return result_value;
  }
@@ -2803,7 +2803,7 @@ aarch64_pseudo_read_value (struct gdbarch *gdbarch, readable_regcache *regcache,
       if (regcache->raw_read_part (x_regnum, offset, 4, data) != REG_VALID)
        mark_value_bytes_unavailable (result_value, 0, 4);
       else
-       memcpy (value_contents_raw (result_value).data (), data, 4);
+       memcpy (result_value->contents_raw ().data (), data, 4);
 
       return result_value;
     }
index 53265ca1a9cbac9c1d3b9c90323c22e201bbe5c4..274b5e3ce03705b2956892ff6d1ceb1340a46e41 100644 (file)
@@ -2846,7 +2846,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
     }
   else
     v->set_bitsize (bit_size);
-  unpacked = value_contents_writeable (v).data ();
+  unpacked = v->contents_writeable ().data ();
 
   if (bit_size == 0)
     {
@@ -2921,7 +2921,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
       write_memory_with_notification (to_addr, buffer, len);
 
       val = value_copy (toval);
-      memcpy (value_contents_raw (val).data (),
+      memcpy (val->contents_raw ().data (),
              value_contents (fromval).data (),
              type->length ());
       val->deprecated_set_type (type);
@@ -2970,13 +2970,13 @@ value_assign_to_component (struct value *container, struct value *component,
          = component->type ()->length () * TARGET_CHAR_BIT - bits;
       else
        src_offset = 0;
-      copy_bitwise ((value_contents_writeable (container).data ()
+      copy_bitwise ((container->contents_writeable ().data ()
                     + offset_in_container),
                    container->bitpos () + bit_offset_in_container,
                    value_contents (val).data (), src_offset, bits, 1);
     }
   else
-    copy_bitwise ((value_contents_writeable (container).data ()
+    copy_bitwise ((container->contents_writeable ().data ()
                   + offset_in_container),
                  container->bitpos () + bit_offset_in_container,
                  value_contents (val).data (), 0, bits, 0);
@@ -4529,7 +4529,7 @@ ada_convert_actual (struct value *actual, struct type *formal_type0)
 
              actual_type = ada_check_typedef (actual->type ());
              val = value::allocate (actual_type);
-             copy (value_contents (actual), value_contents_raw (val));
+             copy (value_contents (actual), val->contents_raw ());
              actual = ensure_lval (val);
            }
          result = value_addr (actual);
@@ -4592,12 +4592,12 @@ make_array_descriptor (struct type *type, struct value *arr)
        i > 0; i -= 1)
     {
       modify_field (bounds->type (),
-                   value_contents_writeable (bounds).data (),
+                   bounds->contents_writeable ().data (),
                    ada_array_bound (arr, i, 0),
                    desc_bound_bitpos (bounds_type, i, 0),
                    desc_bound_bitsize (bounds_type, i, 0));
       modify_field (bounds->type (),
-                   value_contents_writeable (bounds).data (),
+                   bounds->contents_writeable ().data (),
                    ada_array_bound (arr, i, 1),
                    desc_bound_bitpos (bounds_type, i, 1),
                    desc_bound_bitsize (bounds_type, i, 1));
@@ -4606,14 +4606,14 @@ make_array_descriptor (struct type *type, struct value *arr)
   bounds = ensure_lval (bounds);
 
   modify_field (descriptor->type (),
-               value_contents_writeable (descriptor).data (),
+               descriptor->contents_writeable ().data (),
                value_pointer (ensure_lval (arr),
                               desc_type->field (0).type ()),
                fat_pntr_data_bitpos (desc_type),
                fat_pntr_data_bitsize (desc_type));
 
   modify_field (descriptor->type (),
-               value_contents_writeable (descriptor).data (),
+               descriptor->contents_writeable ().data (),
                value_pointer (bounds,
                               desc_type->field (1).type ()),
                fat_pntr_bounds_bitpos (desc_type),
@@ -9282,7 +9282,7 @@ ada_promote_array_of_integrals (struct type *type, struct value *val)
     error (_("unable to determine array bounds"));
 
   value *res = value::allocate (type);
-  gdb::array_view<gdb_byte> res_contents = value_contents_writeable (res);
+  gdb::array_view<gdb_byte> res_contents = res->contents_writeable ();
 
   /* Promote each array element.  */
   for (i = 0; i < hi - lo + 1; i++)
@@ -9404,7 +9404,7 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
     }
 
   val = value::allocate (type1);
-  store_unsigned_integer (value_contents_raw (val).data (),
+  store_unsigned_integer (val->contents_raw ().data (),
                          val->type ()->length (),
                          type_byte_order (type1), v);
   return val;
@@ -10668,7 +10668,7 @@ ada_string_operation::evaluate (struct type *expect_type,
        struct type *stringtype
          = lookup_array_range_type (char_type, 1, str.length ());
        struct value *val = value::allocate (stringtype);
-       memcpy (value_contents_raw (val).data (), str.c_str (),
+       memcpy (val->contents_raw ().data (), str.c_str (),
                str.length ());
        return val;
       }
@@ -10703,7 +10703,7 @@ ada_string_operation::evaluate (struct type *expect_type,
                               obstack_object_size (&converted)
                               / char_type->length ());
   struct value *val = value::allocate (stringtype);
-  memcpy (value_contents_raw (val).data (),
+  memcpy (val->contents_raw ().data (),
          obstack_base (&converted),
          obstack_object_size (&converted));
   return val;
index 03e9ac951c8b20fdbb109e40edd6ebab8e2d85cb..085e5327a7538d2b20c243c8273d3876ac198971 100644 (file)
@@ -358,7 +358,7 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch,
   value *result_value = value::allocate (register_type (gdbarch, regnum));
   VALUE_LVAL (result_value) = lval_register;
   VALUE_REGNUM (result_value) = regnum;
-  gdb_byte *buf = value_contents_raw (result_value).data ();
+  gdb_byte *buf = result_value->contents_raw ().data ();
 
   if (i386_byte_regnum_p (gdbarch, regnum))
     {
@@ -832,7 +832,7 @@ amd64_return_value (struct gdbarch *gdbarch, struct value *function,
   if (read_value != nullptr)
     {
       *read_value = value::allocate (type);
-      readbuf = value_contents_raw (*read_value).data ();
+      readbuf = (*read_value)->contents_raw ().data ();
     }
 
   /* 8. If the class is COMPLEX_X87, the real part of the value is
index aea8aaa6200ef1e4794bb78b353f6c32ce03782b..7a7fbbb9859dbfed849e0b16e1303f3465c4e38b 100644 (file)
@@ -410,7 +410,7 @@ amd64_windows_return_value (struct gdbarch *gdbarch, struct value *function,
        {
          *read_value = value::allocate (type);
          regcache->raw_read_part (regnum, 0, len,
-                                  value_contents_raw (*read_value).data ());
+                                  (*read_value)->contents_raw ().data ());
        }
       if (writebuf)
        regcache->raw_write_part (regnum, 0, len, writebuf);
index 49c699fd1243f4d69b1108964671585bc2519f33..e3af9ce2dbce806490be7016dd0f92aa074b765e 100644 (file)
@@ -1179,7 +1179,7 @@ default_gdbarch_return_value
   if (read_value != nullptr)
     {
       *read_value = value::allocate (valtype);
-      readbuf = value_contents_raw (*read_value).data ();
+      readbuf = (*read_value)->contents_raw ().data ();
     }
 
   return gdbarch->return_value (gdbarch, function, valtype, regcache,
index c4b92ea17d99cca55d1e2669de8615d81ef75885..bf38880c24795182b6d7a1a3420ac5c5c35b95d6 100644 (file)
@@ -9193,7 +9193,7 @@ arm_return_value (struct gdbarch *gdbarch, struct value *function,
       if (read_value != nullptr)
        {
          *read_value = value::allocate (valtype);
-         readbuf = value_contents_raw (*read_value).data ();
+         readbuf = (*read_value)->contents_raw ().data ();
        }
 
       for (i = 0; i < vfp_base_count; i++)
@@ -9269,7 +9269,7 @@ arm_return_value (struct gdbarch *gdbarch, struct value *function,
   if (read_value != nullptr)
     {
       *read_value = value::allocate (valtype);
-      gdb_byte *readbuf = value_contents_raw (*read_value).data ();
+      gdb_byte *readbuf = (*read_value)->contents_raw ().data ();
       arm_extract_return_value (valtype, regcache, readbuf);
     }
 
index 255901887d6be72bd61495de9b786d2ac8387e31..ec2e06027d28d9862ca4b957aaf5c1f695010569 100644 (file)
@@ -674,7 +674,7 @@ c_string_operation::evaluate (struct type *expect_type,
            error (_("Too many array elements"));
 
          result = value::allocate (expect_type);
-         memcpy (value_contents_raw (result).data (), obstack_base (&output),
+         memcpy (result->contents_raw ().data (), obstack_base (&output),
                  obstack_object_size (&output));
        }
       else
index 268a414a37bd2c9e8ff7632a674a462120481e78..dd3968257980eed68bad0f53d8a1aabcf83ad4e4 100644 (file)
@@ -762,7 +762,7 @@ test_print_fields (gdbarch *arch)
     }
 
   value *val = value::allocate (the_struct);
-  gdb_byte *contents = value_contents_writeable (val).data ();
+  gdb_byte *contents = val->contents_writeable ().data ();
   store_unsigned_integer (contents, val->enclosing_type ()->length (),
                          gdbarch_byte_order (arch), 0xe9);
 
index 6c3dfb1b24d234fef8ea7c8f9accdea339d547e7..961b3ac7a25f2e7c682e1c2944f8171e7ddb6ea6 100644 (file)
@@ -354,7 +354,7 @@ dummy_frame_prev_register (frame_info_ptr this_frame,
      constructs either a raw or pseudo register from the raw
      register cache.  */
   cache->prev_regcache->cooked_read
-    (regnum, value_contents_writeable (reg_val).data ());
+    (regnum, reg_val->contents_writeable ().data ());
   return reg_val;
 }
 
index bb77a9697847487087a3af9452ed0a0b4c8685a4..e08dca01a67aaf65791a7f1308762f31f7b1cc43 100644 (file)
@@ -164,7 +164,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
       if (check_optimized)
        v_contents = nullptr;
       else
-       v_contents = value_contents_raw (v).data ();
+       v_contents = v->contents_raw ().data ();
       from_contents = nullptr;
     }
 
@@ -1026,7 +1026,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
              subobj_offset += n - max;
 
            copy (value_contents_all (val).slice (subobj_offset, len),
-                 value_contents_raw (retval));
+                 retval->contents_raw ());
          }
          break;
 
@@ -1038,7 +1038,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
              invalid_synthetic_pointer ();
 
            retval = value::allocate (subobj_type);
-           bfd_byte *contents = value_contents_raw (retval).data ();
+           bfd_byte *contents = retval->contents_raw ().data ();
            memcpy (contents, this->m_data + subobj_offset, n);
          }
          break;
index 96686d9a110de3f37bdf0bf62bac51b445961485..0aa6aafe823526362b7e3772107fafcf8b6427eb 100644 (file)
@@ -1363,8 +1363,8 @@ value_of_dwarf_reg_entry (struct type *type, frame_info_ptr frame,
                                 release_value (target_val).release ());
 
   /* Copy the referencing pointer to the new computed value.  */
-  memcpy (value_contents_raw (val).data (),
-         value_contents_raw (outer_val).data (),
+  memcpy (val->contents_raw ().data (),
+         outer_val->contents_raw ().data (),
          checked_type->length ());
   val->set_lazy (0);
 
index 754e6bedd4fa04001dd8734b195761e7c4cd25cb..470ff125c5b23223cf2aa7341c910417cf9bc2f3 100644 (file)
@@ -8992,7 +8992,7 @@ dwarf2_compute_name (const char *name,
                      else if (bytes != NULL)
                        {
                          v = value::allocate (type);
-                         memcpy (value_contents_writeable (v).data (), bytes,
+                         memcpy (v->contents_writeable ().data (), bytes,
                                  type->length ());
                        }
                      else
index 7dcad5b5d99e4e7f8bffad0462476ee25480ec3a..fbc72a5a34e1e1320ce5567484d8f89e14b03daf 100644 (file)
@@ -2413,7 +2413,7 @@ array_operation::evaluate_struct_tuple (struct value *struct_val,
 
       bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
       bitpos = struct_type->field (fieldno).loc_bitpos ();
-      addr = value_contents_writeable (struct_val).data () + bitpos / 8;
+      addr = struct_val->contents_writeable ().data () + bitpos / 8;
       if (bitsize)
        modify_field (struct_type, addr,
                      value_as_long (val), bitpos % 8, bitsize);
@@ -2442,7 +2442,7 @@ array_operation::evaluate (struct type *expect_type,
     {
       struct value *rec = value::allocate (expect_type);
 
-      memset (value_contents_raw (rec).data (), '\0', type->length ());
+      memset (rec->contents_raw ().data (), '\0', type->length ());
       return evaluate_struct_tuple (rec, exp, noside, nargs);
     }
 
@@ -2461,7 +2461,7 @@ array_operation::evaluate (struct type *expect_type,
          high_bound = (type->length () / element_size) - 1;
        }
       index = low_bound;
-      memset (value_contents_raw (array).data (), 0, expect_type->length ());
+      memset (array->contents_raw ().data (), 0, expect_type->length ());
       for (tem = nargs; --nargs >= 0;)
        {
          struct value *element;
@@ -2473,7 +2473,7 @@ array_operation::evaluate (struct type *expect_type,
          if (index > high_bound)
            /* To avoid memory corruption.  */
            error (_("Too many array elements"));
-         memcpy (value_contents_raw (array).data ()
+         memcpy (array->contents_raw ().data ()
                  + (index - low_bound) * element_size,
                  value_contents (element).data (),
                  element_size);
@@ -2486,7 +2486,7 @@ array_operation::evaluate (struct type *expect_type,
       && type->code () == TYPE_CODE_SET)
     {
       struct value *set = value::allocate (expect_type);
-      gdb_byte *valaddr = value_contents_raw (set).data ();
+      gdb_byte *valaddr = set->contents_raw ().data ();
       struct type *element_type = type->index_type ();
       struct type *check_type = element_type;
       LONGEST low_bound, high_bound;
index 048e439ac33b4e8f8b8d20f09f711fe42c13143c..a64b35c2bcfba65089c22fcb2b1344656e0fd074 100644 (file)
@@ -587,7 +587,7 @@ language_defn::read_var_value (struct symbol *var,
        }
       /* Put the constant back in target format. */
       v = value::allocate (type);
-      store_signed_integer (value_contents_raw (v).data (), type->length (),
+      store_signed_integer (v->contents_raw ().data (), type->length (),
                            type_byte_order (type), var->value_longest ());
       VALUE_LVAL (v) = not_lval;
       return v;
@@ -627,7 +627,7 @@ language_defn::read_var_value (struct symbol *var,
          type = resolve_dynamic_type (type, {}, /* Unused address.  */ 0);
        }
       v = value::allocate (type);
-      memcpy (value_contents_raw (v).data (), var->value_bytes (),
+      memcpy (v->contents_raw ().data (), var->value_bytes (),
              type->length ());
       VALUE_LVAL (v) = not_lval;
       return v;
@@ -900,7 +900,7 @@ value_from_register (struct type *type, int regnum, frame_info_ptr frame)
       VALUE_NEXT_FRAME_ID (v) = get_frame_id (get_next_frame_sentinel_okay (frame));
       VALUE_REGNUM (v) = regnum;
       ok = gdbarch_register_to_value (gdbarch, frame, regnum, type1,
-                                     value_contents_raw (v).data (), &optim,
+                                     v->contents_raw ().data (), &optim,
                                      &unavail);
 
       if (!ok)
index c884cdd17cd3eda538a580ea663500faee410959..e5f8dc639e3e620ed30c05e7007229fe883addeb 100644 (file)
@@ -305,7 +305,7 @@ frame_unwind_got_constant (frame_info_ptr frame, int regnum,
   struct value *reg_val;
 
   reg_val = value::zero (register_type (gdbarch, regnum), not_lval);
-  store_unsigned_integer (value_contents_writeable (reg_val).data (),
+  store_unsigned_integer (reg_val->contents_writeable ().data (),
                          register_size (gdbarch, regnum), byte_order, val);
   return reg_val;
 }
@@ -317,7 +317,7 @@ frame_unwind_got_bytes (frame_info_ptr frame, int regnum, const gdb_byte *buf)
   struct value *reg_val;
 
   reg_val = value::zero (register_type (gdbarch, regnum), not_lval);
-  memcpy (value_contents_raw (reg_val).data (), buf,
+  memcpy (reg_val->contents_raw ().data (), buf,
          register_size (gdbarch, regnum));
   return reg_val;
 }
@@ -334,7 +334,7 @@ frame_unwind_got_address (frame_info_ptr frame, int regnum,
   struct value *reg_val;
 
   reg_val = value::zero (register_type (gdbarch, regnum), not_lval);
-  pack_long (value_contents_writeable (reg_val).data (),
+  pack_long (reg_val->contents_writeable ().data (),
             register_type (gdbarch, regnum), addr);
   return reg_val;
 }
index a4c44822ef9fa20a5d25bc9fa1f4ca16218bd3c8..834adc318acfea7b802a34d6acbd98d3af63f03f 100644 (file)
@@ -1598,10 +1598,10 @@ put_frame_register_bytes (frame_info_ptr frame, int regnum,
                                           regnum);
          gdb_assert (value != NULL);
 
-         memcpy ((char *) value_contents_writeable (value).data () + offset,
+         memcpy ((char *) value->contents_writeable ().data () + offset,
                  myaddr, curr_len);
          put_frame_register (frame, regnum,
-                             value_contents_raw (value).data ());
+                             value->contents_raw ().data ());
          release_value (value);
        }
 
index 3462125feac5dbaa16c931d01c202016665c4d2a..94ec1cc3fee31399938abc14a4cfda713ff636eb 100644 (file)
@@ -3095,7 +3095,7 @@ i386_return_value (struct gdbarch *gdbarch, struct value *function,
     {
       *read_value = value::allocate (type);
       i386_extract_return_value (gdbarch, type, regcache,
-                                value_contents_raw (*read_value).data ());
+                                (*read_value)->contents_raw ().data ());
     }
   if (writebuf)
     i386_store_return_value (gdbarch, type, regcache, writebuf);
@@ -3379,7 +3379,7 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
 {
   gdb_byte raw_buf[I386_MAX_REGISTER_SIZE];
   enum register_status status;
-  gdb_byte *buf = value_contents_raw (result_value).data ();
+  gdb_byte *buf = result_value->contents_raw ().data ();
 
   if (i386_mmx_regnum_p (gdbarch, regnum))
     {
index c45c6b5c8021f4edd3f35418e14dd8b1e5fbb114..c5718580162086860bf23a9f2ad32d9f8d4ba71c 100644 (file)
@@ -9143,7 +9143,7 @@ siginfo_value_read (struct value *v)
     target_read (current_inferior ()->top_target (),
                 TARGET_OBJECT_SIGNAL_INFO,
                 nullptr,
-                value_contents_all_raw (v).data (),
+                v->contents_all_raw ().data (),
                 v->offset (),
                 v->type ()->length ());
 
@@ -9166,7 +9166,7 @@ siginfo_value_write (struct value *v, struct value *fromval)
   transferred = target_write (current_inferior ()->top_target (),
                              TARGET_OBJECT_SIGNAL_INFO,
                              nullptr,
-                             value_contents_all_raw (fromval).data (),
+                             fromval->contents_all_raw ().data (),
                              v->offset (),
                              fromval->type ()->length ());
 
index dc34dee2995e95f8faaed0f7d1e3afb962054b77..8bc727cdfdf59f621841b71c80f937e4c4d5fa6a 100644 (file)
@@ -139,7 +139,7 @@ lval_func_read (struct value *v)
   gdb_assert (n <= c->n);
 
   for (i = offset; i < n; i++)
-    memcpy (value_contents_raw (v).data () + j++ * elsize,
+    memcpy (v->contents_raw ().data () + j++ * elsize,
            value_contents (c->val).data () + c->indices[i] * elsize,
            elsize);
 }
@@ -180,7 +180,7 @@ lval_func_write (struct value *v, struct value *fromval)
       struct value *from_elm_val = value::allocate (eltype);
       struct value *to_elm_val = value_subscript (c->val, c->indices[i]);
 
-      memcpy (value_contents_writeable (from_elm_val).data (),
+      memcpy (from_elm_val->contents_writeable ().data (),
              value_contents (fromval).data () + j++ * elsize,
              elsize);
       value_assign (to_elm_val, from_elm_val);
@@ -314,7 +314,7 @@ create_value (struct gdbarch *gdbarch, struct value *val, enum noside noside,
 
              /* Copy src val contents into the destination value.  */
              for (i = 0; i < n; i++)
-               memcpy (value_contents_writeable (ret).data ()
+               memcpy (ret->contents_writeable ().data ()
                        + (i * elm_type->length ()),
                        value_contents (val).data ()
                        + (indices[i] * elm_type->length ()),
@@ -472,7 +472,7 @@ opencl_logical_not (struct type *expect_type, struct expression *exp,
          value of its operand compares unequal to 0, and -1 (i.e. all bits
          set) if the value of its operand compares equal to 0.  */
          int tmp = value_logical_not (value_subscript (arg, i)) ? -1 : 0;
-         memset ((value_contents_writeable (ret).data ()
+         memset ((ret->contents_writeable ().data ()
                   + i * eltype->length ()),
                  tmp, eltype->length ());
        }
@@ -573,7 +573,7 @@ vector_relop (struct expression *exp, struct value *val1, struct value *val2,
         if the specified relation is true.  */
       int tmp = scalar_relop (value_subscript (val1, i),
                              value_subscript (val2, i), op) ? -1 : 0;
-      memset ((value_contents_writeable (ret).data ()
+      memset ((ret->contents_writeable ().data ()
               + i * eltype1->length ()),
              tmp, eltype1->length ());
      }
@@ -837,7 +837,7 @@ Cannot perform conditional operation on vectors with different sizes"));
        {
          tmp = value_logical_not (value_subscript (arg1, i)) ?
            value_subscript (arg3, i) : value_subscript (arg2, i);
-         memcpy (value_contents_writeable (ret).data () +
+         memcpy (ret->contents_writeable ().data () +
                  i * eltype2->length (), value_contents_all (tmp).data (),
                  eltype2->length ());
        }
index 2084e2b618f29bd2da907075e9881a3e2ee8b8cd..fcddb2008a02fcbfcabe1428bbe1b592ca5f7cd4 100644 (file)
@@ -255,7 +255,7 @@ ppc_linux_return_value (struct gdbarch *gdbarch, struct value *function,
   if (read_value != nullptr)
     {
       *read_value = value::allocate (valtype);
-      readbuf = value_contents_raw (*read_value).data ();
+      readbuf = (*read_value)->contents_raw ().data ();
     }
 
   if ((valtype->code () == TYPE_CODE_STRUCT
index 4a31dd5e706dbf2826eea19e32414b829589878b..90989595acc7adb64b153d465b2134d0f66d7c02 100644 (file)
@@ -716,7 +716,7 @@ readable_regcache::cooked_read (int regnum, gdb_byte *buf)
       computed = gdbarch_pseudo_register_read_value (m_descr->gdbarch,
                                                     this, regnum);
       if (value_entirely_available (computed))
-       memcpy (buf, value_contents_raw (computed).data (),
+       memcpy (buf, computed->contents_raw ().data (),
                m_descr->sizeof_register[regnum]);
       else
        {
@@ -751,7 +751,7 @@ readable_regcache::cooked_read_value (int regnum)
         direction than in the other one, even though the value-based
         API is preferred.  */
       if (cooked_read (regnum,
-                      value_contents_raw (result).data ()) == REG_UNAVAILABLE)
+                      result->contents_raw ().data ()) == REG_UNAVAILABLE)
        mark_value_bytes_unavailable (result, 0,
                                      result->type ()->length ());
 
index 375ba4228a21d2abd8075a6c14575eeef4c884c4..f8be46c9fb6ef07db61e21cc8499607ce0ad6f9f 100644 (file)
@@ -3278,7 +3278,7 @@ riscv_return_value (struct gdbarch  *gdbarch,
                             type_byte_order (arg_type),
                             arg_type->is_unsigned ());
              abi_val = value::allocate (info.type);
-             unscaled.write (value_contents_raw (abi_val),
+             unscaled.write (abi_val->contents_raw (),
                              type_byte_order (info.type),
                              info.type->is_unsigned ());
            }
@@ -3287,12 +3287,12 @@ riscv_return_value (struct gdbarch  *gdbarch,
              arg_val = value_from_contents (arg_type, writebuf);
              abi_val = value_cast (info.type, arg_val);
            }
-         writebuf = value_contents_raw (abi_val).data ();
+         writebuf = abi_val->contents_raw ().data ();
        }
       else
        {
          abi_val = value::allocate (info.type);
-         readbuf = value_contents_raw (abi_val).data ();
+         readbuf = abi_val->contents_raw ().data ();
        }
       arg_len = info.type->length ();
 
@@ -3409,7 +3409,7 @@ riscv_return_value (struct gdbarch  *gdbarch,
                             type_byte_order (info.type),
                             info.type->is_unsigned ());
              *read_value = value::allocate (arg_type);
-             unscaled.write (value_contents_raw (*read_value),
+             unscaled.write ((*read_value)->contents_raw (),
                              type_byte_order (arg_type),
                              arg_type->is_unsigned ());
            }
index 44f16215bb238ba4eff831d84dcf6eeaee33eeef..5e582c7b77aca81761cd7fa632f97007fa5028b3 100644 (file)
@@ -1531,7 +1531,7 @@ sparc32_return_value (struct gdbarch *gdbarch, struct value *function,
   if (read_value != nullptr)
     {
       *read_value = value::allocate (type);
-      gdb_byte *readbuf = value_contents_raw (*read_value).data ();
+      gdb_byte *readbuf = (*read_value)->contents_raw ().data ();
       sparc32_extract_return_value (type, regcache, readbuf);
     }
   if (writebuf)
index 5520789ea95bbcda6e5772e33e7a21bddb516c11..54cf9018e42673861e0b2dd0061ce810e61a4d9f 100644 (file)
@@ -44,7 +44,7 @@ value_of_builtin_frame_fp_reg (frame_info_ptr frame, const void *baton)
     {
       struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
       struct value *val = value::allocate (data_ptr_type);
-      gdb_byte *buf = value_contents_raw (val).data ();
+      gdb_byte *buf = val->contents_raw ().data ();
 
       gdbarch_address_to_pointer (gdbarch, data_ptr_type,
                                  buf, get_frame_base_address (frame));
@@ -63,7 +63,7 @@ value_of_builtin_frame_pc_reg (frame_info_ptr frame, const void *baton)
     {
       struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
       struct value *val = value::allocate (func_ptr_type);
-      gdb_byte *buf = value_contents_raw (val).data ();
+      gdb_byte *buf = val->contents_raw ().data ();
 
       gdbarch_address_to_pointer (gdbarch, func_ptr_type,
                                  buf, get_frame_pc (frame));
index bd02cae05ee10b5bf487cccd46e0bb729d683509..1c1fea7d9704c973e496b0bff7c95f8fc5e57a33 100644 (file)
@@ -3778,7 +3778,7 @@ sdata_make_value (struct gdbarch *gdbarch, struct internalvar *var,
       type = init_vector_type (builtin_type (gdbarch)->builtin_true_char,
                               buf->size ());
       v = value::allocate (type);
-      memcpy (value_contents_raw (v).data (), buf->data (), buf->size ());
+      memcpy (v->contents_raw ().data (), buf->data (), buf->size ());
       return v;
     }
   else
index 715879dcc41602d11281961e61b97312df8a437e..cd3a9c8d699cf50da334143fae2aa76bb64e2145 100644 (file)
@@ -717,7 +717,7 @@ value_concat (struct value *arg1, struct value *arg2)
                                                lowbound + n_elts - 1);
 
   struct value *result = value::allocate (atype);
-  gdb::array_view<gdb_byte> contents = value_contents_raw (result);
+  gdb::array_view<gdb_byte> contents = result->contents_raw ();
   gdb::array_view<const gdb_byte> lhs_contents = value_contents (arg1);
   gdb::array_view<const gdb_byte> rhs_contents = value_contents (arg2);
   gdb::copy (lhs_contents, contents.slice (0, lhs_contents.size ()));
@@ -872,7 +872,7 @@ fixed_point_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
       value *fp_val = value::allocate (type1);
 
       fp.write_fixed_point
-       (value_contents_raw (fp_val),
+      (fp_val->contents_raw (),
         type_byte_order (type1),
         type1->is_unsigned (),
         type1->fixed_point_scaling_factor ());
@@ -1191,7 +1191,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
                                  v2.data (), &eff_type_v2);
       target_float_binop (op, v1.data (), eff_type_v1,
                              v2.data (), eff_type_v2,
-                             value_contents_raw (val).data (), result_type);
+                         val->contents_raw ().data (), result_type);
     }
   else if (type1->code () == TYPE_CODE_BOOL
           || type2->code () == TYPE_CODE_BOOL)
@@ -1230,7 +1230,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
       result_type = type1;
 
       val = value::allocate (result_type);
-      store_signed_integer (value_contents_raw (val).data (),
+      store_signed_integer (val->contents_raw ().data (),
                            result_type->length (),
                            type_byte_order (result_type),
                            v);
@@ -1376,7 +1376,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
            }
 
          val = value::allocate (result_type);
-         store_unsigned_integer (value_contents_raw (val).data (),
+         store_unsigned_integer (val->contents_raw ().data (),
                                  val->type ()->length (),
                                  type_byte_order (result_type),
                                  v);
@@ -1537,7 +1537,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
            }
 
          val = value::allocate (result_type);
-         store_signed_integer (value_contents_raw (val).data (),
+         store_signed_integer (val->contents_raw ().data (),
                                val->type ()->length (),
                                type_byte_order (result_type),
                                v);
@@ -1582,7 +1582,7 @@ value_vector_widen (struct value *scalar_value, struct type *vector_type)
     error (_("conversion of scalar to vector involves truncation"));
 
   value *val = value::allocate (vector_type);
-  gdb::array_view<gdb_byte> val_contents = value_contents_writeable (val);
+  gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
   int elt_len = eltype->length ();
 
   for (i = 0; i < high_bound - low_bound + 1; i++)
@@ -1629,7 +1629,7 @@ vector_binop (struct value *val1, struct value *val2, enum exp_opcode op)
     error (_("Cannot perform operation on vectors with different types"));
 
   value *val = value::allocate (type1);
-  gdb::array_view<gdb_byte> val_contents = value_contents_writeable (val);
+  gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
   scoped_value_mark mark;
   for (i = 0; i < high_bound1 - low_bound1 + 1; i++)
     {
@@ -1924,7 +1924,7 @@ value_neg (struct value *arg1)
       if (!get_array_bounds (type, &low_bound, &high_bound))
        error (_("Could not determine the vector bounds"));
 
-      gdb::array_view<gdb_byte> val_contents = value_contents_writeable (val);
+      gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
       int elt_len = eltype->length ();
 
       for (i = 0; i < high_bound - low_bound + 1; i++)
@@ -1969,7 +1969,7 @@ value_complement (struct value *arg1)
        error (_("Could not determine the vector bounds"));
 
       val = value::allocate (type);
-      gdb::array_view<gdb_byte> val_contents = value_contents_writeable (val);
+      gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
       int elt_len = eltype->length ();
 
       for (i = 0; i < high_bound - low_bound + 1; i++)
index 50f8903513eb210d6a903d7531634dca78912b6b..99dede85a0d292f74f41b3fe4c43b918c222042b 100644 (file)
@@ -392,7 +392,7 @@ value_cast_to_fixed_point (struct type *to_type, struct value *from_val)
   /* Finally, create the result value, and pack the unscaled value
      in it.  */
   struct value *result = value::allocate (to_type);
-  unscaled.write (value_contents_raw (result),
+  unscaled.write (result->contents_raw (),
                  type_byte_order (to_type),
                  to_type->is_unsigned ());
 
@@ -545,7 +545,7 @@ value_cast (struct type *type, struct value *arg2)
        {
          struct value *v = value::allocate (to_type);
          target_float_convert (value_contents (arg2).data (), type2,
-                               value_contents_raw (v).data (), type);
+                               v->contents_raw ().data (), type);
          return v;
        }
       else if (is_fixed_point_type (type2))
@@ -558,7 +558,7 @@ value_cast (struct type *type, struct value *arg2)
                                   type2->fixed_point_scaling_factor ());
 
          struct value *v = value::allocate (to_type);
-         target_float_from_host_double (value_contents_raw (v).data (),
+         target_float_from_host_double (v->contents_raw ().data (),
                                         to_type, mpq_get_d (fp_val.val));
          return v;
        }
@@ -621,7 +621,7 @@ value_cast (struct type *type, struct value *arg2)
       struct value *result = value::allocate (to_type);
 
       cplus_make_method_ptr (to_type,
-                            value_contents_writeable (result).data (), 0, 0);
+                            result->contents_writeable ().data (), 0, 0);
       return result;
     }
   else if (code1 == TYPE_CODE_MEMBERPTR && code2 == TYPE_CODE_INT
@@ -955,7 +955,7 @@ value_one (struct type *type)
        error (_("Could not determine the vector bounds"));
 
       val = value::allocate (type);
-      gdb::array_view<gdb_byte> val_contents = value_contents_writeable (val);
+      gdb::array_view<gdb_byte> val_contents = val->contents_writeable ();
       int elt_len = eltype->length ();
 
       for (i = 0; i < high_bound - low_bound + 1; i++)
@@ -1344,7 +1344,7 @@ value_assign (struct value *toval, struct value *fromval)
      implies the returned value is not lazy, even if TOVAL was.  */
   val = value_copy (toval);
   val->set_lazy (0);
-  copy (value_contents (fromval), value_contents_raw (val));
+  copy (value_contents (fromval), val->contents_raw ());
 
   /* We copy over the enclosing type and pointed-to offset from FROMVAL
      in the case of pointer types.  For object types, the enclosing type
@@ -1377,7 +1377,7 @@ value_repeat (struct value *arg1, int count)
   val->set_address (arg1->address ());
 
   read_value_memory (val, 0, val->stack (), val->address (),
-                    value_contents_all_raw (val).data (),
+                    val->contents_all_raw ().data (),
                     type_length_units (val->enclosing_type ()));
 
   return val;
@@ -1750,7 +1750,7 @@ value_cstring (const char *ptr, ssize_t len, struct type *char_type)
     = lookup_array_range_type (char_type, lowbound, highbound + lowbound - 1);
 
   val = value::allocate (stringtype);
-  memcpy (value_contents_raw (val).data (), ptr, len);
+  memcpy (val->contents_raw ().data (), ptr, len);
   return val;
 }
 
@@ -1773,7 +1773,7 @@ value_string (const char *ptr, ssize_t len, struct type *char_type)
     = lookup_string_range_type (char_type, lowbound, highbound + lowbound - 1);
 
   val = value::allocate (stringtype);
-  memcpy (value_contents_raw (val).data (), ptr, len);
+  memcpy (val->contents_raw ().data (), ptr, len);
   return val;
 }
 
@@ -2101,7 +2101,7 @@ struct_field_searcher::search (struct value *arg1, LONGEST offset,
              base_addr = arg1->address () + boffset;
              v2 = value_at_lazy (basetype, base_addr);
              if (target_read_memory (base_addr, 
-                                     value_contents_raw (v2).data (),
+                                     v2->contents_raw ().data (),
                                      v2->type ()->length ()) != 0)
                error (_("virtual baseclass botch"));
            }
@@ -3740,7 +3740,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
                  result = value::allocate
                    (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
                  cplus_make_method_ptr (result->type (),
-                                        value_contents_writeable (result).data (),
+                                        result->contents_writeable ().data (),
                                         TYPE_FN_FIELD_VOFFSET (f, j), 1);
                }
              else if (noside == EVAL_AVOID_SIDE_EFFECTS)
@@ -3765,7 +3765,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
                {
                  result = value::allocate (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
                  cplus_make_method_ptr (result->type (),
-                                        value_contents_writeable (result).data (),
+                                        result->contents_writeable ().data (),
                                         v->address (), 0);
                }
            }
@@ -4111,9 +4111,9 @@ value_literal_complex (struct value *arg1,
   int len = real_type->length ();
 
   copy (value_contents (arg1),
-       value_contents_raw (val).slice (0, len));
+       val->contents_raw ().slice (0, len));
   copy (value_contents (arg2),
-       value_contents_raw (val).slice (len, len));
+       val->contents_raw ().slice (len, len));
 
   return val;
 }
@@ -4158,9 +4158,9 @@ cast_into_complex (struct type *type, struct value *val)
       int len = val_real_type->length ();
 
       copy (value_contents (val).slice (0, len),
-           value_contents_raw (re_val));
+           re_val->contents_raw ());
       copy (value_contents (val).slice (len, len),
-           value_contents_raw (im_val));
+           im_val->contents_raw ());
 
       return value_literal_complex (re_val, im_val, type);
     }
index 578a2294dfedb7c83fe026aee2e580c143a86a65..1ad964a70c584920f0ba16d83f25c27458955e79 100644 (file)
@@ -3100,7 +3100,7 @@ test_print_flags (gdbarch *arch)
   append_flags_type_field (flags_type, 5, 3, field_type, "C");
 
   value *val = value::allocate (flags_type);
-  gdb_byte *contents = value_contents_writeable (val).data ();
+  gdb_byte *contents = val->contents_writeable ().data ();
   store_unsigned_integer (contents, 4, gdbarch_byte_order (arch), 0xaa);
 
   string_file out;
index 4dfd8fee52726bac986354fcea8eda7b9b4bdb96..811c6356281da453c34a35d676d5df62f60cfe98 100644 (file)
@@ -1023,25 +1023,24 @@ value::allocate_optimized_out (struct type *type)
 /* Accessor methods.  */
 
 gdb::array_view<gdb_byte>
-value_contents_raw (struct value *value)
+value::contents_raw ()
 {
-  struct gdbarch *arch = value->arch ();
-  int unit_size = gdbarch_addressable_memory_unit_size (arch);
+  int unit_size = gdbarch_addressable_memory_unit_size (arch ());
 
-  allocate_value_contents (value, true);
+  allocate_value_contents (this, true);
 
-  ULONGEST length = value->type ()->length ();
+  ULONGEST length = type ()->length ();
   return gdb::make_array_view
-    (value->m_contents.get () + value->m_embedded_offset * unit_size, length);
+    (m_contents.get () + m_embedded_offset * unit_size, length);
 }
 
 gdb::array_view<gdb_byte>
-value_contents_all_raw (struct value *value)
+value::contents_all_raw ()
 {
-  allocate_value_contents (value, true);
+  allocate_value_contents (this, true);
 
-  ULONGEST length = value->enclosing_type ()->length ();
-  return gdb::make_array_view (value->m_contents.get (), length);
+  ULONGEST length = enclosing_type ()->length ();
+  return gdb::make_array_view (m_contents.get (), length);
 }
 
 /* Look at value.h for description.  */
@@ -1215,10 +1214,10 @@ value_contents_copy_raw (struct value *dst, LONGEST dst_offset,
 
   /* Copy the data.  */
   gdb::array_view<gdb_byte> dst_contents
-    = value_contents_all_raw (dst).slice (dst_offset * unit_size,
+    = dst->contents_all_raw ().slice (dst_offset * unit_size,
                                          length * unit_size);
   gdb::array_view<const gdb_byte> src_contents
-    = value_contents_all_raw (src).slice (src_offset * unit_size,
+    = src->contents_all_raw ().slice (src_offset * unit_size,
                                          length * unit_size);
   copy (src_contents, dst_contents);
 
@@ -1256,8 +1255,8 @@ value_contents_copy_raw_bitwise (struct value *dst, LONGEST dst_bit_offset,
                                             bit_length));
 
   /* Copy the data.  */
-  gdb::array_view<gdb_byte> dst_contents = value_contents_all_raw (dst);
-  gdb::array_view<const gdb_byte> src_contents = value_contents_all_raw (src);
+  gdb::array_view<gdb_byte> dst_contents = dst->contents_all_raw ();
+  gdb::array_view<const gdb_byte> src_contents = src->contents_all_raw ();
   copy_bitwise (dst_contents.data (), dst_bit_offset,
                src_contents.data (), src_bit_offset,
                bit_length,
@@ -1292,18 +1291,18 @@ value_contents_copy (struct value *dst, LONGEST dst_offset,
 gdb::array_view<const gdb_byte>
 value_contents (struct value *value)
 {
-  gdb::array_view<const gdb_byte> result = value_contents_writeable (value);
+  gdb::array_view<const gdb_byte> result = value->contents_writeable ();
   require_not_optimized_out (value);
   require_available (value);
   return result;
 }
 
 gdb::array_view<gdb_byte>
-value_contents_writeable (struct value *value)
+value::contents_writeable ()
 {
-  if (value->m_lazy)
-    value_fetch_lazy (value);
-  return value_contents_raw (value);
+  if (m_lazy)
+    value_fetch_lazy (this);
+  return contents_raw ();
 }
 
 int
@@ -1577,7 +1576,7 @@ value_copy (const value *arg)
 
       allocate_value_contents (val, false);
       gdb::array_view<gdb_byte> val_contents
-       = value_contents_all_raw (val).slice (0, length);
+       = val->contents_all_raw ().slice (0, length);
 
       copy (arg_view, val_contents);
     }
@@ -1621,7 +1620,7 @@ value_non_lval (struct value *arg)
       struct type *enc_type = arg->enclosing_type ();
       struct value *val = value::allocate (enc_type);
 
-      copy (value_contents_all (arg), value_contents_all_raw (val));
+      copy (value_contents_all (arg), val->contents_all_raw ());
       val->m_type = arg->m_type;
       val->set_embedded_offset (arg->embedded_offset ());
       val->set_pointed_to_offset (arg->pointed_to_offset ());
@@ -1637,7 +1636,7 @@ value_force_lval (struct value *v, CORE_ADDR addr)
 {
   gdb_assert (VALUE_LVAL (v) == not_lval);
 
-  write_memory (addr, value_contents_raw (v).data (), v->type ()->length ());
+  write_memory (addr, v->contents_raw ().data (), v->type ()->length ());
   v->m_lval = lval_memory;
   v->m_location.address = addr;
 }
@@ -2190,15 +2189,15 @@ set_internalvar_component (struct internalvar *var,
                           LONGEST bitsize, struct value *newval)
 {
   gdb_byte *addr;
-  struct gdbarch *arch;
+  struct gdbarch *gdbarch;
   int unit_size;
 
   switch (var->kind)
     {
     case INTERNALVAR_VALUE:
-      addr = value_contents_writeable (var->u.value).data ();
-      arch = var->u.value->arch ();
-      unit_size = gdbarch_addressable_memory_unit_size (arch);
+      addr = var->u.value->contents_writeable ().data ();
+      gdbarch = var->u.value->arch ();
+      unit_size = gdbarch_addressable_memory_unit_size (gdbarch);
 
       if (bitsize)
        modify_field (var->u.value->type (), addr + offset,
@@ -3231,7 +3230,7 @@ unpack_value_bitfield (struct value *dest_val,
 
       num = unpack_bits_as_long (field_type, valaddr + embedded_offset,
                                 bitpos, bitsize);
-      store_signed_integer (value_contents_raw (dest_val).data (),
+      store_signed_integer (dest_val->contents_raw ().data (),
                            field_type->length (), byte_order, num);
     }
 
@@ -3437,7 +3436,7 @@ value_from_longest (struct type *type, LONGEST num)
 {
   struct value *val = value::allocate (type);
 
-  pack_long (value_contents_raw (val).data (), type, num);
+  pack_long (val->contents_raw ().data (), type, num);
   return val;
 }
 
@@ -3449,7 +3448,7 @@ value_from_ulongest (struct type *type, ULONGEST num)
 {
   struct value *val = value::allocate (type);
 
-  pack_unsigned_long (value_contents_raw (val).data (), type, num);
+  pack_unsigned_long (val->contents_raw ().data (), type, num);
 
   return val;
 }
@@ -3463,7 +3462,7 @@ value_from_pointer (struct type *type, CORE_ADDR addr)
 {
   struct value *val = value::allocate (type);
 
-  store_typed_address (value_contents_raw (val).data (),
+  store_typed_address (val->contents_raw ().data (),
                       check_typedef (type), addr);
   return val;
 }
@@ -3477,7 +3476,7 @@ value_from_host_double (struct type *type, double d)
 {
   struct value *value = value::allocate (type);
   gdb_assert (type->code () == TYPE_CODE_FLT);
-  target_float_from_host_double (value_contents_raw (value).data (),
+  target_float_from_host_double (value->contents_raw ().data (),
                                 value->type (), d);
   return value;
 }
@@ -3543,7 +3542,7 @@ value_from_contents (struct type *type, const gdb_byte *contents)
   struct value *result;
 
   result = value::allocate (type);
-  memcpy (value_contents_raw (result).data (), contents, type->length ());
+  memcpy (result->contents_raw ().data (), contents, type->length ());
   return result;
 }
 
@@ -3837,7 +3836,7 @@ value_fetch_lazy_memory (struct value *val)
 
   if (len > 0)
     read_value_memory (val, 0, val->stack (), addr,
-                      value_contents_all_raw (val).data (), len);
+                      val->contents_all_raw ().data (), len);
 }
 
 /* Helper for value_fetch_lazy when the value is in a register.  */
index 4213a5536277c5ac0431e282e653f769075edf8f..66074a1ab71f968ca8553fed4f2eaa40f1344ede 100644 (file)
@@ -370,6 +370,22 @@ public:
 
   int *deprecated_regnum_hack ();
 
+  /* contents() and contents_raw() both return the address of the gdb
+     buffer used to hold a copy of the contents of the lval.
+     contents() is used when the contents of the buffer are needed --
+     it uses fetch_lazy() to load the buffer from the process being
+     debugged if it hasn't already been loaded (contents_writeable()
+     is used when a writeable but fetched buffer is required)..
+     contents_raw() is used when data is being stored into the buffer,
+     or when it is certain that the contents of the buffer are valid.
+
+     Note: The contents pointer is adjusted by the offset required to
+     get to the real subobject, if the value happens to represent
+     something embedded in a larger run-time object.  */
+  gdb::array_view<gdb_byte> contents_raw ();
+  gdb::array_view<gdb_byte> contents_all_raw ();
+  gdb::array_view<gdb_byte> contents_writeable ();
+
 
   /* Type of value; either not an lval, or one of the various
      different possible kinds of lval.  */
@@ -636,22 +652,6 @@ struct lval_funcs
 
 extern void error_value_optimized_out (void);
 
-/* value_contents() and value_contents_raw() both return the address
-   of the gdb buffer used to hold a copy of the contents of the lval.
-   value_contents() is used when the contents of the buffer are needed
-   -- it uses value_fetch_lazy() to load the buffer from the process
-   being debugged if it hasn't already been loaded
-   (value_contents_writeable() is used when a writeable but fetched
-   buffer is required)..  value_contents_raw() is used when data is
-   being stored into the buffer, or when it is certain that the
-   contents of the buffer are valid.
-
-   Note: The contents pointer is adjusted by the offset required to
-   get to the real subobject, if the value happens to represent
-   something embedded in a larger run-time object.  */
-
-extern gdb::array_view<gdb_byte> value_contents_raw (struct value *);
-
 /* Actual contents of the value.  For use of this value; setting it
    uses the stuff above.  Not valid if lazy is nonzero.  Target
    byte-order.  We force it to be aligned properly for any possible
@@ -659,12 +659,10 @@ extern gdb::array_view<gdb_byte> value_contents_raw (struct value *);
    declared here.  */
 
 extern gdb::array_view<const gdb_byte> value_contents (struct value *);
-extern gdb::array_view<gdb_byte> value_contents_writeable (struct value *);
 
 /* The ALL variants of the above two macros do not adjust the returned
    pointer by the embedded_offset value.  */
 
-extern gdb::array_view<gdb_byte> value_contents_all_raw (struct value *);
 extern gdb::array_view<const gdb_byte> value_contents_all (struct value *);
 
 /* Like value_contents_all, but does not require that the returned
index 893e34d9912a617925d3330b0a334e76c937e55a..97199527c8befae6c1a16a9e65099994da25cf31 100644 (file)
@@ -404,7 +404,7 @@ tlb_value_read (struct value *val)
 
   if (!target_get_tib_address (inferior_ptid, &tlb))
     error (_("Unable to read tlb"));
-  store_typed_address (value_contents_raw (val).data (), type, tlb);
+  store_typed_address (val->contents_raw ().data (), type, tlb);
 }
 
 /* This function implements the lval_computed support for writing a