/* Update the value's content with the tag. */
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- gdb_byte *srcbuf = value_contents_raw (address);
+ gdb_byte *srcbuf = value_contents_raw (address).data ();
store_unsigned_integer (srcbuf, sizeof (addr), byte_order, addr);
}
else
int len = TYPE_LENGTH (type);
enum type_code typecode = type->code ();
int regnum = AARCH64_X0_REGNUM + info->ngrn;
- const bfd_byte *buf = value_contents (arg);
+ const bfd_byte *buf = value_contents (arg).data ();
info->argnum++;
pass_on_stack (struct aarch64_call_info *info, struct type *type,
struct value *arg)
{
- const bfd_byte *buf = value_contents (arg);
+ const bfd_byte *buf = value_contents (arg).data ();
int len = TYPE_LENGTH (type);
int align;
stack_item_t item;
{
case TYPE_CODE_FLT:
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
- value_contents (arg));
+ value_contents (arg).data ());
break;
case TYPE_CODE_COMPLEX:
{
- const bfd_byte *buf = value_contents (arg);
+ const bfd_byte *buf = value_contents (arg).data ();
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
if (!pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (target_type),
case TYPE_CODE_ARRAY:
if (arg_type->is_vector ())
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
- value_contents (arg));
+ value_contents (arg).data ());
/* fall through. */
case TYPE_CODE_STRUCT:
sp = align_down (sp - len, 16);
/* Write the real data into the stack. */
- write_memory (sp, value_contents (arg), len);
+ write_memory (sp, value_contents (arg).data (), len);
/* Construct the indirection. */
arg_type = lookup_pointer_type (arg_type);
mark_value_bytes_unavailable (result_value, 0,
TYPE_LENGTH (value_type (result_value)));
else
- memcpy (value_contents_raw (result_value), reg_buf, regsize);
+ memcpy (value_contents_raw (result_value).data (), reg_buf, regsize);
return result_value;
}
bounds may be variable and were not passed to that function. So,
we further resolve the array bounds here and then update the
sizes. */
- const gdb_byte *valaddr = value_contents_for_printing (arr);
+ const gdb_byte *valaddr = value_contents_for_printing (arr).data ();
CORE_ADDR address = value_address (arr);
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, TYPE_LENGTH (type));
if (obj == NULL)
src = valaddr + offset;
else
- src = value_contents (obj) + offset;
+ src = value_contents (obj).data () + offset;
if (is_dynamic_type (type))
{
else
{
v = allocate_value (type);
- src = value_contents (obj) + offset;
+ src = value_contents (obj).data () + offset;
}
if (obj != NULL)
}
else
set_value_bitsize (v, bit_size);
- unpacked = value_contents_writeable (v);
+ unpacked = value_contents_writeable (v).data ();
if (bit_size == 0)
{
if (is_big_endian && is_scalar_type (value_type (fromval)))
from_offset = from_size - bits;
copy_bitwise (buffer, value_bitpos (toval),
- value_contents (fromval), from_offset,
+ value_contents (fromval).data (), from_offset,
bits, is_big_endian);
write_memory_with_notification (to_addr, buffer, len);
val = value_copy (toval);
- memcpy (value_contents_raw (val), value_contents (fromval),
+ memcpy (value_contents_raw (val).data (),
+ value_contents (fromval).data (),
TYPE_LENGTH (type));
deprecated_set_value_type (val, type);
= TYPE_LENGTH (value_type (component)) * TARGET_CHAR_BIT - bits;
else
src_offset = 0;
- copy_bitwise (value_contents_writeable (container) + offset_in_container,
+ copy_bitwise ((value_contents_writeable (container).data ()
+ + offset_in_container),
value_bitpos (container) + bit_offset_in_container,
- value_contents (val), src_offset, bits, 1);
+ value_contents (val).data (), src_offset, bits, 1);
}
else
- copy_bitwise (value_contents_writeable (container) + offset_in_container,
+ copy_bitwise ((value_contents_writeable (container).data ()
+ + offset_in_container),
value_bitpos (container) + bit_offset_in_container,
- value_contents (val), 0, bits, 0);
+ value_contents (val).data (), 0, bits, 0);
}
/* Determine if TYPE is an access to an unconstrained array. */
VALUE_LVAL (val) = lval_memory;
set_value_address (val, addr);
- write_memory (addr, value_contents (val), len);
+ write_memory (addr, value_contents (val).data (), len);
}
return val;
actual_type = ada_check_typedef (value_type (actual));
val = allocate_value (actual_type);
- memcpy ((char *) value_contents_raw (val),
- (char *) value_contents (actual),
+ memcpy ((char *) value_contents_raw (val).data (),
+ (char *) value_contents (actual).data (),
TYPE_LENGTH (actual_type));
actual = ensure_lval (val);
}
for (i = ada_array_arity (ada_check_typedef (value_type (arr)));
i > 0; i -= 1)
{
- modify_field (value_type (bounds), value_contents_writeable (bounds),
+ modify_field (value_type (bounds),
+ value_contents_writeable (bounds).data (),
ada_array_bound (arr, i, 0),
desc_bound_bitpos (bounds_type, i, 0),
desc_bound_bitsize (bounds_type, i, 0));
- modify_field (value_type (bounds), value_contents_writeable (bounds),
+ modify_field (value_type (bounds),
+ value_contents_writeable (bounds).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 (value_type (descriptor),
- value_contents_writeable (descriptor),
+ value_contents_writeable (descriptor).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 (value_type (descriptor),
- value_contents_writeable (descriptor),
+ value_contents_writeable (descriptor).data (),
value_pointer (bounds,
desc_type->field (1).type ()),
fat_pntr_bounds_bitpos (desc_type),
int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
- return ada_value_primitive_packed_val (arg1, value_contents (arg1),
+ return ada_value_primitive_packed_val (arg1,
+ value_contents (arg1).data (),
offset + bit_pos / 8,
bit_pos % 8, bit_size, type);
}
/* Our value does not live in memory; it could be a convenience
variable, for instance. Create a not_lval value using val0's
contents. */
- return value_from_contents (type, value_contents (val0));
+ return value_from_contents (type, value_contents (val0).data ());
}
return value_from_contents_and_address (type, 0, address);
{
struct value *elt = value_cast (elt_type, value_subscript (val, lo + i));
- memcpy (value_contents_writeable (res) + (i * TYPE_LENGTH (elt_type)),
- value_contents_all (elt), TYPE_LENGTH (elt_type));
+ memcpy ((value_contents_writeable (res).data ()
+ + (i * TYPE_LENGTH (elt_type))),
+ value_contents_all (elt).data (), TYPE_LENGTH (elt_type));
}
return res;
}
val = allocate_value (type1);
- store_unsigned_integer (value_contents_raw (val),
+ store_unsigned_integer (value_contents_raw (val).data (),
TYPE_LENGTH (value_type (val)),
type_byte_order (type1), v);
return val;
representations use all bits (no padding or undefined bits)
and do not have user-defined equality. */
return (TYPE_LENGTH (arg1_type) == TYPE_LENGTH (arg2_type)
- && memcmp (value_contents (arg1), value_contents (arg2),
+ && memcmp (value_contents (arg1).data (),
+ value_contents (arg2).data (),
TYPE_LENGTH (arg1_type)) == 0);
}
return value_equal (arg1, arg2);
static void
value_as_string (char *dest, struct value *val, int length)
{
- memcpy (dest, value_contents (val), length);
+ memcpy (dest, value_contents (val).data (), length);
dest[length] = '\0';
}
const struct value_print_options *options)
{
struct type *type = ada_check_typedef (value_type (val));
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (type->code () == TYPE_CODE_RANGE
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_ENUM
}
struct type *type = ada_check_typedef (value_type (value));
- const gdb_byte *valaddr = value_contents_for_printing (value);
+ const gdb_byte *valaddr = value_contents_for_printing (value).data ();
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
len = type->num_fields ();
if (ada_is_string_type (type)
&& (options->format == 0 || options->format == 's'))
{
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
ada_val_print_string (type, valaddr, offset_aligned, stream, recurse,
val_print_optimized_out (val, stream);
else if (TYPE_FIELD_BITSIZE (type, 0) > 0)
{
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
val_print_packed_array_elements (type, valaddr, offset_aligned,
stream, recurse, options);
type = value_type (val);
struct type *saved_type = type;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
CORE_ADDR address = value_address (val);
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, TYPE_LENGTH (type));
/* Convert to VALTYPE. */
gdb_assert (TYPE_LENGTH (valtype) == 4);
- alpha_sts (gdbarch, out, value_contents_all (value));
+ alpha_sts (gdbarch, out, value_contents_all (value).data ());
release_value (value);
return 1;
sp = (sp & -16) - 16;
/* Write the real data into the stack. */
- write_memory (sp, value_contents (arg), 16);
+ write_memory (sp, value_contents (arg).data (), 16);
/* Construct the indirection. */
arg_type = lookup_pointer_type (arg_type);
sp = (sp & -16) - 16;
/* Write the real data into the stack. */
- write_memory (sp, value_contents (arg), 32);
+ write_memory (sp, value_contents (arg).data (), 32);
/* Construct the indirection. */
arg_type = lookup_pointer_type (arg_type);
m_arg->len = TYPE_LENGTH (arg_type);
m_arg->offset = accumulate_size;
accumulate_size = (accumulate_size + m_arg->len + 7) & ~7;
- m_arg->contents = value_contents (arg);
+ m_arg->contents = value_contents (arg).data ();
}
/* Determine required argument register loads, loading an argument register
value *result_value = allocate_value (register_type (gdbarch, regnum));
VALUE_LVAL (result_value) = lval_register;
VALUE_REGNUM (result_value) = regnum;
- gdb_byte *buf = value_contents_raw (result_value);
+ gdb_byte *buf = value_contents_raw (result_value).data ();
if (i386_byte_regnum_p (gdbarch, regnum))
{
else
{
/* The argument will be passed in registers. */
- const gdb_byte *valbuf = value_contents (args[i]);
+ const gdb_byte *valbuf = value_contents (args[i]).data ();
gdb_byte buf[8];
gdb_assert (len <= 16);
for (i = 0; i < num_stack_args; i++)
{
struct type *type = value_type (stack_args[i]);
- const gdb_byte *valbuf = value_contents (stack_args[i]);
+ const gdb_byte *valbuf = value_contents (stack_args[i]).data ();
int len = TYPE_LENGTH (type);
write_memory (sp + element * 8, valbuf, len);
if (amd64_windows_passed_by_pointer (value_type (args[i])))
{
struct type *type = value_type (args[i]);
- const gdb_byte *valbuf = value_contents (args[i]);
+ const gdb_byte *valbuf = value_contents (args[i]).data ();
const int len = TYPE_LENGTH (type);
/* Store a copy of that argument on the stack, aligned to
struct value *arg, int regno)
{
struct type *type = value_type (arg);
- const gdb_byte *valbuf = value_contents (arg);
+ const gdb_byte *valbuf = value_contents (arg).data ();
gdb_byte buf[8];
gdb_assert (TYPE_LENGTH (type) <= 8);
for (i = 0; i < num_stack_args; i++)
{
struct type *type = value_type (stack_args[i]);
- const gdb_byte *valbuf = value_contents (stack_args[i]);
+ const gdb_byte *valbuf = value_contents (stack_args[i]).data ();
write_memory (sp + element * 8, valbuf, TYPE_LENGTH (type));
element += ((TYPE_LENGTH (type) + 7) / 8);
unsigned int len = TYPE_LENGTH (value_type (args[i]));
unsigned int space = align_up (len, 4);
- memcpy (data, value_contents (args[i]), (size_t) len);
+ memcpy (data, value_contents (args[i]).data (), (size_t) len);
arc_debug_printf ("copying arg %d, val 0x%08x, len %d to mem",
- i, *((int *) value_contents (args[i])), len);
+ i, *((int *) value_contents (args[i]).data ()),
+ len);
data += space;
}
len = TYPE_LENGTH (arg_type);
target_type = TYPE_TARGET_TYPE (arg_type);
typecode = arg_type->code ();
- val = value_contents (args[argnum]);
+ val = value_contents (args[argnum]).data ();
align = type_align (arg_type);
/* Round alignment up to a whole number of words. */
int j;
struct value *arg = args[i];
struct type *type = check_typedef (value_type (arg));
- const bfd_byte *contents = value_contents (arg);
+ const bfd_byte *contents = value_contents (arg).data ();
int len = TYPE_LENGTH (type);
/* Calculate the potential last register needed.
int container_len = align_up (TYPE_LENGTH (arg_type), 4);
sp -= container_len;
- write_memory (sp, value_contents (args[i]), container_len);
+ write_memory (sp, value_contents (args[i]).data (), container_len);
}
/* Initialize R0, R1, and R2 to the first 3 words of parameters. */
unpack_value_bitfield (bit_val,
w->val_bitpos,
w->val_bitsize,
- value_contents_for_printing (val),
+ value_contents_for_printing (val).data (),
value_offset (val),
val);
&& (*length < 0 || *length <= fetchlimit))
{
int i;
- const gdb_byte *contents = value_contents (value);
+ const gdb_byte *contents = value_contents (value).data ();
/* If a length is specified, use that. */
if (*length >= 0)
error (_("Too many array elements"));
result = allocate_value (expect_type);
- memcpy (value_contents_raw (result), obstack_base (&output),
+ memcpy (value_contents_raw (result).data (), obstack_base (&output),
obstack_object_size (&output));
}
else
{
struct type *type = check_typedef (value_type (val));
CORE_ADDR address = value_address (val);
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
struct type *unresolved_elttype = TYPE_TARGET_TYPE (type);
struct type *elttype = check_typedef (unresolved_elttype);
}
struct type *type = check_typedef (value_type (val));
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (options->vtblprint && cp_is_vtbl_ptr_type (type))
{
TYPE_CODE_PTR.) */
int offset = TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8;
struct type *field_type = type->field (VTBL_FNADDR_OFFSET).type ();
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
CORE_ADDR addr = extract_typed_address (valaddr + offset, field_type);
print_function_pointer_address (options, type->arch (), addr, stream);
intended to be used as an integer or a character, print
the character equivalent as well. */
struct type *type = value_type (val);
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (c_textual_element_type (type, options->format))
{
fputs_filtered (" ", stream);
&& type0->code () != TYPE_CODE_STRING)
error (_("First argument of %s must be a string."), fnname);
- const char *a0 = (const char *) value_contents (argv[0]);
+ const char *a0 = (const char *) value_contents (argv[0]).data ();
cmd_list_element *cmd = lookup_cmd (&a0, showlist, "", NULL, -1, 0);
if (cmd == nullptr || cmd->type != show_cmd)
/* Have everything. Open/write the data. */
if (file_format == NULL || strcmp (file_format, "binary") == 0)
- dump_binary_file (filename.get (), mode, value_contents (val),
+ dump_binary_file (filename.get (), mode, value_contents (val).data (),
TYPE_LENGTH (value_type (val)));
else
{
}
dump_bfd_file (filename.get (), mode, file_format, vaddr,
- value_contents (val),
+ value_contents (val).data (),
TYPE_LENGTH (value_type (val)));
}
}
error (_("Register \"%s\" is not available."), reg_name);
inferior_addr = regs_base + reg_offset;
- if (0 != target_write_memory (inferior_addr, value_contents (regval),
+ if (0 != target_write_memory (inferior_addr,
+ value_contents (regval).data (),
reg_size))
error (_("Cannot write register \"%s\" to inferior memory at %s."),
reg_name, paddress (gdbarch, inferior_addr));
vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype);
for (i = n_baseclasses; i < len; i++)
{
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
/* If requested, skip printing of static fields. */
if (!options->static_field_print
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
struct obstack tmp_obstack = dont_print_vb_obstack;
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (dont_print_vb == 0)
{
}
value *val = allocate_value (the_struct);
- gdb_byte *contents = value_contents_writeable (val);
+ gdb_byte *contents = value_contents_writeable (val).data ();
store_unsigned_integer (contents, TYPE_LENGTH (value_enclosing_type (val)),
gdbarch_byte_order (arch), 0xe9);
int i;
len = TYPE_LENGTH (value_type (args[argnum]));
- val = value_contents (args[argnum]);
+ val = value_contents (args[argnum]).data ();
/* How may registers worth of storage do we need for this argument? */
reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
arg_type = check_typedef (value_type (args[argnum]));
len = TYPE_LENGTH (arg_type);
- val = value_contents (args[argnum]);
+ val = value_contents (args[argnum]).data ();
/* Copy the argument to argument registers or the dummy stack.
Large arguments are split between registers and stack.
struct type *ptr_type;
struct value *ival;
int length;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
length = unpack_field_as_long (type, valaddr + embedded_offset, 0);
/* Use the regcache_cooked_read() method so that it, on the fly,
constructs either a raw or pseudo register from the raw
register cache. */
- cache->prev_regcache->cooked_read (regnum,
- value_contents_writeable (reg_val));
+ cache->prev_regcache->cooked_read
+ (regnum, value_contents_writeable (reg_val).data ());
return reg_val;
}
gdb_assert (!check_optimized || from == nullptr);
if (from != nullptr)
{
- from_contents = value_contents (from);
+ from_contents = value_contents (from).data ();
v_contents = nullptr;
}
else
if (check_optimized)
v_contents = nullptr;
else
- v_contents = value_contents_raw (v);
+ v_contents = value_contents_raw (v).data ();
from_contents = nullptr;
}
bits_to_skip += p->offset;
copy_bitwise (v_contents, offset,
- value_contents_all (p->v.value),
+ value_contents_all (p->v.value).data (),
bits_to_skip,
this_size_bits, bits_big_endian);
}
encode address spaces and other things in CORE_ADDR. */
bfd_endian byte_order = gdbarch_byte_order (get_frame_arch (frame));
LONGEST byte_offset
- = extract_signed_integer (value_contents (value),
+ = extract_signed_integer (value_contents (value).data (),
TYPE_LENGTH (type), byte_order);
byte_offset += piece->v.ptr.offset;
if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG)
subobj_offset += n - max;
- memcpy (value_contents_raw (retval),
- value_contents_all (val) + subobj_offset, len);
+ memcpy (value_contents_raw (retval).data (),
+ value_contents_all (val).data () + subobj_offset, len);
}
break;
invalid_synthetic_pointer ();
retval = allocate_value (subobj_type);
- bfd_byte *contents = value_contents_raw (retval);
+ bfd_byte *contents = value_contents_raw (retval).data ();
memcpy (contents, this->m_data + subobj_offset, n);
}
break;
ULONGEST result;
dwarf_require_integral (value_type (result_val));
- result = extract_unsigned_integer (value_contents (result_val),
+ result = extract_unsigned_integer (value_contents (result_val).data (),
TYPE_LENGTH (value_type (result_val)),
byte_order);
else
result_val
= value_from_contents (type,
- value_contents_all (result_val));
+ value_contents_all (result_val).data ());
}
break;
release_value (target_val).release ());
/* Copy the referencing pointer to the new computed value. */
- memcpy (value_contents_raw (val), value_contents_raw (outer_val),
+ memcpy (value_contents_raw (val).data (),
+ value_contents_raw (outer_val).data (),
TYPE_LENGTH (checked_type));
set_value_lazy (val, 0);
else if (bytes != NULL)
{
v = allocate_value (type);
- memcpy (value_contents_writeable (v), bytes,
+ memcpy (value_contents_writeable (v).data (), bytes,
TYPE_LENGTH (type));
}
else
value = allocate_value (value_type);
gdbarch_return_value (gdbarch, func_func, value_type, regcache,
- value_contents_raw (value), NULL);
+ value_contents_raw (value).data (), NULL);
resolved_address = value_as_address (value);
resolved_pc = gdbarch_convert_from_func_ptr_addr
(gdbarch, resolved_address, current_inferior ()->top_target ());
bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno);
- addr = value_contents_writeable (struct_val) + bitpos / 8;
+ addr = value_contents_writeable (struct_val).data () + bitpos / 8;
if (bitsize)
modify_field (struct_type, addr,
value_as_long (val), bitpos % 8, bitsize);
else
- memcpy (addr, value_contents (val),
+ memcpy (addr, value_contents (val).data (),
TYPE_LENGTH (value_type (val)));
}
{
struct value *rec = allocate_value (expect_type);
- memset (value_contents_raw (rec), '\0', TYPE_LENGTH (type));
+ memset (value_contents_raw (rec).data (), '\0', TYPE_LENGTH (type));
return evaluate_struct_tuple (rec, exp, noside, nargs);
}
high_bound = (TYPE_LENGTH (type) / element_size) - 1;
}
index = low_bound;
- memset (value_contents_raw (array), 0, TYPE_LENGTH (expect_type));
+ memset (value_contents_raw (array).data (), 0, TYPE_LENGTH (expect_type));
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)
+ memcpy (value_contents_raw (array).data ()
+ (index - low_bound) * element_size,
- value_contents (element),
+ value_contents (element).data (),
element_size);
index++;
}
&& type->code () == TYPE_CODE_SET)
{
struct value *set = allocate_value (expect_type);
- gdb_byte *valaddr = value_contents_raw (set);
+ gdb_byte *valaddr = value_contents_raw (set).data ();
struct type *element_type = type->index_type ();
struct type *check_type = element_type;
LONGEST low_bound, high_bound;
case TYPE_CODE_FLT:
{
double d
- = fabs (target_float_to_host_double (value_contents (arg1),
+ = fabs (target_float_to_host_double (value_contents (arg1).data (),
value_type (arg1)));
return value_from_host_double (type, d);
}
case TYPE_CODE_FLT:
{
double d1
- = target_float_to_host_double (value_contents (arg1),
+ = target_float_to_host_double (value_contents (arg1).data (),
value_type (arg1));
double d2
- = target_float_to_host_double (value_contents (arg2),
+ = target_float_to_host_double (value_contents (arg2).data (),
value_type (arg2));
double d3 = fmod (d1, d2);
return value_from_host_double (type, d3);
if (type->code () != TYPE_CODE_FLT)
error (_("argument to CEILING must be of type float"));
double val
- = target_float_to_host_double (value_contents (arg1),
+ = target_float_to_host_double (value_contents (arg1).data (),
value_type (arg1));
val = ceil (val);
return value_from_host_double (type, val);
if (type->code () != TYPE_CODE_FLT)
error (_("argument to FLOOR must be of type float"));
double val
- = target_float_to_host_double (value_contents (arg1),
+ = target_float_to_host_double (value_contents (arg1).data (),
value_type (arg1));
val = floor (val);
return value_from_host_double (type, val);
case TYPE_CODE_FLT:
{
double a
- = target_float_to_host_double (value_contents (arg1),
+ = target_float_to_host_double (value_contents (arg1).data (),
value_type (arg1));
double p
- = target_float_to_host_double (value_contents (arg2),
+ = target_float_to_host_double (value_contents (arg2).data (),
value_type (arg2));
double result = fmod (a, p);
if (result != 0 && (a < 0.0) != (p < 0.0))
array = value_at_lazy (array_slice_type,
value_address (array) + total_offset);
else
- array = value_from_contents_and_address (array_slice_type,
- (value_contents (array)
- + total_offset),
- (value_address (array)
- + total_offset));
+ array = value_from_contents_and_address
+ (array_slice_type, value_contents (array).data () + total_offset,
+ value_address (array) + total_offset);
}
else if (!value_lazy (array))
array = value_from_component (array, array_slice_type, total_offset);
struct type *elt_type = value_type (elt);
if (is_dynamic_type (elt_type))
{
- const gdb_byte *valaddr = value_contents_for_printing (elt);
+ const gdb_byte *valaddr = value_contents_for_printing (elt).data ();
CORE_ADDR address = value_address (elt);
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, TYPE_LENGTH (elt_type));
const int length = TYPE_LENGTH (type);
const CORE_ADDR addr
= value_as_long (value_allocate_space_in_inferior (length));
- write_memory (addr, value_contents (value), length);
- struct value *val
- = value_from_contents_and_address (type, value_contents (value),
- addr);
+ write_memory (addr, value_contents (value).data (), length);
+ struct value *val = value_from_contents_and_address
+ (type, value_contents (value).data (), addr);
return value_addr (val);
}
else
struct type *elttype;
CORE_ADDR addr;
int index;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
const CORE_ADDR address = value_address (val);
switch (type->code ())
}
else
{
- const gdb_byte *contents = value_contents (v);
+ const gdb_byte *contents = value_contents (v).data ();
pattern_buf.insert (pattern_buf.end (), contents,
contents + TYPE_LENGTH (t));
}
}
/* Put the constant back in target format. */
v = allocate_value (type);
- store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type),
+ store_signed_integer (value_contents_raw (v).data (), TYPE_LENGTH (type),
type_byte_order (type),
(LONGEST) SYMBOL_VALUE (var));
VALUE_LVAL (v) = not_lval;
struct objfile *var_objfile = symbol_objfile (var);
addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
var->obj_section (var_objfile));
- store_typed_address (value_contents_raw (v), type, addr);
+ store_typed_address (value_contents_raw (v).data (), type, addr);
}
else
- store_typed_address (value_contents_raw (v), type,
+ store_typed_address (value_contents_raw (v).data (), type,
SYMBOL_VALUE_ADDRESS (var));
VALUE_LVAL (v) = not_lval;
return v;
type = resolve_dynamic_type (type, {}, /* Unused address. */ 0);
}
v = allocate_value (type);
- memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var),
+ memcpy (value_contents_raw (v).data (), SYMBOL_VALUE_BYTES (var),
TYPE_LENGTH (type));
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), &optim,
+ value_contents_raw (v).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),
+ store_unsigned_integer (value_contents_writeable (reg_val).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), buf, register_size (gdbarch, regnum));
+ memcpy (value_contents_raw (reg_val).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),
+ pack_long (value_contents_writeable (reg_val).data (),
register_type (gdbarch, regnum), addr);
return reg_val;
}
if (bufferp)
{
if (!*optimizedp && !*unavailablep)
- memcpy (bufferp, value_contents_all (value),
+ memcpy (bufferp, value_contents_all (value).data (),
TYPE_LENGTH (value_type (value)));
else
memset (bufferp, 0, TYPE_LENGTH (value_type (value)));
else
{
int i;
- const gdb_byte *buf = value_contents (value);
+ const gdb_byte *buf = value_contents (value).data ();
fprintf_unfiltered (&debug_file, " bytes=");
fprintf_unfiltered (&debug_file, "[");
_("Register %d is not available"), regnum);
}
- LONGEST r = extract_signed_integer (value_contents_all (value), size,
+ LONGEST r = extract_signed_integer (value_contents_all (value).data (), size,
byte_order);
release_value (value);
_("Register %d is not available"), regnum);
}
- ULONGEST r = extract_unsigned_integer (value_contents_all (value), size,
- byte_order);
+ ULONGEST r = extract_unsigned_integer (value_contents_all (value).data (),
+ size, byte_order);
release_value (value);
return r;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int size = register_size (gdbarch, VALUE_REGNUM (regval));
- *val = extract_unsigned_integer (value_contents (regval), size, byte_order);
+ *val = extract_unsigned_integer (value_contents (regval).data (), size,
+ byte_order);
return true;
}
return false;
}
- memcpy (myaddr, value_contents_all (value) + offset, curr_len);
+ memcpy (myaddr, value_contents_all (value).data () + offset,
+ curr_len);
release_value (value);
}
regnum);
gdb_assert (value != NULL);
- memcpy ((char *) value_contents_writeable (value) + offset, myaddr,
- curr_len);
- put_frame_register (frame, regnum, value_contents_raw (value));
+ memcpy ((char *) value_contents_writeable (value).data () + offset,
+ myaddr, curr_len);
+ put_frame_register (frame, regnum,
+ value_contents_raw (value).data ());
release_value (value);
}
/* The FDPIC ABI requires function descriptors to be passed instead
of entry points. */
CORE_ADDR addr = extract_unsigned_integer
- (value_contents (arg), 4, byte_order);
+ (value_contents (arg).data (), 4, byte_order);
addr = find_func_descr (gdbarch, addr);
store_unsigned_integer (valbuf, 4, byte_order, addr);
typecode = TYPE_CODE_PTR;
}
else
{
- val = value_contents (arg);
+ val = value_contents (arg).data ();
}
while (len > 0)
int offset = -1;
return is_unique_ancestor_worker (base, value_type (val), &offset,
- value_contents_for_printing (val),
+ value_contents_for_printing (val).data (),
value_embedded_offset (val),
value_address (val), val) == 1;
}
gnuv3_method_ptr_to_value (struct value **this_p, struct value *method_ptr)
{
struct gdbarch *gdbarch;
- const gdb_byte *contents = value_contents (method_ptr);
+ const gdb_byte *contents = value_contents (method_ptr).data ();
CORE_ADDR ptr_value;
struct type *self_type, *final_type, *method_type;
LONGEST adjustment;
unpack_value_field_as_pointer. Do this until we can get
unpack_value_field_as_pointer. */
LONGEST addr;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (! unpack_value_field_as_long (type, valaddr, embedded_offset, 0,
{
type = check_typedef (type);
length = TYPE_LENGTH (type);
- contents = value_contents (value);
+ contents = value_contents (value).data ();
}
catch (const gdb_exception &except)
{
{
if (is_floating_value (value))
{
- d = target_float_to_host_double (value_contents (value), type);
+ d = target_float_to_host_double (value_contents (value).data (),
+ type);
check = value_from_host_double (type, d);
}
else if (type->is_unsigned ())
{
struct type *type = value_type (args[argument]);
int len = TYPE_LENGTH (type);
- char *contents = (char *) value_contents (args[argument]);
+ char *contents = (char *) value_contents (args[argument]).data ();
/* Pad the argument appropriately. */
int padded_len = align_up (len, wordsize);
param_len = 4;
struct_ptr += align_up (TYPE_LENGTH (type), 8);
if (write_pass)
- write_memory (struct_end - struct_ptr, value_contents (arg),
- TYPE_LENGTH (type));
+ write_memory (struct_end - struct_ptr,
+ value_contents (arg).data (), TYPE_LENGTH (type));
store_unsigned_integer (param_val, 4, byte_order,
struct_end - struct_ptr);
}
/* Integer value store, right aligned. "unpack_long"
takes care of any sign-extension problems. */
param_len = align_up (TYPE_LENGTH (type), 4);
- store_unsigned_integer (param_val, param_len, byte_order,
- unpack_long (type,
- value_contents (arg)));
+ store_unsigned_integer
+ (param_val, param_len, byte_order,
+ unpack_long (type, value_contents (arg).data ()));
}
else if (type->code () == TYPE_CODE_FLT)
{
/* Floating point value store, right aligned. */
param_len = align_up (TYPE_LENGTH (type), 4);
- memcpy (param_val, value_contents (arg), param_len);
+ memcpy (param_val, value_contents (arg).data (), param_len);
}
else
{
/* Small struct value are stored right-aligned. */
memcpy (param_val + param_len - TYPE_LENGTH (type),
- value_contents (arg), TYPE_LENGTH (type));
+ value_contents (arg).data (), TYPE_LENGTH (type));
/* Structures of size 5, 6 and 7 bytes are special in that
the higher-ordered word is stored in the lower-ordered
the right halves of the floating point registers;
the left halves are unused." */
regcache->cooked_write_part (regnum, offset % 8, len,
- value_contents (arg));
+ value_contents (arg).data ());
}
}
}
{
ULONGEST codeptr, fptr;
- codeptr = unpack_long (type, value_contents (arg));
+ codeptr = unpack_long (type, value_contents (arg).data ());
fptr = hppa64_convert_code_addr_to_fptr (gdbarch, codeptr);
store_unsigned_integer (fptrbuf, TYPE_LENGTH (type), byte_order,
fptr);
}
else
{
- valbuf = value_contents (arg);
+ valbuf = value_contents (arg).data ();
}
/* Always store the argument in memory. */
trad_frame_get_prev_register (this_frame, saved_regs,
HPPA_PCOQ_HEAD_REGNUM);
- pc = extract_unsigned_integer (value_contents_all (pcoq_val),
+ pc = extract_unsigned_integer (value_contents_all (pcoq_val).data (),
size, byte_order);
return frame_unwind_got_constant (this_frame, regnum, pc + 4);
}
{
if (write_pass)
{
- const gdb_byte *val = value_contents_all (args[i]);
+ const gdb_byte *val = value_contents_all (args[i]).data ();
regcache->raw_write (I387_MM0_REGNUM(tdep) + num_m128, val);
}
num_m128++;
i386_darwin_arg_type_alignment (arg_type));
if (write_pass)
write_memory (sp + args_space,
- value_contents_all (args[i]),
+ value_contents_all (args[i]).data (),
TYPE_LENGTH (arg_type));
/* The System V ABI says that:
args_space_used = align_up (args_space_used, 16);
write_memory (sp + args_space_used,
- value_contents_all (args[i]), len);
+ value_contents_all (args[i]).data (), len);
/* The System V ABI says that:
"An argument's size is increased, if necessary, to make it a
/* The 'this' pointer needs to be in ECX. */
if (thiscall)
- regcache->cooked_write (I386_ECX_REGNUM, value_contents_all (args[0]));
+ regcache->cooked_write (I386_ECX_REGNUM,
+ value_contents_all (args[0]).data ());
/* MarkK wrote: This "+ 8" is all over the place:
(i386_frame_this_id, i386_sigtramp_frame_this_id,
{
gdb_byte raw_buf[I386_MAX_REGISTER_SIZE];
enum register_status status;
- gdb_byte *buf = value_contents_raw (result_value);
+ gdb_byte *buf = value_contents_raw (result_value).data ();
if (i386_mmx_regnum_p (gdbarch, regnum))
{
if (value_entirely_available (regval))
{
- const gdb_byte *raw = value_contents (regval);
+ const gdb_byte *raw = value_contents (regval).data ();
fputs_filtered ("0x", file);
for (i = 9; i >= 0; i--)
that frame by adding the size of output:
(sof (size of frame) - sol (size of locals)). */
val = ia64_frame_prev_register (this_frame, this_cache, IA64_CFM_REGNUM);
- prev_cfm = extract_unsigned_integer (value_contents_all (val),
+ prev_cfm = extract_unsigned_integer (value_contents_all (val).data (),
8, byte_order);
bsp = rse_address_add (cache->bsp, -(cache->sof));
prev_bsp =
/* Adjust the register number to account for register rotation. */
regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
- prN = extract_bit_field (value_contents_all (pr_val),
+ prN = extract_bit_field (value_contents_all (pr_val).data (),
regnum - VP0_REGNUM, 1);
return frame_unwind_got_constant (this_frame, regnum, prN);
}
ULONGEST unatN;
unat_val = ia64_frame_prev_register (this_frame, this_cache,
IA64_UNAT_REGNUM);
- unatN = extract_bit_field (value_contents_all (unat_val),
+ unatN = extract_bit_field (value_contents_all (unat_val).data (),
regnum - IA64_NAT0_REGNUM, 1);
return frame_unwind_got_constant (this_frame, regnum, unatN);
}
regnum = IA64_GR32_REGNUM + (regnum - V32_REGNUM);
reg_val = ia64_frame_prev_register (this_frame, this_cache,
IA64_CFM_REGNUM);
- prev_cfm = extract_unsigned_integer (value_contents_all (reg_val),
- 8, byte_order);
+ prev_cfm = extract_unsigned_integer
+ (value_contents_all (reg_val).data (), 8, byte_order);
reg_val = ia64_frame_prev_register (this_frame, this_cache,
IA64_BSP_REGNUM);
- prev_bsp = extract_unsigned_integer (value_contents_all (reg_val),
- 8, byte_order);
+ prev_bsp = extract_unsigned_integer
+ (value_contents_all (reg_val).data (), 8, byte_order);
prev_bof = rse_address_add (prev_bsp, -(prev_cfm & 0x7f));
addr = rse_address_add (prev_bof, (regnum - IA64_GR32_REGNUM));
/* Adjust the register number to account for register rotation. */
regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
}
- prN_val = extract_bit_field (value_contents_all (val),
+ prN_val = extract_bit_field (value_contents_all (val).data (),
regnum - VP0_REGNUM, 1);
return frame_unwind_got_constant (this_frame, regnum, prN_val);
}
{
ULONGEST unatN_val;
- unatN_val = extract_bit_field (value_contents_all (val),
+ unatN_val = extract_bit_field (value_contents_all (val).data (),
regnum - IA64_NAT0_REGNUM, 1);
return frame_unwind_got_constant (this_frame, regnum, unatN_val);
}
register will be if we pop the frame back which is why we might
have been called. We know that libunwind will pass us back the
beginning of the current frame so we should just add sof to it. */
- prev_bsp = extract_unsigned_integer (value_contents_all (val),
+ prev_bsp = extract_unsigned_integer (value_contents_all (val).data (),
8, byte_order);
cfm_val = libunwind_frame_prev_register (this_frame, this_cache,
IA64_CFM_REGNUM);
- prev_cfm = extract_unsigned_integer (value_contents_all (cfm_val),
+ prev_cfm = extract_unsigned_integer (value_contents_all (cfm_val).data (),
8, byte_order);
prev_bsp = rse_address_add (prev_bsp, (prev_cfm & 0x7f));
method of getting previous registers. */
prev_ip_val = libunwind_frame_prev_register (this_frame, this_cache,
IA64_IP_REGNUM);
- prev_ip = extract_unsigned_integer (value_contents_all (prev_ip_val),
+ prev_ip = extract_unsigned_integer (value_contents_all (prev_ip_val).data (),
8, byte_order);
if (prev_ip == 0)
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC)
{
gdb_byte val_buf[8];
- ULONGEST faddr = extract_unsigned_integer (value_contents (arg),
- 8, byte_order);
+ ULONGEST faddr = extract_unsigned_integer
+ (value_contents (arg).data (), 8, byte_order);
store_unsigned_integer (val_buf, 8, byte_order,
find_func_descr (regcache, faddr,
&funcdescaddr));
This is why we use store_unsigned_integer. */
store_unsigned_integer
(val_buf, 8, byte_order,
- extract_unsigned_integer (value_contents (arg), len,
+ extract_unsigned_integer (value_contents (arg).data (), len,
byte_order));
}
else
In this case, the data is Byte0-aligned. Happy news,
this means that we don't need to differentiate the
handling of 8byte blocks and less-than-8bytes blocks. */
- memcpy (val_buf, value_contents (arg) + argoffset,
+ memcpy (val_buf, value_contents (arg).data () + argoffset,
(len > 8) ? 8 : len);
}
while (len > 0 && floatreg < IA64_FR16_REGNUM)
{
gdb_byte to[IA64_FP_REGISTER_SIZE];
- target_float_convert (value_contents (arg) + argoffset,
+ target_float_convert (value_contents (arg).data () + argoffset,
float_elt_type, to,
ia64_ext_type (gdbarch));
regcache->cooked_write (floatreg, to);
{
retval = allocate_value (ri->value_type);
read_value_memory (retval, 0, 1, ri->struct_addr,
- value_contents_raw (retval),
+ value_contents_raw (retval).data (),
TYPE_LENGTH (ri->value_type));
}
}
retval = allocate_value (ri->value_type);
gdbarch_return_value (ri->gdbarch, ri->function, ri->value_type,
get_current_regcache (),
- value_contents_raw (retval), NULL);
+ value_contents_raw (retval).data (), NULL);
if (stack_temporaries && class_or_union_p (ri->value_type))
{
/* Values of class type returned in registers are copied onto
if (info.trivially_copy_constructible)
{
int length = TYPE_LENGTH (param_type);
- write_memory (addr, value_contents (args[i]), length);
+ write_memory (addr, value_contents (args[i]).data (), length);
}
else
{
case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
value = allocate_value (value_type);
gdbarch_return_value (gdbarch, function, value_type, stop_regs,
- value_contents_raw (value), NULL);
+ value_contents_raw (value).data (), NULL);
break;
case RETURN_VALUE_STRUCT_CONVENTION:
value = NULL;
|| regtype->code () == TYPE_CODE_DECFLOAT)
{
struct value_print_options opts;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
enum bfd_endian byte_order = type_byte_order (regtype);
get_user_print_options (&opts);
target_read (current_inferior ()->top_target (),
TARGET_OBJECT_SIGNAL_INFO,
NULL,
- value_contents_all_raw (v),
+ value_contents_all_raw (v).data (),
value_offset (v),
TYPE_LENGTH (value_type (v)));
transferred = target_write (current_inferior ()->top_target (),
TARGET_OBJECT_SIGNAL_INFO,
NULL,
- value_contents_all_raw (fromval),
+ value_contents_all_raw (fromval).data (),
value_offset (v),
TYPE_LENGTH (value_type (fromval)));
{
type = value_type (args[i]);
typelen = TYPE_LENGTH (type);
- val = value_contents (args[i]);
+ val = value_contents (args[i]).data ();
if (typelen <= 4)
{
/* Char, short, int, float, pointer, and structs <= four bytes. */
/* FIXME: Handle structures. */
- contents = (gdb_byte *) value_contents (arg);
+ contents = (gdb_byte *) value_contents (arg).data ();
val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type),
byte_order);
struct value *val;
struct type *type = check_typedef (value_type (value));
- const gdb_byte *valaddr = value_contents_for_printing (value);
+ const gdb_byte *valaddr = value_contents_for_printing (value).data ();
addr = unpack_pointer (type->field (0).type (),
(TYPE_FIELD_BITPOS (type, 0) / 8) +
unsigned len;
struct type *elttype;
CORE_ADDR addr;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
const CORE_ADDR address = value_address (val);
struct type *type = check_typedef (value_type (val));
for (i = nargs - 1; i >= 0; i--)
{
struct value *arg = args[i];
- const gdb_byte *arg_bits = value_contents (arg);
+ const gdb_byte *arg_bits = value_contents (arg).data ();
struct type *arg_type = value_type (arg);
ULONGEST arg_size = TYPE_LENGTH (arg_type);
{
/* Value gets right-justified in the register or stack word. */
memcpy (valbuf + (register_size (gdbarch, argreg) - len),
- (gdb_byte *) value_contents (args[argnum]), len);
+ (gdb_byte *) value_contents (args[argnum]).data (), len);
val = valbuf;
}
else
- val = (gdb_byte *) value_contents (args[argnum]);
+ val = (gdb_byte *) value_contents (args[argnum]).data ();
while (len > 0)
{
{
ULONGEST v;
- v = extract_unsigned_integer (value_contents (args[0]),
+ v = extract_unsigned_integer (value_contents (args[0]).data (),
TYPE_LENGTH (type), byte_order);
first_stack_argnum = 1;
sp--;
write_memory (sp, &zero, 1);
}
- val = value_contents (args[argnum]);
+ val = value_contents (args[argnum]).data ();
sp -= TYPE_LENGTH (type);
write_memory (sp, val, TYPE_LENGTH (type));
}
else
offset = container_len - len;
sp -= container_len;
- write_memory (sp + offset, value_contents_all (args[i]), len);
+ write_memory (sp + offset, value_contents_all (args[i]).data (), len);
}
/* Store struct value address. */
/* Reserve space for the copy, and then round the SP down, to
make sure it's all aligned properly. */
sp = (sp - arg_len) & -4;
- write_memory (sp, value_contents (argv[i]), arg_len);
+ write_memory (sp, value_contents (argv[i]).data (), arg_len);
copy[i] = sp;
}
}
/* Arguments that fit in a GPR get expanded to fill the GPR. */
if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE)
- value = extract_unsigned_integer (value_contents (argv[i]),
+ value = extract_unsigned_integer (value_contents (argv[i]).data (),
TYPE_LENGTH (value_type (argv[i])),
byte_order);
fprintf_unfiltered (gdb_stdlog, " push");
}
else
- val = value_contents (arg);
+ val = value_contents (arg).data ();
/* 32-bit ABIs always start floating point arguments in an
even-numbered floating point register. Round the FP register
"mips_n32n64_push_dummy_call: %d len=%d type=%d",
argnum + 1, len, (int) typecode);
- val = value_contents (arg);
+ val = value_contents (arg).data ();
/* A 128-bit long double value requires an even-odd pair of
floating-point registers. */
"mips_o32_push_dummy_call: %d len=%d type=%d",
argnum + 1, len, (int) typecode);
- val = value_contents (arg);
+ val = value_contents (arg).data ();
/* 32-bit ABIs always start floating point arguments in an
even-numbered floating point register. Round the FP register
"mips_o64_push_dummy_call: %d len=%d type=%d",
argnum + 1, len, (int) typecode);
- val = value_contents (arg);
+ val = value_contents (arg).data ();
/* Floating point arguments passed in registers have to be
treated specially. On 32-bit architectures, doubles are
col++;
continue;
}
- raw_buffer = value_contents_all (value);
+ raw_buffer = value_contents_all (value).data ();
/* pad small registers */
for (byte = 0;
byte < (mips_abi_regsize (gdbarch)
else
{
arg_len = TYPE_LENGTH (value_type (*args));
- val = value_contents (*args);
+ val = value_contents (*args).data ();
}
while (regs_used < 2 && arg_len > 0)
for (i = 0; i < nargs; i++)
{
struct value *arg = args[i];
- const gdb_byte *arg_bits = value_contents_all (arg);
+ const gdb_byte *arg_bits = value_contents_all (arg).data ();
struct type *arg_type = check_typedef (value_type (arg));
ULONGEST arg_size = TYPE_LENGTH (arg_type);
int offset;
calling_use_fpr = nds32_check_calling_use_fpr (type);
len = TYPE_LENGTH (type);
align = type_align (type);
- val = value_contents (args[i]);
+ val = value_contents (args[i]).data ();
/* The size of a composite type larger than 4 bytes will be rounded
up to the nearest multiple of 4. */
struct type *arg_type = check_typedef (value_type (arg));
int len = TYPE_LENGTH (arg_type);
- val = value_contents (arg);
+ val = value_contents (arg).data ();
/* Copy the argument to general registers or the stack in
register-sized pieces. Large arguments are split between
gdb_assert (n <= c->n);
for (i = offset; i < n; i++)
- memcpy (value_contents_raw (v) + j++ * elsize,
- value_contents (c->val) + c->indices[i] * elsize,
+ memcpy (value_contents_raw (v).data () + j++ * elsize,
+ value_contents (c->val).data () + c->indices[i] * elsize,
elsize);
}
struct value *from_elm_val = allocate_value (eltype);
struct value *to_elm_val = value_subscript (c->val, c->indices[i]);
- memcpy (value_contents_writeable (from_elm_val),
- value_contents (fromval) + j++ * elsize,
+ memcpy (value_contents_writeable (from_elm_val).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)
+ memcpy (value_contents_writeable (ret).data ()
+ (i * TYPE_LENGTH (elm_type)),
- value_contents (val)
+ value_contents (val).data ()
+ (indices[i] * TYPE_LENGTH (elm_type)),
TYPE_LENGTH (elm_type));
}
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) + i * TYPE_LENGTH (eltype),
+ memset ((value_contents_writeable (ret).data ()
+ + i * TYPE_LENGTH (eltype)),
tmp, TYPE_LENGTH (eltype));
}
}
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) + i * TYPE_LENGTH (eltype1),
+ memset ((value_contents_writeable (ret).data ()
+ + i * TYPE_LENGTH (eltype1)),
tmp, TYPE_LENGTH (eltype1));
}
{
tmp = value_logical_not (value_subscript (arg1, i)) ?
value_subscript (arg3, i) : value_subscript (arg2, i);
- memcpy (value_contents_writeable (ret) +
- i * TYPE_LENGTH (eltype2), value_contents_all (tmp),
+ memcpy (value_contents_writeable (ret).data () +
+ i * TYPE_LENGTH (eltype2), value_contents_all (tmp).data (),
TYPE_LENGTH (eltype2));
}
heap_offset += align_up (len, bpw);
valaddr = heap_sp + heap_offset;
- write_memory (valaddr, value_contents (arg), len);
+ write_memory (valaddr, value_contents (arg).data (), len);
}
/* The ABI passes all structures by reference, so get its
else
{
/* Everything else, we just get the value. */
- val = value_contents (arg);
+ val = value_contents (arg).data ();
}
/* Stick the value in a register. */
val = valbuf;
}
else
- val = value_contents (arg);
+ val = value_contents (arg).data ();
while (len > 0)
{
struct type *char_type;
CORE_ADDR addr;
int want_space = 0;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
switch (type->code ())
{
{
struct obstack tmp_obstack = dont_print_statmem_obstack;
int fields_seen = 0;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
if (dont_print_statmem == 0)
{
struct value *arg = args[argno];
struct type *type = check_typedef (value_type (arg));
int len = TYPE_LENGTH (type);
- const bfd_byte *val = value_contents (arg);
+ const bfd_byte *val = value_contents (arg).data ();
if (type->code () == TYPE_CODE_FLT && len <= 8
&& !tdep->soft_float)
{
struct value *arg = args[argno];
struct type *type = check_typedef (value_type (arg));
- const bfd_byte *val = value_contents (arg);
+ const bfd_byte *val = value_contents (arg).data ();
if (type->code () == TYPE_CODE_COMPLEX)
{
null terminated) to be printed without problems. */
gdb_byte *tem_str = (gdb_byte *) alloca (len + 1);
- memcpy (tem_str, value_contents (value), len);
+ memcpy (tem_str, value_contents (value).data (), len);
tem_str [len] = 0;
str = tem_str;
}
if (VALUE_LVAL (value) == lval_internalvar
&& c_is_string_type_p (value_type (value)))
{
- str = value_contents (value);
+ str = value_contents (value).data ();
len = TYPE_LENGTH (value_type (value));
}
else
{
param_type = float_type_from_length (param_type);
if (param_type != value_type (value))
- value = value_from_contents (param_type, value_contents (value));
+ value = value_from_contents (param_type,
+ value_contents (value).data ());
}
value = value_cast (fmt_type, value);
/* Convert the value to a string and print it. */
std::string str
- = target_float_to_string (value_contents (value), fmt_type, format);
+ = target_float_to_string (value_contents (value).data (), fmt_type, format);
fputs_filtered (str.c_str (), stream);
}
|| valtype->code () != TYPE_CODE_INT)
error (_("expected wchar_t argument for %%lc"));
- bytes = value_contents (val_args[i]);
+ bytes = value_contents (val_args[i]).data ();
auto_obstack output;
else if (gdbpy_is_value_object (handle_obj))
{
struct value *val = value_object_to_value (handle_obj);
- bytes = value_contents_all (val);
+ bytes = value_contents_all (val).data ();
bytes_len = TYPE_LENGTH (value_type (val));
}
else
if ((value = value_object_to_value (pyo_value)) != NULL)
{
*addr = unpack_pointer (value_type (value),
- value_contents (value));
+ value_contents (value).data ());
rc = 1;
}
}
gdb_assert (data_size == TYPE_LENGTH (value_type (value)));
cached_frame->reg[i].data = (gdb_byte *) xmalloc (data_size);
- memcpy (cached_frame->reg[i].data, value_contents (value), data_size);
+ memcpy (cached_frame->reg[i].data,
+ value_contents (value).data (), data_size);
}
}
if (is_integral_type (type) || type->code () == TYPE_CODE_PTR)
nonzero = !!value_as_long (self_value->value);
else if (is_floating_value (self_value->value))
- nonzero = !target_float_is_zero (value_contents (self_value->value),
- type);
+ nonzero = !target_float_is_zero
+ (value_contents (self_value->value).data (), type);
else
/* All other values are True. */
nonzero = 1;
type = check_typedef (type);
if (type->code () == TYPE_CODE_FLT && is_floating_value (value))
- d = target_float_to_host_double (value_contents (value), type);
+ d = target_float_to_host_double (value_contents (value).data (), type);
else if (type->code () == TYPE_CODE_INT)
{
/* Note that valpy_long accepts TYPE_CODE_PTR and some
computed = gdbarch_pseudo_register_read_value (m_descr->gdbarch,
this, regnum);
if (value_entirely_available (computed))
- memcpy (buf, value_contents_raw (computed),
+ memcpy (buf, value_contents_raw (computed).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)) == REG_UNAVAILABLE)
+ value_contents_raw (result).data ()) == REG_UNAVAILABLE)
mark_value_bytes_unavailable (result, 0,
TYPE_LENGTH (value_type (result)));
&& regtype->field (2).type ()->code () == TYPE_CODE_FLT))
{
struct value_print_options opts;
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
enum bfd_endian byte_order = type_byte_order (regtype);
get_user_print_options (&opts);
if (info->type != arg_type)
arg_value = value_cast (info->type, arg_value);
- info->contents = value_contents (arg_value);
+ info->contents = value_contents (arg_value).data ();
}
/* Adjust the stack pointer and align it. */
{
struct value *arg_val = value_from_contents (arg_type, writebuf);
abi_val = value_cast (info.type, arg_val);
- writebuf = value_contents_raw (abi_val);
+ writebuf = value_contents_raw (abi_val).data ();
}
else
{
abi_val = allocate_value (info.type);
old_readbuf = readbuf;
- readbuf = value_contents_raw (abi_val);
+ readbuf = value_contents_raw (abi_val).data ();
}
arg_len = TYPE_LENGTH (info.type);
if (readbuf != nullptr)
{
struct value *arg_val = value_cast (arg_type, abi_val);
- memcpy (old_readbuf, value_contents_raw (arg_val),
+ memcpy (old_readbuf, value_contents_raw (arg_val).data (),
TYPE_LENGTH (arg_type));
}
}
sp -= container_len;
write_memory (rl78_make_data_address (sp),
- value_contents_all (args[i]), len);
+ value_contents_all (args[i]).data (), len);
}
/* Store struct value address. */
gdb_assert (len <= 8);
- target_float_convert (value_contents (arg), type, reg_val, reg_type);
+ target_float_convert (value_contents (arg).data (), type, reg_val,
+ reg_type);
regcache->cooked_write (fp_regnum, reg_val);
++f_argno;
}
gdb_byte word[PPC_MAX_REGISTER_SIZE];
memset (word, 0, reg_size);
memcpy (word,
- ((char *) value_contents (arg)) + argbytes,
+ ((char *) value_contents (arg).data ()) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
gdb_byte word[PPC_MAX_REGISTER_SIZE];
memset (word, 0, reg_size);
- memcpy (word, value_contents (arg), len);
+ memcpy (word, value_contents (arg).data (), len);
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
}
++argno;
if (argbytes)
{
write_memory (sp + 24 + (ii * 4),
- value_contents (arg) + argbytes,
+ value_contents (arg).data () + argbytes,
len - argbytes);
++argno;
ii += ((len - argbytes + 3) & -4) / 4;
gdb_assert (len <= 8);
regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
- value_contents (arg));
+ value_contents (arg).data ());
++f_argno;
}
- write_memory (sp + 24 + (ii * 4), value_contents (arg), len);
+ write_memory (sp + 24 + (ii * 4), value_contents (arg).data (), len);
ii += ((len + 3) & -4) / 4;
}
}
gdb_assert (len <= 8);
- target_float_convert (value_contents (arg), type, reg_val, reg_type);
+ target_float_convert (value_contents (arg).data (), type, reg_val,
+ reg_type);
regcache->cooked_write (fp_regnum, reg_val);
++f_argno;
}
gdb_byte word[PPC_MAX_REGISTER_SIZE];
memset (word, 0, reg_size);
memcpy (word,
- ((char *) value_contents (arg)) + argbytes,
+ ((char *) value_contents (arg).data ()) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
gdb_byte word[PPC_MAX_REGISTER_SIZE];
memset (word, 0, reg_size);
- memcpy (word, value_contents (arg), len);
+ memcpy (word, value_contents (arg).data (), len);
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
}
++argno;
if (argbytes)
{
write_memory (sp + 24 + (ii * 4),
- value_contents (arg) + argbytes,
+ value_contents (arg).data () + argbytes,
len - argbytes);
++argno;
ii += align_up (len - argbytes, 4) / 4;
gdb_assert (len <= 8);
regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
- value_contents (arg));
+ value_contents (arg).data ());
++f_argno;
}
- write_memory (sp + 24 + (ii * 4), value_contents (arg), len);
+ write_memory (sp + 24 + (ii * 4), value_contents (arg).data (), len);
ii += align_up (len, 4) / 4;
}
}
opts.deref_ref = 0;
gdb_assert (rust_enum_p (type));
- gdb::array_view<const gdb_byte> view (value_contents_for_printing (val),
- TYPE_LENGTH (value_type (val)));
+ gdb::array_view<const gdb_byte> view
+ (value_contents_for_printing (val).data (),
+ TYPE_LENGTH (value_type (val)));
type = resolve_dynamic_type (type, view, value_address (val));
if (rust_empty_enum_p (type))
encoding. */
fputs_filtered ("b", stream);
printstr (stream, TYPE_TARGET_TYPE (type),
- value_contents_for_printing (val),
+ value_contents_for_printing (val).data (),
high_bound - low_bound + 1, "ASCII", 0, &opts);
}
break;
if (rust_enum_p (type))
{
- gdb::array_view<const gdb_byte> view (value_contents (lhs),
+ gdb::array_view<const gdb_byte> view (value_contents (lhs).data (),
TYPE_LENGTH (type));
type = resolve_dynamic_type (type, view, value_address (lhs));
struct type *type = value_type (lhs);
if (type->code () == TYPE_CODE_STRUCT && rust_enum_p (type))
{
- gdb::array_view<const gdb_byte> view (value_contents (lhs),
+ gdb::array_view<const gdb_byte> view (value_contents (lhs).data (),
TYPE_LENGTH (type));
type = resolve_dynamic_type (type, view, value_address (lhs));
psw_val = rx_frame_prev_register (this_frame, this_cache,
RX_PSW_REGNUM);
- psw = extract_unsigned_integer (value_contents_all (psw_val), 4,
- gdbarch_byte_order (
- get_frame_arch (this_frame)));
+ psw = extract_unsigned_integer
+ (value_contents_all (psw_val).data (), 4,
+ gdbarch_byte_order (get_frame_arch (this_frame)));
if ((psw & 0x20000 /* U bit */) != 0)
return rx_frame_prev_register (this_frame, this_cache,
for (i = 0; i < nargs; i++)
{
struct value *arg = args[i];
- const gdb_byte *arg_bits = value_contents_all (arg);
+ const gdb_byte *arg_bits = value_contents_all (arg).data ();
struct type *arg_type = check_typedef (value_type (arg));
ULONGEST arg_size = TYPE_LENGTH (arg_type);
it occupies the leftmost bits. */
if (write_mode)
as->regcache->cooked_write_part (S390_F0_REGNUM + as->fr, 0, length,
- value_contents (arg));
+ value_contents (arg).data ());
as->fr += 2;
}
else
it occupies the rightmost bits. */
as->argp = align_up (as->argp + length, word_size);
if (write_mode)
- write_memory (as->argp - length, value_contents (arg),
+ write_memory (as->argp - length, value_contents (arg).data (),
length);
}
}
if (write_mode)
as->regcache->cooked_write_part (regnum, 0, length,
- value_contents (arg));
+ value_contents (arg).data ());
as->vr++;
}
else
{
if (write_mode)
- write_memory (as->argp, value_contents (arg), length);
+ write_memory (as->argp, value_contents (arg).data (), length);
as->argp = align_up (as->argp + length, word_size);
}
}
memory word and sign- or zero-extend to full word size.
This also applies to a struct or union. */
val = type->is_unsigned ()
- ? extract_unsigned_integer (value_contents (arg),
+ ? extract_unsigned_integer (value_contents (arg).data (),
length, byte_order)
- : extract_signed_integer (value_contents (arg),
+ : extract_signed_integer (value_contents (arg).data (),
length, byte_order);
}
if (write_mode)
{
as->regcache->cooked_write (S390_R0_REGNUM + as->gr,
- value_contents (arg));
- as->regcache->cooked_write (S390_R0_REGNUM + as->gr + 1,
- value_contents (arg) + word_size);
+ value_contents (arg).data ());
+ as->regcache->cooked_write
+ (S390_R0_REGNUM + as->gr + 1,
+ value_contents (arg).data () + word_size);
}
as->gr += 2;
}
as->gr = 7;
if (write_mode)
- write_memory (as->argp, value_contents (arg), length);
+ write_memory (as->argp, value_contents (arg).data (), length);
as->argp += length;
}
}
alignment as a conservative assumption. */
as->copy = align_down (as->copy - length, 8);
if (write_mode)
- write_memory (as->copy, value_contents (arg), length);
+ write_memory (as->copy, value_contents (arg).data (), length);
if (as->gr <= 6)
{
struct value *arg = args[argnum];
struct type *arg_type = check_typedef (value_type (arg));
enum type_code typecode = arg_type->code ();
- const gdb_byte *val = value_contents (arg);
+ const gdb_byte *val = value_contents (arg).data ();
int downward_offset = 0;
int arg_last_part_p = 0;
{
/* value gets right-justified in the register or stack word. */
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
- memcpy (valbuf + (4 - len), value_contents (val), len);
+ memcpy (valbuf + (4 - len), value_contents (val).data (), len);
else
- memcpy (valbuf, value_contents (val), len);
+ memcpy (valbuf, value_contents (val).data (), len);
return valbuf;
}
- return value_contents (val);
+ return value_contents (val).data ();
}
/* Helper function to eval number of bytes to allocate on stack. */
correct, and wasting a few bytes shouldn't be a problem. */
sp &= ~0x7;
- write_memory (sp, value_contents (args[i]), len);
+ write_memory (sp, value_contents (args[i]).data (), len);
args[i] = value_from_pointer (lookup_pointer_type (type), sp);
num_elements++;
}
for (i = 0; i < nargs; i++)
{
- const bfd_byte *valbuf = value_contents (args[i]);
+ const bfd_byte *valbuf = value_contents (args[i]).data ();
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
gdb_byte buf[4];
a problem. */
sp &= ~0xf;
- write_memory (sp, value_contents (args[i]), len);
+ write_memory (sp, value_contents (args[i]).data (), len);
args[i] = value_from_pointer (lookup_pointer_type (type), sp);
num_elements++;
}
for (i = 0; i < nargs; i++)
{
- const gdb_byte *valbuf = value_contents (args[i]);
+ const gdb_byte *valbuf = value_contents (args[i]).data ();
struct type *type = value_type (args[i]);
int len = TYPE_LENGTH (type);
int regnum = -1;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int sp_size = register_size (gdbarch, sp_regnum);
- sp = extract_unsigned_integer (value_contents_all (value),
- sp_size, byte_order);
+ sp = extract_unsigned_integer
+ (value_contents_all (value).data (), sp_size, byte_order);
printf_filtered (" Previous frame's sp is ");
fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
&& rv_conv != RETURN_VALUE_ABI_RETURNS_ADDRESS);
gdbarch_return_value (cache_arch, function, return_type,
get_current_regcache (), NULL /*read*/,
- value_contents (return_value) /*write*/);
+ value_contents (return_value).data () /*write*/);
}
/* If we are at the end of a call dummy now, pop the dummy frame
{
struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
struct value *val = allocate_value (data_ptr_type);
- gdb_byte *buf = value_contents_raw (val);
+ gdb_byte *buf = value_contents_raw (val).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 = allocate_value (func_ptr_type);
- gdb_byte *buf = value_contents_raw (val);
+ gdb_byte *buf = value_contents_raw (val).data ();
gdbarch_address_to_pointer (gdbarch, func_ptr_type,
buf, get_frame_pc (frame));
int len = TYPE_LENGTH (arg_type);
enum type_code typecode = arg_type->code ();
- val = value_contents (arg);
+ val = value_contents (arg).data ();
/* Copy the argument to general registers or the stack in
register-sized pieces. */
break;
/* Put argument into registers wordwise. */
- val = value_contents (args[i]);
+ val = value_contents (args[i]).data ();
for (j = 0; j < typelen; j += tilegx_reg_size)
{
/* ISSUE: Why special handling for "typelen = 4x + 1"?
the stack, word aligned. */
for (j = nargs - 1; j >= i; j--)
{
- const gdb_byte *contents = value_contents (args[j]);
+ const gdb_byte *contents = value_contents (args[j]).data ();
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
slacklen = align_up (typelen, 8) - typelen;
type = init_vector_type (builtin_type (gdbarch)->builtin_true_char,
buf->size ());
v = allocate_value (type);
- memcpy (value_contents_raw (v), buf->data (), buf->size ());
+ memcpy (value_contents_raw (v).data (), buf->data (), buf->size ());
return v;
}
else
else
{
len = TYPE_LENGTH (value_type (*args));
- val = (gdb_byte *) value_contents (*args);
+ val = (gdb_byte *) value_contents (*args).data ();
}
if (gdbarch_tdep (gdbarch)->eight_byte_align
char_type = type2;
inchar = (char) unpack_long (type2,
- value_contents (inval2));
+ value_contents (inval2).data ());
for (idx = 0; idx < count; idx++)
{
ptr[idx] = inchar;
char_type = TYPE_TARGET_TYPE (type2);
for (idx = 0; idx < count; idx++)
- {
- memcpy (&ptr[idx * inval2len], value_contents (inval2),
- inval2len);
- }
+ memcpy (&ptr[idx * inval2len], value_contents (inval2).data (),
+ inval2len);
}
outval = value_string (ptr.data (), count * inval2len, char_type);
}
{
char_type = type1;
- ptr[0] = (char) unpack_long (type1, value_contents (inval1));
+ ptr[0] = (char) unpack_long (type1, value_contents (inval1).data ());
}
else
{
char_type = TYPE_TARGET_TYPE (type1);
- memcpy (ptr.data (), value_contents (inval1), inval1len);
+ memcpy (ptr.data (), value_contents (inval1).data (), inval1len);
}
if (type2->code () == TYPE_CODE_CHAR)
{
ptr[inval1len] =
- (char) unpack_long (type2, value_contents (inval2));
+ (char) unpack_long (type2, value_contents (inval2).data ());
}
else
{
- memcpy (&ptr[inval1len], value_contents (inval2), inval2len);
+ memcpy (&ptr[inval1len], value_contents (inval2).data (), inval2len);
}
outval = value_string (ptr.data (), inval1len + inval2len, char_type);
}
if (is_floating_type (type1))
{
*eff_type_x = type1;
- memcpy (x, value_contents (arg1), TYPE_LENGTH (type1));
+ memcpy (x, value_contents (arg1).data (), TYPE_LENGTH (type1));
}
else if (is_integral_type (type1))
{
if (is_floating_type (type2))
{
*eff_type_y = type2;
- memcpy (y, value_contents (arg2), TYPE_LENGTH (type2));
+ memcpy (y, value_contents (arg2).data (), TYPE_LENGTH (type2));
}
else if (is_integral_type (type2))
{
type2 = type1;
}
- v1.read_fixed_point (gdb::make_array_view (value_contents (arg1),
+ v1.read_fixed_point (gdb::make_array_view (value_contents (arg1).data (),
TYPE_LENGTH (type1)),
type_byte_order (type1), type1->is_unsigned (),
type1->fixed_point_scaling_factor ());
- v2.read_fixed_point (gdb::make_array_view (value_contents (arg2),
+ v2.read_fixed_point (gdb::make_array_view (value_contents (arg2).data (),
TYPE_LENGTH (type2)),
type_byte_order (type2), type2->is_unsigned (),
type2->fixed_point_scaling_factor ());
value *fp_val = allocate_value (type1);
fp.write_fixed_point
- (gdb::make_array_view (value_contents_raw (fp_val),
+ (gdb::make_array_view (value_contents_raw (fp_val).data (),
TYPE_LENGTH (type1)),
type_byte_order (type1),
type1->is_unsigned (),
v2.data (), &eff_type_v2);
target_float_binop (op, v1.data (), eff_type_v1,
v2.data (), eff_type_v2,
- value_contents_raw (val), result_type);
+ value_contents_raw (val).data (), result_type);
}
else if (type1->code () == TYPE_CODE_BOOL
|| type2->code () == TYPE_CODE_BOOL)
result_type = type1;
val = allocate_value (result_type);
- store_signed_integer (value_contents_raw (val),
+ store_signed_integer (value_contents_raw (val).data (),
TYPE_LENGTH (result_type),
type_byte_order (result_type),
v);
}
val = allocate_value (result_type);
- store_unsigned_integer (value_contents_raw (val),
+ store_unsigned_integer (value_contents_raw (val).data (),
TYPE_LENGTH (value_type (val)),
type_byte_order (result_type),
v);
}
val = allocate_value (result_type);
- store_signed_integer (value_contents_raw (val),
+ store_signed_integer (value_contents_raw (val).data (),
TYPE_LENGTH (value_type (val)),
type_byte_order (result_type),
v);
val = allocate_value (vector_type);
for (i = 0; i < high_bound - low_bound + 1; i++)
/* Duplicate the contents of elval into the destination vector. */
- memcpy (value_contents_writeable (val) + (i * TYPE_LENGTH (eltype)),
- value_contents_all (elval), TYPE_LENGTH (eltype));
+ memcpy (value_contents_writeable (val).data () + (i * TYPE_LENGTH (eltype)),
+ value_contents_all (elval).data (), TYPE_LENGTH (eltype));
return val;
}
{
tmp = value_binop (value_subscript (val1, i),
value_subscript (val2, i), op);
- memcpy (value_contents_writeable (val) + i * elsize,
- value_contents_all (tmp),
+ memcpy (value_contents_writeable (val).data () + i * elsize,
+ value_contents_all (tmp).data (),
elsize);
}
value_free_to_mark (mark);
type1 = check_typedef (value_type (arg1));
if (is_floating_value (arg1))
- return target_float_is_zero (value_contents (arg1), type1);
+ return target_float_is_zero (value_contents (arg1).data (), type1);
len = TYPE_LENGTH (type1);
- p = value_contents (arg1);
+ p = value_contents (arg1).data ();
while (--len >= 0)
{
{
int len1 = TYPE_LENGTH (value_type (arg1));
int len2 = TYPE_LENGTH (value_type (arg2));
- const gdb_byte *s1 = value_contents (arg1);
- const gdb_byte *s2 = value_contents (arg2);
+ const gdb_byte *s1 = value_contents (arg1).data ();
+ const gdb_byte *s2 = value_contents (arg2).data ();
int i, len = len1 < len2 ? len1 : len2;
for (i = 0; i < len; i++)
&& ((len = (int) TYPE_LENGTH (type1))
== (int) TYPE_LENGTH (type2)))
{
- p1 = value_contents (arg1);
- p2 = value_contents (arg2);
+ p1 = value_contents (arg1).data ();
+ p2 = value_contents (arg2).data ();
while (--len >= 0)
{
if (*p1++ != *p2++)
return (type1->code () == type2->code ()
&& TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
- && memcmp (value_contents (arg1), value_contents (arg2),
+ && memcmp (value_contents (arg1).data (),
+ value_contents (arg2).data (),
TYPE_LENGTH (type1)) == 0);
}
if (is_integral_type (type) || is_floating_value (arg1)
|| (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
|| type->code () == TYPE_CODE_COMPLEX)
- return value_from_contents (type, value_contents (arg1));
+ return value_from_contents (type, value_contents (arg1).data ());
else
error (_("Argument to positive operation not a number."));
}
for (i = 0; i < high_bound - low_bound + 1; i++)
{
tmp = value_neg (value_subscript (arg1, i));
- memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
- value_contents_all (tmp), TYPE_LENGTH (eltype));
+ memcpy ((value_contents_writeable (val).data ()
+ + i * TYPE_LENGTH (eltype)),
+ value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
}
return val;
}
for (i = 0; i < high_bound - low_bound + 1; i++)
{
tmp = value_complement (value_subscript (arg1, i));
- memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
- value_contents_all (tmp), TYPE_LENGTH (eltype));
+ memcpy ((value_contents_writeable (val).data ()
+ + i * TYPE_LENGTH (eltype)),
+ value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
}
}
else if (type->code () == TYPE_CODE_COMPLEX)
&& eltype->code () != TYPE_CODE_ENUM
&& eltype->code () != TYPE_CODE_BOOL)
error (_("First argument of 'IN' has wrong type"));
- member = value_bit_index (settype, value_contents (set),
+ member = value_bit_index (settype, value_contents (set).data (),
value_as_long (element));
if (member < 0)
error (_("First argument of 'IN' not in range"));
gdb_mpq result;
if (is_floating_type (type))
{
- double d = target_float_to_host_double (value_contents (value),
+ double d = target_float_to_host_double (value_contents (value).data (),
type);
mpq_set_d (result.val, d);
}
|| is_fixed_point_type (type));
gdb_mpz vz;
- vz.read (gdb::make_array_view (value_contents (value),
+ vz.read (gdb::make_array_view (value_contents (value).data (),
TYPE_LENGTH (type)),
type_byte_order (type), type->is_unsigned ());
mpq_set_z (result.val, vz.val);
/* Finally, create the result value, and pack the unscaled value
in it. */
struct value *result = allocate_value (to_type);
- unscaled.write (gdb::make_array_view (value_contents_raw (result),
+ unscaled.write (gdb::make_array_view (value_contents_raw (result).data (),
TYPE_LENGTH (to_type)),
type_byte_order (to_type),
to_type->is_unsigned ());
if (is_floating_value (arg2))
{
struct value *v = allocate_value (to_type);
- target_float_convert (value_contents (arg2), type2,
- value_contents_raw (v), type);
+ target_float_convert (value_contents (arg2).data (), type2,
+ value_contents_raw (v).data (), type);
return v;
}
else if (is_fixed_point_type (type2))
gdb_mpq fp_val;
fp_val.read_fixed_point
- (gdb::make_array_view (value_contents (arg2), TYPE_LENGTH (type2)),
+ (gdb::make_array_view (value_contents (arg2).data (),
+ TYPE_LENGTH (type2)),
type_byte_order (type2), type2->is_unsigned (),
type2->fixed_point_scaling_factor ());
struct value *v = allocate_value (to_type);
- target_float_from_host_double (value_contents_raw (v),
+ target_float_from_host_double (value_contents_raw (v).data (),
to_type, mpq_get_d (fp_val.val));
return v;
}
bits. */
if (code2 == TYPE_CODE_PTR)
longest = extract_unsigned_integer
- (value_contents (arg2), TYPE_LENGTH (type2),
+ (value_contents (arg2).data (), TYPE_LENGTH (type2),
type_byte_order (type2));
else
longest = value_as_long (arg2);
{
struct value *result = allocate_value (to_type);
- cplus_make_method_ptr (to_type, value_contents_writeable (result), 0, 0);
+ cplus_make_method_ptr (to_type,
+ value_contents_writeable (result).data (), 0, 0);
return result;
}
else if (code1 == TYPE_CODE_MEMBERPTR && code2 == TYPE_CODE_INT
return tem;
result = NULL;
if (dynamic_cast_check_1 (TYPE_TARGET_TYPE (resolved_type),
- value_contents_for_printing (tem),
+ value_contents_for_printing (tem).data (),
value_embedded_offset (tem),
value_address (tem), tem,
rtti_type, addr,
result = NULL;
if (is_public_ancestor (arg_type, rtti_type)
&& dynamic_cast_check_2 (TYPE_TARGET_TYPE (resolved_type),
- value_contents_for_printing (tem),
+ value_contents_for_printing (tem).data (),
value_embedded_offset (tem),
value_address (tem), tem,
rtti_type, &result) == 1)
for (i = 0; i < high_bound - low_bound + 1; i++)
{
tmp = value_one (eltype);
- memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
- value_contents_all (tmp), TYPE_LENGTH (eltype));
+ memcpy ((value_contents_writeable (val).data ()
+ + i * TYPE_LENGTH (eltype)),
+ value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
}
}
else
{
changed_addr = value_address (toval);
changed_len = type_length_units (type);
- dest_buffer = value_contents (fromval);
+ dest_buffer = value_contents (fromval).data ();
}
write_memory_with_notification (changed_addr, dest_buffer, changed_len);
format. */
gdbarch_value_to_register (gdbarch, frame,
VALUE_REGNUM (toval), type,
- value_contents (fromval));
+ value_contents (fromval).data ());
}
else
{
gdb::array_view<const gdb_byte> contents
- = gdb::make_array_view (value_contents (fromval),
+ = gdb::make_array_view (value_contents (fromval).data (),
TYPE_LENGTH (type));
put_frame_register_bytes (frame, value_reg,
value_offset (toval),
implies the returned value is not lazy, even if TOVAL was. */
val = value_copy (toval);
set_value_lazy (val, 0);
- memcpy (value_contents_raw (val), value_contents (fromval),
+ memcpy (value_contents_raw (val).data (), value_contents (fromval).data (),
TYPE_LENGTH (type));
/* We copy over the enclosing type and pointed-to offset from FROMVAL
set_value_address (val, value_address (arg1));
read_value_memory (val, 0, value_stack (val), value_address (val),
- value_contents_all_raw (val),
+ value_contents_all_raw (val).data (),
type_length_units (value_enclosing_type (val)));
return val;
length = TYPE_LENGTH (check_typedef (value_type (val)));
addr = allocate_space_in_inferior (length);
- write_memory (addr, value_contents (val), length);
+ write_memory (addr, value_contents (val).data (), length);
return value_at_lazy (value_type (val), addr);
}
= lookup_array_range_type (char_type, lowbound, highbound + lowbound - 1);
val = allocate_value (stringtype);
- memcpy (value_contents_raw (val), ptr, len);
+ memcpy (value_contents_raw (val).data (), ptr, len);
return val;
}
= lookup_string_range_type (char_type, lowbound, highbound + lowbound - 1);
val = allocate_value (stringtype);
- memcpy (value_contents_raw (val), ptr, len);
+ memcpy (value_contents_raw (val).data (), ptr, len);
return val;
}
struct value *v2;
boffset = baseclass_offset (type, i,
- value_contents_for_printing (arg1),
+ value_contents_for_printing (arg1).data (),
value_embedded_offset (arg1) + offset,
value_address (arg1),
arg1);
base_addr = value_address (arg1) + boffset;
v2 = value_at_lazy (basetype, base_addr);
if (target_read_memory (base_addr,
- value_contents_raw (v2),
+ value_contents_raw (v2).data (),
TYPE_LENGTH (value_type (v2))) != 0)
error (_("virtual baseclass botch"));
}
base_val = value_from_contents_and_address (baseclass,
tmp.data (),
address + offset);
- base_valaddr = value_contents_for_printing (base_val);
+ base_valaddr = value_contents_for_printing (base_val).data ();
this_offset = 0;
}
else
{
base_val = *arg1p;
- base_valaddr = value_contents_for_printing (*arg1p);
+ base_valaddr = value_contents_for_printing (*arg1p).data ();
this_offset = offset;
}
if (BASETYPE_VIA_VIRTUAL (type, i))
{
base_offset = baseclass_offset (type, i,
- value_contents_for_printing (*argp),
+ value_contents_for_printing (*argp).data (),
value_offset (*argp) + offset,
value_address (*argp), *argp);
}
{
if (BASETYPE_VIA_VIRTUAL (vt, i))
{
- const gdb_byte *adr = value_contents_for_printing (v);
+ const gdb_byte *adr = value_contents_for_printing (v).data ();
*boffs = baseclass_offset (vt, i, adr, value_offset (v),
value_as_long (v), v);
*isvirt = true;
{
if (*isvirt == false) /* Add non-virtual base offset. */
{
- const gdb_byte *adr = value_contents_for_printing (v);
+ const gdb_byte *adr = value_contents_for_printing (v).data ();
*boffs += baseclass_offset (vt, i, adr, value_offset (v),
value_as_long (v), v);
}
result = allocate_value
(lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
cplus_make_method_ptr (value_type (result),
- value_contents_writeable (result),
+ value_contents_writeable (result).data (),
TYPE_FN_FIELD_VOFFSET (f, j), 1);
}
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
{
result = allocate_value (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
cplus_make_method_ptr (value_type (result),
- value_contents_writeable (result),
+ value_contents_writeable (result).data (),
value_address (v), 0);
}
}
arg1 = value_cast (real_type, arg1);
arg2 = value_cast (real_type, arg2);
- memcpy (value_contents_raw (val),
- value_contents (arg1), TYPE_LENGTH (real_type));
- memcpy (value_contents_raw (val) + TYPE_LENGTH (real_type),
- value_contents (arg2), TYPE_LENGTH (real_type));
+ memcpy (value_contents_raw (val).data (),
+ value_contents (arg1).data (), TYPE_LENGTH (real_type));
+ memcpy (value_contents_raw (val).data () + TYPE_LENGTH (real_type),
+ value_contents (arg2).data (), TYPE_LENGTH (real_type));
return val;
}
struct value *re_val = allocate_value (val_real_type);
struct value *im_val = allocate_value (val_real_type);
- memcpy (value_contents_raw (re_val),
- value_contents (val), TYPE_LENGTH (val_real_type));
- memcpy (value_contents_raw (im_val),
- value_contents (val) + TYPE_LENGTH (val_real_type),
+ memcpy (value_contents_raw (re_val).data (),
+ value_contents (val).data (), TYPE_LENGTH (val_real_type));
+ memcpy (value_contents_raw (im_val).data (),
+ value_contents (val).data () + TYPE_LENGTH (val_real_type),
TYPE_LENGTH (val_real_type));
return value_literal_complex (re_val, im_val, type);
{
struct type *type = check_typedef (value_type (val));
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
CORE_ADDR addr = unpack_pointer (type, valaddr);
print_unpacked_pointer (type, elttype, addr, stream, options);
gdb_assert (deref_val != NULL);
if (value_lval_const (deref_val) == lval_memory)
- return value_contents_for_printing_const (value_addr (deref_val));
+ return value_contents_for_printing_const (value_addr (deref_val)).data ();
else
{
/* We have a non-addressable value, such as a DW_AT_const_value. */
const int must_coerce_ref = ((options->addressprint && value_is_synthetic)
|| options->deref_ref);
const int type_is_defined = elttype->code () != TYPE_CODE_UNDEF;
- const gdb_byte *valaddr = value_contents_for_printing (original_value);
+ const gdb_byte *valaddr = value_contents_for_printing (original_value).data ();
if (must_coerce_ref && type_is_defined)
{
gdb_assert (!options->format);
- const gdb_byte *valaddr = value_contents_for_printing (original_value);
+ const gdb_byte *valaddr = value_contents_for_printing (original_value).data ();
val = unpack_long (type, valaddr + embedded_offset * unit_size);
}
else
{
- const gdb_byte *valaddr = value_contents_for_printing (value);
+ const gdb_byte *valaddr = value_contents_for_printing (value).data ();
struct type *type = check_typedef (value_type (value));
LONGEST val = unpack_long (type, valaddr);
if (val == 0)
{
struct type *unresolved_type = value_type (value);
struct type *type = check_typedef (unresolved_type);
- const gdb_byte *valaddr = value_contents_for_printing (value);
+ const gdb_byte *valaddr = value_contents_for_printing (value).data ();
LONGEST val = unpack_long (type, valaddr);
if (type->is_unsigned ())
{
gdb_assert (!options->format);
- const gdb_byte *valaddr = value_contents_for_printing (original_value);
+ const gdb_byte *valaddr = value_contents_for_printing (original_value).data ();
print_floating (valaddr, type, stream);
}
{
struct type *type = value_type (val);
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
gdb_mpf f;
f.read_fixed_point (gdb::make_array_view (valaddr, TYPE_LENGTH (type)),
/* Member pointers are essentially specific to C++, and so if we
encounter one, we should print it according to C++ rules. */
struct type *type = check_typedef (value_type (val));
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
cp_print_class_member (valaddr, type, stream, "&");
}
else
break;
case TYPE_CODE_METHODPTR:
- cplus_print_method_ptr (value_contents_for_printing (val), type,
+ cplus_print_method_ptr (value_contents_for_printing (val).data (), type,
stream);
break;
val_print_type_code_flags (struct type *type, struct value *original_value,
int embedded_offset, struct ui_file *stream)
{
- const gdb_byte *valaddr = (value_contents_for_printing (original_value)
+ const gdb_byte *valaddr = (value_contents_for_printing (original_value).data ()
+ embedded_offset);
ULONGEST val = unpack_long (type, valaddr);
int field, nfields = type->num_fields ();
/* value_contents_for_printing fetches all VAL's contents. They are
needed to check whether VAL is optimized-out or unavailable
below. */
- const gdb_byte *valaddr = value_contents_for_printing (val);
+ const gdb_byte *valaddr = value_contents_for_printing (val).data ();
/* A scalar object that does not have all bits available can't be
printed, because all bits contribute to its representation. */
append_flags_type_field (flags_type, 5, 3, field_type, "C");
value *val = allocate_value (flags_type);
- gdb_byte *contents = value_contents_writeable (val);
+ gdb_byte *contents = value_contents_writeable (val).data ();
store_unsigned_integer (contents, 4, gdbarch_byte_order (arch), 0xaa);
string_file out;
value->parent = value_ref_ptr::new_reference (parent);
}
-gdb_byte *
+gdb::array_view<gdb_byte>
value_contents_raw (struct value *value)
{
struct gdbarch *arch = get_value_arch (value);
int unit_size = gdbarch_addressable_memory_unit_size (arch);
allocate_value_contents (value);
- return value->contents.get () + value->embedded_offset * unit_size;
+
+ ULONGEST length = TYPE_LENGTH (value_type (value));
+ return {value->contents.get () + value->embedded_offset * unit_size, length};
}
-gdb_byte *
+gdb::array_view<gdb_byte>
value_contents_all_raw (struct value *value)
{
allocate_value_contents (value);
- return value->contents.get ();
+
+ ULONGEST length = TYPE_LENGTH (value_type (value));
+ return {value->contents.get (), length};
}
struct type *
throw_error (NOT_AVAILABLE_ERROR, _("value is not available"));
}
-const gdb_byte *
+gdb::array_view<const gdb_byte>
value_contents_for_printing (struct value *value)
{
if (value->lazy)
value_fetch_lazy (value);
- return value->contents.get ();
+
+ ULONGEST length = TYPE_LENGTH (value_type (value));
+ return {value->contents.get (), length};
}
-const gdb_byte *
+gdb::array_view<const gdb_byte>
value_contents_for_printing_const (const struct value *value)
{
gdb_assert (!value->lazy);
- return value->contents.get ();
+
+ ULONGEST length = TYPE_LENGTH (value_type (value));
+ return {value->contents.get (), length};
}
-const gdb_byte *
+gdb::array_view<const gdb_byte>
value_contents_all (struct value *value)
{
- const gdb_byte *result = value_contents_for_printing (value);
+ gdb::array_view<const gdb_byte> result = value_contents_for_printing (value);
require_not_optimized_out (value);
require_available (value);
return result;
TARGET_CHAR_BIT * length));
/* Copy the data. */
- memcpy (value_contents_all_raw (dst) + dst_offset * unit_size,
- value_contents_all_raw (src) + src_offset * unit_size,
+ memcpy (value_contents_all_raw (dst).data () + dst_offset * unit_size,
+ value_contents_all_raw (src).data () + src_offset * unit_size,
length * unit_size);
/* Copy the meta-data, adjusted. */
value->stack = val;
}
-const gdb_byte *
+gdb::array_view<const gdb_byte>
value_contents (struct value *value)
{
- const gdb_byte *result = value_contents_writeable (value);
+ gdb::array_view<const gdb_byte> result = value_contents_writeable (value);
require_not_optimized_out (value);
require_available (value);
return result;
}
-gdb_byte *
+gdb::array_view<gdb_byte>
value_contents_writeable (struct value *value)
{
if (value->lazy)
val->initialized = arg->initialized;
if (!value_lazy (val))
{
- memcpy (value_contents_all_raw (val), value_contents_all_raw (arg),
+ memcpy (value_contents_all_raw (val).data (),
+ value_contents_all_raw (arg).data (),
TYPE_LENGTH (value_enclosing_type (arg)));
}
struct type *enc_type = value_enclosing_type (arg);
struct value *val = allocate_value (enc_type);
- memcpy (value_contents_all_raw (val), value_contents_all (arg),
+ memcpy (value_contents_all_raw (val).data (),
+ value_contents_all (arg).data (),
TYPE_LENGTH (enc_type));
val->type = arg->type;
set_value_embedded_offset (val, value_embedded_offset (arg));
{
gdb_assert (VALUE_LVAL (v) == not_lval);
- write_memory (addr, value_contents_raw (v), TYPE_LENGTH (value_type (v)));
+ write_memory (addr, value_contents_raw (v).data (), TYPE_LENGTH (value_type (v)));
v->lval = lval_memory;
v->location.address = addr;
}
switch (var->kind)
{
case INTERNALVAR_VALUE:
- addr = value_contents_writeable (var->u.value);
+ addr = value_contents_writeable (var->u.value).data ();
arch = get_value_arch (var->u.value);
unit_size = gdbarch_addressable_memory_unit_size (arch);
modify_field (value_type (var->u.value), addr + offset,
value_as_long (newval), bitpos, bitsize);
else
- memcpy (addr + offset * unit_size, value_contents (newval),
+ memcpy (addr + offset * unit_size, value_contents (newval).data (),
TYPE_LENGTH (value_type (newval)));
break;
in disassemble_command). It also dereferences references, which
I suspect is the most logical thing to do. */
val = coerce_array (val);
- return unpack_long (value_type (val), value_contents (val));
+ return unpack_long (value_type (val), value_contents (val).data ());
}
/* Extract a value as a C pointer. Does not deallocate the value.
if (!value_type (val)->is_pointer_or_reference ()
&& gdbarch_integer_to_address_p (gdbarch))
return gdbarch_integer_to_address (gdbarch, value_type (val),
- value_contents (val));
+ value_contents (val).data ());
- return unpack_long (value_type (val), value_contents (val));
+ return unpack_long (value_type (val), value_contents (val).data ());
#endif
}
\f
if (is_floating_type (type))
{
- if (!target_float_is_valid (value_contents (val), type))
+ if (!target_float_is_valid (value_contents (val).data (), type))
error (_("Invalid floating value found in program."));
return true;
}
for references to ordinary fields of unavailable values. */
if (BASETYPE_VIA_VIRTUAL (arg_type, fieldno))
boffset = baseclass_offset (arg_type, fieldno,
- value_contents (arg1),
+ value_contents (arg1).data (),
value_embedded_offset (arg1),
value_address (arg1),
arg1);
num = unpack_bits_as_long (field_type, valaddr + embedded_offset,
bitpos, bitsize);
- store_signed_integer (value_contents_raw (dest_val),
+ store_signed_integer (value_contents_raw (dest_val).data (),
TYPE_LENGTH (field_type), byte_order, num);
}
{
struct value *val = allocate_value (type);
- pack_long (value_contents_raw (val), type, num);
+ pack_long (value_contents_raw (val).data (), type, num);
return val;
}
{
struct value *val = allocate_value (type);
- pack_unsigned_long (value_contents_raw (val), type, num);
+ pack_unsigned_long (value_contents_raw (val).data (), type, num);
return val;
}
{
struct value *val = allocate_value (type);
- store_typed_address (value_contents_raw (val),
+ store_typed_address (value_contents_raw (val).data (),
check_typedef (type), addr);
return val;
}
{
struct value *value = allocate_value (type);
gdb_assert (type->code () == TYPE_CODE_FLT);
- target_float_from_host_double (value_contents_raw (value),
+ target_float_from_host_double (value_contents_raw (value).data (),
value_type (value), d);
return value;
}
struct value *result;
result = allocate_value (type);
- memcpy (value_contents_raw (result), contents, TYPE_LENGTH (type));
+ memcpy (value_contents_raw (result).data (), contents, TYPE_LENGTH (type));
return result;
}
enc_type = check_typedef (value_enclosing_type (arg));
enc_type = TYPE_TARGET_TYPE (enc_type);
- CORE_ADDR addr = unpack_pointer (value_type (arg), value_contents (arg));
+ CORE_ADDR addr = unpack_pointer (value_type (arg), value_contents (arg).data ());
retval = value_at_lazy (enc_type, addr);
enc_type = value_type (retval);
return readjust_indirect_value_type (retval, enc_type, value_type_arg_tmp,
value_fetch_lazy (parent);
unpack_value_bitfield (val, value_bitpos (val), value_bitsize (val),
- value_contents_for_printing (parent),
+ value_contents_for_printing (parent).data (),
value_offset (val), parent);
}
if (TYPE_LENGTH (type))
read_value_memory (val, 0, value_stack (val),
- addr, value_contents_all_raw (val),
+ addr, value_contents_all_raw (val).data (),
type_length_units (type));
}
else
{
int i;
- const gdb_byte *buf = value_contents (new_val);
+ const gdb_byte *buf = value_contents (new_val).data ();
if (VALUE_LVAL (new_val) == lval_register)
fprintf_unfiltered (&debug_file, " register=%d",
get to the real subobject, if the value happens to represent
something embedded in a larger run-time object. */
-extern gdb_byte *value_contents_raw (struct value *);
+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
value. Note that a value therefore extends beyond what is
declared here. */
-extern const gdb_byte *value_contents (struct value *);
-extern gdb_byte *value_contents_writeable (struct value *);
+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_byte *value_contents_all_raw (struct value *);
-extern const gdb_byte *value_contents_all (struct 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
bits be valid. This should only be used in situations where you
plan to check the validity manually. */
-extern const gdb_byte *value_contents_for_printing (struct value *value);
+extern gdb::array_view<const gdb_byte> value_contents_for_printing (struct value *value);
/* Like value_contents_for_printing, but accepts a constant value
pointer. Unlike value_contents_for_printing however, the pointed
value must _not_ be lazy. */
-extern const gdb_byte *
+extern gdb::array_view<const gdb_byte>
value_contents_for_printing_const (const struct value *value);
extern void value_fetch_lazy (struct value *val);
sp -= (len + 3) & ~3;
count += (len + 3) / 4;
- write_memory (sp, value_contents_all (args[i]), len);
+ write_memory (sp, value_contents_all (args[i]).data (), len);
}
/* Push argument count. */
if (!target_get_tib_address (inferior_ptid, &tlb))
error (_("Unable to read tlb"));
- store_typed_address (value_contents_raw (val), type, tlb);
+ store_typed_address (value_contents_raw (val).data (), type, tlb);
}
/* This function implements the lval_computed support for writing a
break;
/* Put argument into registers wordwise. */
- const gdb_byte *val = value_contents (args[i]);
+ const gdb_byte *val = value_contents (args[i]).data ();
for (j = 0; j < typelen; j += xstormy16_reg_size)
{
ULONGEST regval;
wordaligned. */
for (j = nargs - 1; j >= i; j--)
{
- const gdb_byte *bytes = value_contents (args[j]);
+ const gdb_byte *bytes = value_contents (args[j]).data ();
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
slacklen = typelen & 1;
break;
}
fprintf_unfiltered (gdb_stdlog, " %s\n",
- host_address_to_string (value_contents (arg)));
+ host_address_to_string (value_contents (arg).data ()));
}
}
break;
}
info->length = TYPE_LENGTH (arg_type);
- info->contents = value_contents (arg);
+ info->contents = value_contents (arg).data ();
/* Align size and onstack_size. */
size = (size + info->align - 1) & ~(info->align - 1);