/* 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
{
*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");
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;
}
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;
}
}
else
v->set_bitsize (bit_size);
- unpacked = value_contents_writeable (v).data ();
+ unpacked = v->contents_writeable ().data ();
if (bit_size == 0)
{
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);
= 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);
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);
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));
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),
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++)
}
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;
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;
}
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;
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))
{
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
{
*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);
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,
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++)
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);
}
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
}
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);
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;
}
if (check_optimized)
v_contents = nullptr;
else
- v_contents = value_contents_raw (v).data ();
+ v_contents = v->contents_raw ().data ();
from_contents = nullptr;
}
subobj_offset += n - max;
copy (value_contents_all (val).slice (subobj_offset, len),
- value_contents_raw (retval));
+ retval->contents_raw ());
}
break;
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;
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);
else if (bytes != NULL)
{
v = value::allocate (type);
- memcpy (value_contents_writeable (v).data (), bytes,
+ memcpy (v->contents_writeable ().data (), bytes,
type->length ());
}
else
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);
{
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);
}
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;
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);
&& 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;
}
/* 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;
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;
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)
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;
}
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;
}
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;
}
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);
}
{
*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);
{
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))
{
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 ());
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 ());
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);
}
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);
/* 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 ()),
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 ());
}
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 ());
}
{
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 ());
}
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
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
{
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 ());
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 ());
}
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 ();
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 ());
}
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)
{
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));
{
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));
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
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 ()));
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 ());
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)
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);
}
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);
}
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);
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++)
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++)
{
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++)
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++)
/* 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 ());
{
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))
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;
}
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
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++)
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
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;
= 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;
}
= 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;
}
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"));
}
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)
{
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);
}
}
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;
}
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);
}
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;
/* 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. */
/* 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);
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,
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
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);
}
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 ());
{
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;
}
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,
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);
}
{
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;
}
{
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;
}
{
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;
}
{
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;
}
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;
}
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. */
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. */
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
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
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