int len = type->length ();
enum type_code typecode = type->code ();
int regnum = AARCH64_X0_REGNUM + info->ngrn;
- const bfd_byte *buf = value_contents (arg).data ();
+ const bfd_byte *buf = arg->contents ().data ();
info->argnum++;
pass_on_stack (struct aarch64_call_info *info, struct type *type,
struct value *arg)
{
- const bfd_byte *buf = value_contents (arg).data ();
+ const bfd_byte *buf = arg->contents ().data ();
int len = type->length ();
int align;
stack_item_t item;
case TYPE_CODE_FLT:
case TYPE_CODE_DECFLOAT:
return pass_in_v (gdbarch, regcache, info, arg_type->length (),
- value_contents (arg).data ());
+ arg->contents ().data ());
break;
case TYPE_CODE_COMPLEX:
{
- const bfd_byte *buf = value_contents (arg).data ();
+ const bfd_byte *buf = arg->contents ().data ();
struct type *target_type = check_typedef (arg_type->target_type ());
if (!pass_in_v (gdbarch, regcache, info, target_type->length (),
case TYPE_CODE_ARRAY:
if (arg_type->is_vector ())
return pass_in_v (gdbarch, regcache, info, arg_type->length (),
- value_contents (arg).data ());
+ arg->contents ().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).data (), len);
+ write_memory (sp, arg->contents ().data (), len);
/* Construct the indirection. */
arg_type = lookup_pointer_type (arg_type);
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).data ();
+ const gdb_byte *valaddr = arr->contents_for_printing ().data ();
CORE_ADDR address = arr->address ();
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, type->length ());
if (obj == NULL)
src = valaddr + offset;
else
- src = value_contents (obj).data () + offset;
+ src = obj->contents ().data () + offset;
if (is_dynamic_type (type))
{
else
{
v = value::allocate (type);
- src = value_contents (obj).data () + offset;
+ src = obj->contents ().data () + offset;
}
if (obj != NULL)
if (is_big_endian && is_scalar_type (fromval->type ()))
from_offset = from_size - bits;
copy_bitwise (buffer, toval->bitpos (),
- value_contents (fromval).data (), from_offset,
+ fromval->contents ().data (), from_offset,
bits, is_big_endian);
write_memory_with_notification (to_addr, buffer, len);
val = value_copy (toval);
memcpy (val->contents_raw ().data (),
- value_contents (fromval).data (),
+ fromval->contents ().data (),
type->length ());
val->deprecated_set_type (type);
copy_bitwise ((container->contents_writeable ().data ()
+ offset_in_container),
container->bitpos () + bit_offset_in_container,
- value_contents (val).data (), src_offset, bits, 1);
+ val->contents ().data (), src_offset, bits, 1);
}
else
copy_bitwise ((container->contents_writeable ().data ()
+ offset_in_container),
container->bitpos () + bit_offset_in_container,
- value_contents (val).data (), 0, bits, 0);
+ val->contents ().data (), 0, bits, 0);
}
/* Determine if TYPE is an access to an unconstrained array. */
VALUE_LVAL (val) = lval_memory;
val->set_address (addr);
- write_memory (addr, value_contents (val).data (), len);
+ write_memory (addr, val->contents ().data (), len);
}
return val;
actual_type = ada_check_typedef (actual->type ());
val = value::allocate (actual_type);
- copy (value_contents (actual), val->contents_raw ());
+ copy (actual->contents (), val->contents_raw ());
actual = ensure_lval (val);
}
result = value_addr (actual);
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
return ada_value_primitive_packed_val (arg1,
- value_contents (arg1).data (),
+ arg1->contents ().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).data ());
+ return value_from_contents (type, val0->contents ().data ());
}
return value_from_contents_and_address (type, 0, address);
struct value *elt = value_cast (elt_type, value_subscript (val, lo + i));
int elt_len = elt_type->length ();
- copy (value_contents_all (elt), res_contents.slice (elt_len * i, elt_len));
+ copy (elt->contents_all (), res_contents.slice (elt_len * i, elt_len));
}
return res;
representations use all bits (no padding or undefined bits)
and do not have user-defined equality. */
return (arg1_type->length () == arg2_type->length ()
- && memcmp (value_contents (arg1).data (),
- value_contents (arg2).data (),
+ && memcmp (arg1->contents ().data (),
+ arg2->contents ().data (),
arg1_type->length ()) == 0);
}
return value_equal (arg1, arg2);
static void
value_as_string (char *dest, struct value *val, int length)
{
- memcpy (dest, value_contents (val).data (), length);
+ memcpy (dest, val->contents ().data (), length);
dest[length] = '\0';
}
const struct value_print_options *options)
{
struct type *type = ada_check_typedef (val->type ());
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
if (type->code () == TYPE_CODE_RANGE
&& (type->target_type ()->code () == TYPE_CODE_ENUM
}
struct type *type = ada_check_typedef (value->type ());
- const gdb_byte *valaddr = value_contents_for_printing (value).data ();
+ const gdb_byte *valaddr = value->contents_for_printing ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
val_print_packed_array_elements (type, valaddr, offset_aligned,
stream, recurse, options);
type = val->type ();
struct type *saved_type = type;
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
CORE_ADDR address = val->address ();
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, type->length ());
/* Convert to VALTYPE. */
gdb_assert (valtype->length () == 4);
- alpha_sts (gdbarch, out, value_contents_all (value).data ());
+ alpha_sts (gdbarch, out, value->contents_all ().data ());
release_value (value);
return 1;
sp = (sp & -16) - 16;
/* Write the real data into the stack. */
- write_memory (sp, value_contents (arg).data (), 16);
+ write_memory (sp, arg->contents ().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).data (), 32);
+ write_memory (sp, arg->contents ().data (), 32);
/* Construct the indirection. */
arg_type = lookup_pointer_type (arg_type);
m_arg->len = arg_type->length ();
m_arg->offset = accumulate_size;
accumulate_size = (accumulate_size + m_arg->len + 7) & ~7;
- m_arg->contents = value_contents (arg).data ();
+ m_arg->contents = arg->contents ().data ();
}
/* Determine required argument register loads, loading an argument register
else
{
/* The argument will be passed in registers. */
- const gdb_byte *valbuf = value_contents (args[i]).data ();
+ const gdb_byte *valbuf = args[i]->contents ().data ();
gdb_byte buf[8];
gdb_assert (len <= 16);
for (i = 0; i < num_stack_args; i++)
{
struct type *type = stack_args[i]->type ();
- const gdb_byte *valbuf = value_contents (stack_args[i]).data ();
+ const gdb_byte *valbuf = stack_args[i]->contents ().data ();
int len = type->length ();
write_memory (sp + element * 8, valbuf, len);
if (amd64_windows_passed_by_pointer (args[i]->type ()))
{
struct type *type = args[i]->type ();
- const gdb_byte *valbuf = value_contents (args[i]).data ();
+ const gdb_byte *valbuf = args[i]->contents ().data ();
const int len = type->length ();
/* Store a copy of that argument on the stack, aligned to
struct value *arg, int regno)
{
struct type *type = arg->type ();
- const gdb_byte *valbuf = value_contents (arg).data ();
+ const gdb_byte *valbuf = arg->contents ().data ();
gdb_byte buf[8];
gdb_assert (type->length () <= 8);
for (i = 0; i < num_stack_args; i++)
{
struct type *type = stack_args[i]->type ();
- const gdb_byte *valbuf = value_contents (stack_args[i]).data ();
+ const gdb_byte *valbuf = stack_args[i]->contents ().data ();
write_memory (sp + element * 8, valbuf, type->length ());
element += ((type->length () + 7) / 8);
unsigned int len = args[i]->type ()->length ();
unsigned int space = align_up (len, 4);
- memcpy (data, value_contents (args[i]).data (), (size_t) len);
+ memcpy (data, args[i]->contents ().data (), (size_t) len);
arc_debug_printf ("copying arg %d, val 0x%08x, len %d to mem",
- i, *((int *) value_contents (args[i]).data ()),
+ i, *((int *) args[i]->contents ().data ()),
len);
data += space;
len = arg_type->length ();
target_type = arg_type->target_type ();
typecode = arg_type->code ();
- val = value_contents (args[argnum]).data ();
+ val = args[argnum]->contents ().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 (arg->type ());
- const bfd_byte *contents = value_contents (arg).data ();
+ const bfd_byte *contents = arg->contents ().data ();
int len = type->length ();
/* Calculate the potential last register needed.
int container_len = align_up (arg_type->length (), 4);
sp -= container_len;
- write_memory (sp, value_contents (args[i]).data (), container_len);
+ write_memory (sp, args[i]->contents ().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).data (),
+ val->contents_for_printing ().data (),
val->offset (),
val);
&& (*length < 0 || *length <= fetchlimit))
{
int i;
- const gdb_byte *contents = value_contents (value).data ();
+ const gdb_byte *contents = value->contents ().data ();
/* If a length is specified, use that. */
if (*length >= 0)
{
struct type *type = check_typedef (val->type ());
CORE_ADDR address = val->address ();
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
struct type *unresolved_elttype = type->target_type ();
struct type *elttype = check_typedef (unresolved_elttype);
}
struct type *type = check_typedef (val->type ());
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
if (options->vtblprint && cp_is_vtbl_ptr_type (type))
{
TYPE_CODE_PTR.) */
int offset = type->field (VTBL_FNADDR_OFFSET).loc_bitpos () / 8;
struct type *field_type = type->field (VTBL_FNADDR_OFFSET).type ();
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().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 = val->type ();
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
if (c_textual_element_type (type, options->format))
{
gdb_puts (" ", 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]).data ();
+ const char *a0 = (const char *) argv[0]->contents ().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).data (),
+ dump_binary_file (filename.get (), mode, val->contents ().data (),
val->type ()->length ());
else
{
}
dump_bfd_file (filename.get (), mode, file_format, vaddr,
- value_contents (val).data (),
+ val->contents ().data (),
val->type ()->length ());
}
}
inferior_addr = regs_base + reg_offset;
if (0 != target_write_memory (inferior_addr,
- value_contents (regval).data (),
+ regval->contents ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
if (dont_print_vb == 0)
{
int i;
len = args[argnum]->type ()->length ();
- val = value_contents (args[argnum]).data ();
+ val = args[argnum]->contents ().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 (args[argnum]->type ());
len = arg_type->length ();
- val = value_contents (args[argnum]).data ();
+ val = args[argnum]->contents ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
length = unpack_field_as_long (type, valaddr + embedded_offset, 0);
gdb_assert (!check_optimized || from == nullptr);
if (from != nullptr)
{
- from_contents = value_contents (from).data ();
+ from_contents = from->contents ().data ();
v_contents = nullptr;
}
else
bits_to_skip += p->offset;
copy_bitwise (v_contents, offset,
- value_contents_all (p->v.value).data (),
+ p->v.value->contents_all ().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), byte_order);
+ = extract_signed_integer (value->contents (), byte_order);
byte_offset += piece->v.ptr.offset;
return indirect_synthetic_pointer (piece->v.ptr.die_sect_off,
if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG)
subobj_offset += n - max;
- copy (value_contents_all (val).slice (subobj_offset, len),
+ copy (val->contents_all ().slice (subobj_offset, len),
retval->contents_raw ());
}
break;
ULONGEST result;
dwarf_require_integral (result_val->type ());
- result = extract_unsigned_integer (value_contents (result_val), byte_order);
+ result = extract_unsigned_integer (result_val->contents (), byte_order);
/* For most architectures, calling extract_unsigned_integer() alone
is sufficient for extracting an address. However, some
else
result_val
= value_from_contents (type,
- value_contents_all (result_val).data ());
+ result_val->contents_all ().data ());
}
break;
modify_field (struct_type, addr,
value_as_long (val), bitpos % 8, bitsize);
else
- memcpy (addr, value_contents (val).data (),
+ memcpy (addr, val->contents ().data (),
val->type ()->length ());
}
error (_("Too many array elements"));
memcpy (array->contents_raw ().data ()
+ (index - low_bound) * element_size,
- value_contents (element).data (),
+ element->contents ().data (),
element_size);
index++;
}
case TYPE_CODE_FLT:
{
double d
- = fabs (target_float_to_host_double (value_contents (arg1).data (),
+ = fabs (target_float_to_host_double (arg1->contents ().data (),
arg1->type ()));
return value_from_host_double (type, d);
}
case TYPE_CODE_FLT:
{
double d1
- = target_float_to_host_double (value_contents (arg1).data (),
+ = target_float_to_host_double (arg1->contents ().data (),
arg1->type ());
double d2
- = target_float_to_host_double (value_contents (arg2).data (),
+ = target_float_to_host_double (arg2->contents ().data (),
arg2->type ());
double d3 = fmod (d1, d2);
return value_from_host_double (type, d3);
{
if (arg1->type ()->code () != TYPE_CODE_FLT)
error (_("argument to CEILING must be of type float"));
- double val = target_float_to_host_double (value_contents (arg1).data (),
+ double val = target_float_to_host_double (arg1->contents ().data (),
arg1->type ());
val = ceil (val);
return value_from_longest (result_type, val);
{
if (arg1->type ()->code () != TYPE_CODE_FLT)
error (_("argument to FLOOR must be of type float"));
- double val = target_float_to_host_double (value_contents (arg1).data (),
+ double val = target_float_to_host_double (arg1->contents ().data (),
arg1->type ());
val = floor (val);
return value_from_longest (result_type, val);
case TYPE_CODE_FLT:
{
double a
- = target_float_to_host_double (value_contents (arg1).data (),
+ = target_float_to_host_double (arg1->contents ().data (),
arg1->type ());
double p
- = target_float_to_host_double (value_contents (arg2).data (),
+ = target_float_to_host_double (arg2->contents ().data (),
arg2->type ());
double result = fmod (a, p);
if (result != 0 && (a < 0.0) != (p < 0.0))
array->address () + total_offset);
else
array = value_from_contents_and_address
- (array_slice_type, value_contents (array).data () + total_offset,
+ (array_slice_type, array->contents ().data () + total_offset,
array->address () + total_offset);
}
else if (!array->lazy ())
struct type *elt_type = elt->type ();
if (is_dynamic_type (elt_type))
{
- const gdb_byte *valaddr = value_contents_for_printing (elt).data ();
+ const gdb_byte *valaddr = elt->contents_for_printing ().data ();
CORE_ADDR address = elt->address ();
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, elt_type->length ());
const int length = type->length ();
const CORE_ADDR addr
= value_as_long (value_allocate_space_in_inferior (length));
- write_memory (addr, value_contents (value).data (), length);
+ write_memory (addr, value->contents ().data (), length);
struct value *val = value_from_contents_and_address
- (type, value_contents (value).data (), addr);
+ (type, value->contents ().data (), addr);
return value_addr (val);
}
else
struct type *elttype;
CORE_ADDR addr;
int index;
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
const CORE_ADDR address = val->address ();
switch (type->code ())
}
else
{
- const gdb_byte *contents = value_contents (v).data ();
+ const gdb_byte *contents = v->contents ().data ();
pattern_buf.insert (pattern_buf.end (), contents,
contents + t->length ());
}
if (bufferp)
{
if (!*optimizedp && !*unavailablep)
- memcpy (bufferp, value_contents_all (value).data (),
+ memcpy (bufferp, value->contents_all ().data (),
value->type ()->length ());
else
memset (bufferp, 0, value->type ()->length ());
else
{
int i;
- gdb::array_view<const gdb_byte> buf = value_contents (value);
+ gdb::array_view<const gdb_byte> buf = value->contents ();
gdb_printf (&debug_file, " bytes=");
gdb_printf (&debug_file, "[");
_("Register %d is not available"), regnum);
}
- LONGEST r = extract_signed_integer (value_contents_all (value), byte_order);
+ LONGEST r = extract_signed_integer (value->contents_all (), byte_order);
release_value (value);
return r;
_("Register %d is not available"), regnum);
}
- ULONGEST r = extract_unsigned_integer (value_contents_all (value).data (),
+ ULONGEST r = extract_unsigned_integer (value->contents_all ().data (),
size, byte_order);
release_value (value);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int size = register_size (gdbarch, VALUE_REGNUM (regval));
- *val = extract_unsigned_integer (value_contents (regval).data (), size,
+ *val = extract_unsigned_integer (regval->contents ().data (), size,
byte_order);
return true;
}
return false;
}
- memcpy (myaddr, value_contents_all (value).data () + offset,
+ memcpy (myaddr, value->contents_all ().data () + offset,
curr_len);
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).data (), 4, byte_order);
+ (arg->contents ().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).data ();
+ val = arg->contents ().data ();
}
while (len > 0)
int offset = -1;
return is_unique_ancestor_worker (base, val->type (), &offset,
- value_contents_for_printing (val).data (),
+ val->contents_for_printing ().data (),
val->embedded_offset (),
val->address (), 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).data ();
+ const gdb_byte *contents = method_ptr->contents ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
if (! unpack_value_field_as_long (type, valaddr, embedded_offset, 0,
{
type = check_typedef (type);
length = type->length ();
- contents = value_contents (value).data ();
+ contents = value->contents ().data ();
}
catch (const gdb_exception &except)
{
{
if (is_floating_value (value))
{
- d = target_float_to_host_double (value_contents (value).data (),
+ d = target_float_to_host_double (value->contents ().data (),
type);
check = value_from_host_double (type, d);
}
{
struct type *type = args[argument]->type ();
int len = type->length ();
- char *contents = (char *) value_contents (args[argument]).data ();
+ char *contents = (char *) args[argument]->contents ().data ();
/* Pad the argument appropriately. */
int padded_len = align_up (len, wordsize);
struct_ptr += align_up (type->length (), 8);
if (write_pass)
write_memory (struct_end - struct_ptr,
- value_contents (arg).data (), type->length ());
+ arg->contents ().data (), type->length ());
store_unsigned_integer (param_val, 4, byte_order,
struct_end - struct_ptr);
}
param_len = align_up (type->length (), 4);
store_unsigned_integer
(param_val, param_len, byte_order,
- unpack_long (type, value_contents (arg).data ()));
+ unpack_long (type, arg->contents ().data ()));
}
else if (type->code () == TYPE_CODE_FLT)
{
/* Floating point value store, right aligned. */
param_len = align_up (type->length (), 4);
- memcpy (param_val, value_contents (arg).data (), param_len);
+ memcpy (param_val, arg->contents ().data (), param_len);
}
else
{
/* Small struct value are stored right-aligned. */
memcpy (param_val + param_len - type->length (),
- value_contents (arg).data (), type->length ());
+ arg->contents ().data (), type->length ());
/* 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).data ());
+ arg->contents ().data ());
}
}
}
{
ULONGEST codeptr, fptr;
- codeptr = unpack_long (type, value_contents (arg).data ());
+ codeptr = unpack_long (type, arg->contents ().data ());
fptr = hppa64_convert_code_addr_to_fptr (gdbarch, codeptr);
store_unsigned_integer (fptrbuf, type->length (), byte_order,
fptr);
}
else
{
- valbuf = value_contents (arg).data ();
+ valbuf = arg->contents ().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).data (),
+ pc = extract_unsigned_integer (pcoq_val->contents_all ().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]).data ();
+ const gdb_byte *val = args[i]->contents_all ().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]).data (),
+ args[i]->contents_all ().data (),
arg_type->length ());
/* 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]).data (), len);
+ args[i]->contents_all ().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]).data ());
+ args[0]->contents_all ().data ());
/* If the PLT is position-independent, the SYSTEM V ABI requires %ebx to be
set to the address of the GOT when doing a call to a PLT address.
if (value_entirely_available (regval))
{
- const gdb_byte *raw = value_contents (regval).data ();
+ const gdb_byte *raw = regval->contents ().data ();
gdb_puts ("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).data (),
+ prev_cfm = extract_unsigned_integer (val->contents_all ().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).data (),
+ prN = extract_bit_field (pr_val->contents_all ().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).data (),
+ unatN = extract_bit_field (unat_val->contents_all ().data (),
regnum - IA64_NAT0_REGNUM, 1);
return frame_unwind_got_constant (this_frame, regnum, unatN);
}
reg_val = ia64_frame_prev_register (this_frame, this_cache,
IA64_CFM_REGNUM);
prev_cfm = extract_unsigned_integer
- (value_contents_all (reg_val).data (), 8, byte_order);
+ (reg_val->contents_all ().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).data (), 8, byte_order);
+ (reg_val->contents_all ().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).data (),
+ prN_val = extract_bit_field (val->contents_all ().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).data (),
+ unatN_val = extract_bit_field (val->contents_all ().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).data (),
+ prev_bsp = extract_unsigned_integer (val->contents_all ().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).data (),
+ prev_cfm = extract_unsigned_integer (cfm_val->contents_all ().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).data (),
+ prev_ip = extract_unsigned_integer (prev_ip_val->contents_all ().data (),
8, byte_order);
if (prev_ip == 0)
{
gdb_byte val_buf[8];
ULONGEST faddr = extract_unsigned_integer
- (value_contents (arg).data (), 8, byte_order);
+ (arg->contents ().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).data (), len,
+ extract_unsigned_integer (arg->contents ().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).data () + argoffset,
+ memcpy (val_buf, arg->contents ().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).data () + argoffset,
+ target_float_convert (arg->contents ().data () + argoffset,
float_elt_type, to,
ia64_ext_type (gdbarch));
regcache->cooked_write (floatreg, to);
if (info.trivially_copy_constructible)
{
int length = param_type->length ();
- write_memory (addr, value_contents (args[i]).data (), length);
+ write_memory (addr, args[i]->contents ().data (), length);
}
else
{
|| regtype->code () == TYPE_CODE_DECFLOAT)
{
struct value_print_options opts;
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
enum bfd_endian byte_order = type_byte_order (regtype);
get_user_print_options (&opts);
{
type = args[i]->type ();
typelen = type->length ();
- val = value_contents (args[i]).data ();
+ val = args[i]->contents ().data ();
if (typelen <= 4)
{
/* Char, short, int, float, pointer, and structs <= four bytes. */
/* FIXME: Handle structures. */
- contents = (gdb_byte *) value_contents (arg).data ();
+ contents = (gdb_byte *) arg->contents ().data ();
val = extract_unsigned_integer (contents, arg_type->length (),
byte_order);
for (int i = 0; i < nargs; i++)
{
struct value *arg = args[i];
- const gdb_byte *val = value_contents (arg).data ();
+ const gdb_byte *val = arg->contents ().data ();
struct type *type = check_typedef (arg->type ());
size_t len = type->length ();
int align = type_align (type);
struct value *val;
struct type *type = check_typedef (value->type ());
- const gdb_byte *valaddr = value_contents_for_printing (value).data ();
+ const gdb_byte *valaddr = value->contents_for_printing ().data ();
addr = unpack_pointer (type->field (0).type (),
(type->field (0).loc_bitpos () / 8) +
unsigned len;
struct type *elttype;
CORE_ADDR addr;
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
const CORE_ADDR address = val->address ();
struct type *type = check_typedef (val->type ());
for (i = nargs - 1; i >= 0; i--)
{
struct value *arg = args[i];
- const gdb_byte *arg_bits = value_contents (arg).data ();
+ const gdb_byte *arg_bits = arg->contents ().data ();
struct type *arg_type = arg->type ();
ULONGEST arg_size = arg_type->length ();
{
/* Value gets right-justified in the register or stack word. */
memcpy (valbuf + (register_size (gdbarch, argreg) - len),
- (gdb_byte *) value_contents (args[argnum]).data (), len);
+ (gdb_byte *) args[argnum]->contents ().data (), len);
val = valbuf;
}
else
- val = (gdb_byte *) value_contents (args[argnum]).data ();
+ val = (gdb_byte *) args[argnum]->contents ().data ();
while (len > 0)
{
{
ULONGEST v;
- v = extract_unsigned_integer (value_contents (args[0]).data (),
+ v = extract_unsigned_integer (args[0]->contents ().data (),
type->length (), byte_order);
first_stack_argnum = 1;
sp--;
write_memory (sp, &zero, 1);
}
- val = value_contents (args[argnum]).data ();
+ val = args[argnum]->contents ().data ();
sp -= type->length ();
write_memory (sp, val, type->length ());
}
else
offset = container_len - len;
sp -= container_len;
- write_memory (sp + offset, value_contents_all (args[i]).data (), len);
+ write_memory (sp + offset, args[i]->contents_all ().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]).data (), arg_len);
+ write_memory (sp, argv[i]->contents ().data (), arg_len);
copy[i] = sp;
}
}
/* Arguments that fit in a GPR get expanded to fill the GPR. */
if (argv[i]->type ()->length () <= MEP_GPR_SIZE)
- value = extract_unsigned_integer (value_contents (argv[i]).data (),
+ value = extract_unsigned_integer (argv[i]->contents ().data (),
argv[i]->type ()->length (),
byte_order);
gdb_printf (gdb_stdlog, " push");
}
else
- val = value_contents (arg).data ();
+ val = arg->contents ().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).data ();
+ val = arg->contents ().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).data ();
+ val = arg->contents ().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).data ();
+ val = arg->contents ().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).data ();
+ raw_buffer = value->contents_all ().data ();
/* pad small registers */
for (byte = 0;
byte < (mips_abi_regsize (gdbarch)
else
{
arg_len = (*args)->type ()->length ();
- val = value_contents (*args).data ();
+ val = (*args)->contents ().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).data ();
+ const gdb_byte *arg_bits = arg->contents_all ().data ();
struct type *arg_type = check_typedef (arg->type ());
ULONGEST arg_size = arg_type->length ();
int offset;
calling_use_fpr = nds32_check_calling_use_fpr (type);
len = type->length ();
align = type_align (type);
- val = value_contents (args[i]).data ();
+ val = args[i]->contents ().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 (arg->type ());
int len = arg_type->length ();
- val = value_contents (arg).data ();
+ val = arg->contents ().data ();
/* Copy the argument to general registers or the stack in
register-sized pieces. Large arguments are split between
for (i = offset; i < n; i++)
memcpy (v->contents_raw ().data () + j++ * elsize,
- value_contents (c->val).data () + c->indices[i] * elsize,
+ c->val->contents ().data () + c->indices[i] * elsize,
elsize);
}
struct value *to_elm_val = value_subscript (c->val, c->indices[i]);
memcpy (from_elm_val->contents_writeable ().data (),
- value_contents (fromval).data () + j++ * elsize,
+ fromval->contents ().data () + j++ * elsize,
elsize);
value_assign (to_elm_val, from_elm_val);
}
for (i = 0; i < n; i++)
memcpy (ret->contents_writeable ().data ()
+ (i * elm_type->length ()),
- value_contents (val).data ()
+ val->contents ().data ()
+ (indices[i] * elm_type->length ()),
elm_type->length ());
}
tmp = value_logical_not (value_subscript (arg1, i)) ?
value_subscript (arg3, i) : value_subscript (arg2, i);
memcpy (ret->contents_writeable ().data () +
- i * eltype2->length (), value_contents_all (tmp).data (),
+ i * eltype2->length (), tmp->contents_all ().data (),
eltype2->length ());
}
heap_offset += align_up (len, bpw);
valaddr = heap_sp + heap_offset;
- write_memory (valaddr, value_contents (arg).data (), len);
+ write_memory (valaddr, arg->contents ().data (), len);
}
/* The ABI passes all structures by reference, so get its
else
{
/* Everything else, we just get the value. */
- val = value_contents (arg).data ();
+ val = arg->contents ().data ();
}
/* Stick the value in a register. */
val = valbuf;
}
else
- val = value_contents (arg).data ();
+ val = arg->contents ().data ();
while (len > 0)
{
struct type *char_type;
CORE_ADDR addr;
int want_space = 0;
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
if (dont_print_statmem == 0)
{
struct value *arg = args[argno];
struct type *type = check_typedef (arg->type ());
int len = type->length ();
- const bfd_byte *val = value_contents (arg).data ();
+ const bfd_byte *val = arg->contents ().data ();
if (type->code () == TYPE_CODE_FLT && len <= 8
&& !tdep->soft_float)
{
struct value *arg = args[argno];
struct type *type = check_typedef (arg->type ());
- const bfd_byte *val = value_contents (arg).data ();
+ const bfd_byte *val = arg->contents ().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).data (), len);
+ memcpy (tem_str, value->contents ().data (), len);
tem_str [len] = 0;
str = tem_str;
}
if (VALUE_LVAL (value) == lval_internalvar
&& c_is_string_type_p (value->type ()))
{
- str = value_contents (value).data ();
+ str = value->contents ().data ();
len = value->type ()->length ();
}
else
param_type = float_type_from_length (param_type);
if (param_type != value->type ())
value = value_from_contents (param_type,
- value_contents (value).data ());
+ value->contents ().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).data (), fmt_type, format);
+ = target_float_to_string (value->contents ().data (), fmt_type, format);
gdb_puts (str.c_str (), stream);
}
|| valtype->code () != TYPE_CODE_INT)
error (_("expected wchar_t argument for %%lc"));
- bytes = value_contents (val_args[i]).data ();
+ bytes = val_args[i]->contents ().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).data ();
+ bytes = val->contents_all ().data ();
bytes_len = val->type ()->length ();
}
else
if ((value = value_object_to_value (pyo_value)) != NULL)
{
*addr = unpack_pointer (value->type (),
- value_contents (value).data ());
+ value->contents ().data ());
rc = 1;
}
}
cached_frame->reg[i].data = (gdb_byte *) xmalloc (data_size);
memcpy (cached_frame->reg[i].data,
- value_contents (value).data (), data_size);
+ value->contents ().data (), data_size);
}
}
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).data (), type);
+ (self_value->value->contents ().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).data (), type);
+ d = target_float_to_host_double (value->contents ().data (), type);
else if (type->code () == TYPE_CODE_INT)
{
/* Note that valpy_long accepts TYPE_CODE_PTR and some
&& regtype->field (2).type ()->code () == TYPE_CODE_FLT))
{
struct value_print_options opts;
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().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).data ();
+ info->contents = arg_value->contents ().data ();
}
/* Adjust the stack pointer and align it. */
is unscaled. */
gdb_mpz unscaled;
- unscaled.read (value_contents (abi_val),
+ unscaled.read (abi_val->contents (),
type_byte_order (info.type),
info.type->is_unsigned ());
*read_value = value::allocate (arg_type);
sp -= container_len;
write_memory (rl78_make_data_address (sp),
- value_contents_all (args[i]).data (), len);
+ args[i]->contents_all ().data (), len);
}
/* Store struct value address. */
gdb_assert (len <= 8);
- target_float_convert (value_contents (arg).data (), type, reg_val,
+ target_float_convert (arg->contents ().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).data ()) + argbytes,
+ ((char *) arg->contents ().data ()) + argbytes,
(len - argbytes) > reg_size
? reg_size : len - argbytes);
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
|| type->code () == TYPE_CODE_CHAR)
/* Sign or zero extend the "int" into a "word". */
store_unsigned_integer (word, reg_size, byte_order,
- unpack_long (type, value_contents (arg).data ()));
+ unpack_long (type, arg->contents ().data ()));
else
- memcpy (word, value_contents (arg).data (), len);
+ memcpy (word, arg->contents ().data (), len);
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
}
++argno;
if (argbytes)
{
write_memory (sp + 24 + (ii * 4),
- value_contents (arg).data () + argbytes,
+ arg->contents ().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).data ());
+ arg->contents ().data ());
++f_argno;
}
- write_memory (sp + 24 + (ii * 4), value_contents (arg).data (), len);
+ write_memory (sp + 24 + (ii * 4), arg->contents ().data (), len);
ii += ((len + 3) & -4) / 4;
}
}
gdb_assert (len <= 8);
- target_float_convert (value_contents (arg).data (), type, reg_val,
+ target_float_convert (arg->contents ().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).data ()) + argbytes,
+ ((char *) arg->contents ().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).data (), len);
+ memcpy (word, arg->contents ().data (), len);
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
}
++argno;
if (argbytes)
{
write_memory (sp + 24 + (ii * 4),
- value_contents (arg).data () + argbytes,
+ arg->contents ().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).data ());
+ arg->contents ().data ());
++f_argno;
}
- write_memory (sp + 24 + (ii * 4), value_contents (arg).data (), len);
+ write_memory (sp + 24 + (ii * 4), arg->contents ().data (), len);
ii += align_up (len, 4) / 4;
}
}
gdb_assert (rust_enum_p (type));
gdb::array_view<const gdb_byte> view
- (value_contents_for_printing (val).data (),
+ (val->contents_for_printing ().data (),
val->type ()->length ());
type = resolve_dynamic_type (type, view, val->address ());
encoding. */
gdb_puts ("b", stream);
printstr (stream, type->target_type (),
- value_contents_for_printing (val).data (),
+ val->contents_for_printing ().data (),
high_bound - low_bound + 1, "ASCII", 0, &opts);
}
break;
if (rust_enum_p (type))
{
- type = resolve_dynamic_type (type, value_contents (lhs),
+ type = resolve_dynamic_type (type, lhs->contents (),
lhs->address ());
if (rust_empty_enum_p (type))
struct type *type = lhs->type ();
if (type->code () == TYPE_CODE_STRUCT && rust_enum_p (type))
{
- type = resolve_dynamic_type (type, value_contents (lhs),
+ type = resolve_dynamic_type (type, lhs->contents (),
lhs->address ());
if (rust_empty_enum_p (type))
psw_val = rx_frame_prev_register (this_frame, this_cache,
RX_PSW_REGNUM);
psw = extract_unsigned_integer
- (value_contents_all (psw_val).data (), 4,
+ (psw_val->contents_all ().data (), 4,
gdbarch_byte_order (get_frame_arch (this_frame)));
if ((psw & 0x20000 /* U bit */) != 0)
for (i = 0; i < nargs; i++)
{
struct value *arg = args[i];
- const gdb_byte *arg_bits = value_contents_all (arg).data ();
+ const gdb_byte *arg_bits = arg->contents_all ().data ();
struct type *arg_type = check_typedef (arg->type ());
ULONGEST arg_size = arg_type->length ();
it occupies the leftmost bits. */
if (write_mode)
as->regcache->cooked_write_part (S390_F0_REGNUM + as->fr, 0, length,
- value_contents (arg).data ());
+ arg->contents ().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).data (),
+ write_memory (as->argp - length, arg->contents ().data (),
length);
}
}
if (write_mode)
as->regcache->cooked_write_part (regnum, 0, length,
- value_contents (arg).data ());
+ arg->contents ().data ());
as->vr++;
}
else
{
if (write_mode)
- write_memory (as->argp, value_contents (arg).data (), length);
+ write_memory (as->argp, arg->contents ().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).data (),
+ ? extract_unsigned_integer (arg->contents ().data (),
length, byte_order)
- : extract_signed_integer (value_contents (arg).data (),
+ : extract_signed_integer (arg->contents ().data (),
length, byte_order);
}
if (write_mode)
{
as->regcache->cooked_write (S390_R0_REGNUM + as->gr,
- value_contents (arg).data ());
+ arg->contents ().data ());
as->regcache->cooked_write
(S390_R0_REGNUM + as->gr + 1,
- value_contents (arg).data () + word_size);
+ arg->contents ().data () + word_size);
}
as->gr += 2;
}
as->gr = 7;
if (write_mode)
- write_memory (as->argp, value_contents (arg).data (), length);
+ write_memory (as->argp, arg->contents ().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).data (), length);
+ write_memory (as->copy, arg->contents ().data (), length);
if (as->gr <= 6)
{
{
/* 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).data (), len);
+ memcpy (valbuf + (4 - len), val->contents ().data (), len);
else
- memcpy (valbuf, value_contents (val).data (), len);
+ memcpy (valbuf, val->contents ().data (), len);
return valbuf;
}
- return value_contents (val).data ();
+ return val->contents ().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]).data (), len);
+ write_memory (sp, args[i]->contents ().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]).data ();
+ const bfd_byte *valbuf = args[i]->contents ().data ();
struct type *type = args[i]->type ();
int len = type->length ();
gdb_byte buf[4];
a problem. */
sp &= ~0xf;
- write_memory (sp, value_contents (args[i]).data (), len);
+ write_memory (sp, args[i]->contents ().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]).data ();
+ const gdb_byte *valbuf = args[i]->contents ().data ();
struct type *type = args[i]->type ();
int len = type->length ();
int regnum = -1;
int sp_size = register_size (gdbarch, sp_regnum);
sp = extract_unsigned_integer
- (value_contents_all (value).data (), sp_size, byte_order);
+ (value->contents_all ().data (), sp_size, byte_order);
gdb_printf (" Previous frame's sp is ");
gdb_puts (paddress (gdbarch, sp));
gdbarch_return_value_as_value
(cache_arch, function, return_type,
get_current_regcache (), NULL /*read*/,
- value_contents (return_value).data () /*write*/);
+ return_value->contents ().data () /*write*/);
}
/* If we are at the end of a call dummy now, pop the dummy frame
int len = arg_type->length ();
enum type_code typecode = arg_type->code ();
- val = value_contents (arg).data ();
+ val = arg->contents ().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]).data ();
+ val = args[i]->contents ().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]).data ();
+ const gdb_byte *contents = args[j]->contents ().data ();
typelen = args[j]->enclosing_type ()->length ();
slacklen = align_up (typelen, 8) - typelen;
else
{
len = (*args)->type ()->length ();
- val = (gdb_byte *) value_contents (*args).data ();
+ val = (gdb_byte *) (*args)->contents ().data ();
}
if (tdep->eight_byte_align
struct value *result = value::allocate (atype);
gdb::array_view<gdb_byte> contents = result->contents_raw ();
- gdb::array_view<const gdb_byte> lhs_contents = value_contents (arg1);
- gdb::array_view<const gdb_byte> rhs_contents = value_contents (arg2);
+ gdb::array_view<const gdb_byte> lhs_contents = arg1->contents ();
+ gdb::array_view<const gdb_byte> rhs_contents = arg2->contents ();
gdb::copy (lhs_contents, contents.slice (0, lhs_contents.size ()));
gdb::copy (rhs_contents, contents.slice (lhs_contents.size ()));
if (is_floating_type (type1))
{
*eff_type_x = type1;
- memcpy (x, value_contents (arg1).data (), type1->length ());
+ memcpy (x, arg1->contents ().data (), type1->length ());
}
else if (is_integral_type (type1))
{
if (is_floating_type (type2))
{
*eff_type_y = type2;
- memcpy (y, value_contents (arg2).data (), type2->length ());
+ memcpy (y, arg2->contents ().data (), type2->length ());
}
else if (is_integral_type (type2))
{
type2 = type1;
}
- v1.read_fixed_point (value_contents (arg1),
+ v1.read_fixed_point (arg1->contents (),
type_byte_order (type1), type1->is_unsigned (),
type1->fixed_point_scaling_factor ());
- v2.read_fixed_point (value_contents (arg2),
+ v2.read_fixed_point (arg2->contents (),
type_byte_order (type2), type2->is_unsigned (),
type2->fixed_point_scaling_factor ());
}
for (i = 0; i < high_bound - low_bound + 1; i++)
/* Duplicate the contents of elval into the destination vector. */
- copy (value_contents_all (elval),
+ copy (elval->contents_all (),
val_contents.slice (i * elt_len, elt_len));
return val;
{
value *tmp = value_binop (value_subscript (val1, i),
value_subscript (val2, i), op);
- copy (value_contents_all (tmp),
+ copy (tmp->contents_all (),
val_contents.slice (i * elsize, elsize));
}
type1 = check_typedef (arg1->type ());
if (is_floating_value (arg1))
- return target_float_is_zero (value_contents (arg1).data (), type1);
+ return target_float_is_zero (arg1->contents ().data (), type1);
len = type1->length ();
- p = value_contents (arg1).data ();
+ p = arg1->contents ().data ();
while (--len >= 0)
{
{
int len1 = arg1->type ()->length ();
int len2 = arg2->type ()->length ();
- const gdb_byte *s1 = value_contents (arg1).data ();
- const gdb_byte *s2 = value_contents (arg2).data ();
+ const gdb_byte *s1 = arg1->contents ().data ();
+ const gdb_byte *s2 = arg2->contents ().data ();
int i, len = len1 < len2 ? len1 : len2;
for (i = 0; i < len; i++)
&& ((len = (int) type1->length ())
== (int) type2->length ()))
{
- p1 = value_contents (arg1).data ();
- p2 = value_contents (arg2).data ();
+ p1 = arg1->contents ().data ();
+ p2 = arg2->contents ().data ();
while (--len >= 0)
{
if (*p1++ != *p2++)
return (type1->code () == type2->code ()
&& type1->length () == type2->length ()
- && memcmp (value_contents (arg1).data (),
- value_contents (arg2).data (),
+ && memcmp (arg1->contents ().data (),
+ arg2->contents ().data (),
type1->length ()) == 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).data ());
+ return value_from_contents (type, arg1->contents ().data ());
else
error (_("Argument to positive operation not a number."));
}
for (i = 0; i < high_bound - low_bound + 1; i++)
{
value *tmp = value_neg (value_subscript (arg1, i));
- copy (value_contents_all (tmp),
+ copy (tmp->contents_all (),
val_contents.slice (i * elt_len, elt_len));
}
return val;
for (i = 0; i < high_bound - low_bound + 1; i++)
{
value *tmp = value_complement (value_subscript (arg1, i));
- copy (value_contents_all (tmp),
+ copy (tmp->contents_all (),
val_contents.slice (i * elt_len, elt_len));
}
}
&& 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).data (),
+ member = value_bit_index (settype, set->contents ().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).data (),
+ double d = target_float_to_host_double (value->contents ().data (),
type);
mpq_set_d (result.val, d);
}
|| is_fixed_point_type (type));
gdb_mpz vz;
- vz.read (value_contents (value), type_byte_order (type),
+ vz.read (value->contents (), type_byte_order (type),
type->is_unsigned ());
mpq_set_z (result.val, vz.val);
if (is_floating_value (arg2))
{
struct value *v = value::allocate (to_type);
- target_float_convert (value_contents (arg2).data (), type2,
+ target_float_convert (arg2->contents ().data (), type2,
v->contents_raw ().data (), type);
return v;
}
{
gdb_mpq fp_val;
- fp_val.read_fixed_point (value_contents (arg2),
+ fp_val.read_fixed_point (arg2->contents (),
type_byte_order (type2),
type2->is_unsigned (),
type2->fixed_point_scaling_factor ());
bits. */
if (code2 == TYPE_CODE_PTR)
longest = extract_unsigned_integer
- (value_contents (arg2), type_byte_order (type2));
+ (arg2->contents (), type_byte_order (type2));
else
longest = value_as_long (arg2);
return value_from_longest (to_type, convert_to_boolean ?
return tem;
result = NULL;
if (dynamic_cast_check_1 (resolved_type->target_type (),
- value_contents_for_printing (tem).data (),
+ tem->contents_for_printing ().data (),
tem->embedded_offset (),
tem->address (), tem,
rtti_type, addr,
result = NULL;
if (is_public_ancestor (arg_type, rtti_type)
&& dynamic_cast_check_2 (resolved_type->target_type (),
- value_contents_for_printing (tem).data (),
+ tem->contents_for_printing ().data (),
tem->embedded_offset (),
tem->address (), tem,
rtti_type, &result) == 1)
for (i = 0; i < high_bound - low_bound + 1; i++)
{
value *tmp = value_one (eltype);
- copy (value_contents_all (tmp),
+ copy (tmp->contents_all (),
val_contents.slice (i * elt_len, elt_len));
}
}
{
changed_addr = toval->address ();
changed_len = type_length_units (type);
- dest_buffer = value_contents (fromval).data ();
+ dest_buffer = fromval->contents ().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).data ());
+ fromval->contents ().data ());
}
else
put_frame_register_bytes (frame, value_reg,
toval->offset (),
- value_contents (fromval));
+ fromval->contents ());
}
gdb::observers::register_changed.notify (frame, value_reg);
implies the returned value is not lazy, even if TOVAL was. */
val = value_copy (toval);
val->set_lazy (0);
- copy (value_contents (fromval), val->contents_raw ());
+ copy (fromval->contents (), val->contents_raw ());
/* We copy over the enclosing type and pointed-to offset from FROMVAL
in the case of pointer types. For object types, the enclosing type
length = check_typedef (val->type ())->length ();
addr = allocate_space_in_inferior (length);
- write_memory (addr, value_contents (val).data (), length);
+ write_memory (addr, val->contents ().data (), length);
return value_at_lazy (val->type (), addr);
}
struct value *v2;
boffset = baseclass_offset (type, i,
- value_contents_for_printing (arg1).data (),
+ arg1->contents_for_printing ().data (),
arg1->embedded_offset () + offset,
arg1->address (),
arg1);
base_val = value_from_contents_and_address (baseclass,
tmp.data (),
address + offset);
- base_valaddr = value_contents_for_printing (base_val).data ();
+ base_valaddr = base_val->contents_for_printing ().data ();
this_offset = 0;
}
else
{
base_val = *arg1p;
- base_valaddr = value_contents_for_printing (*arg1p).data ();
+ base_valaddr = (*arg1p)->contents_for_printing ().data ();
this_offset = offset;
}
if (BASETYPE_VIA_VIRTUAL (type, i))
{
base_offset = baseclass_offset (type, i,
- value_contents_for_printing (*argp).data (),
+ (*argp)->contents_for_printing ().data (),
(*argp)->offset () + offset,
(*argp)->address (), *argp);
}
{
if (BASETYPE_VIA_VIRTUAL (vt, i))
{
- const gdb_byte *adr = value_contents_for_printing (v).data ();
+ const gdb_byte *adr = v->contents_for_printing ().data ();
*boffs = baseclass_offset (vt, i, adr, v->offset (),
value_as_long (v), v);
*isvirt = true;
{
if (*isvirt == false) /* Add non-virtual base offset. */
{
- const gdb_byte *adr = value_contents_for_printing (v).data ();
+ const gdb_byte *adr = v->contents_for_printing ().data ();
*boffs += baseclass_offset (vt, i, adr, v->offset (),
value_as_long (v), v);
}
int len = real_type->length ();
- copy (value_contents (arg1),
+ copy (arg1->contents (),
val->contents_raw ().slice (0, len));
- copy (value_contents (arg2),
+ copy (arg2->contents (),
val->contents_raw ().slice (len, len));
return val;
struct value *im_val = value::allocate (val_real_type);
int len = val_real_type->length ();
- copy (value_contents (val).slice (0, len),
+ copy (val->contents ().slice (0, len),
re_val->contents_raw ());
- copy (value_contents (val).slice (len, len),
+ copy (val->contents ().slice (len, len),
im_val->contents_raw ());
return value_literal_complex (re_val, im_val, type);
{
struct type *type = check_typedef (val->type ());
struct type *elttype = check_typedef (type->target_type ());
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
CORE_ADDR addr = unpack_pointer (type, valaddr);
print_unpacked_pointer (type, elttype, addr, stream, options);
gdb_assert (deref_val != NULL);
if (deref_val->lval () == lval_memory)
- return value_contents_for_printing_const (value_addr (deref_val)).data ();
+ return value_addr (deref_val)->contents_for_printing ().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).data ();
+ const gdb_byte *valaddr = original_value->contents_for_printing ().data ();
if (must_coerce_ref && type_is_defined)
{
gdb_assert (!options->format);
- const gdb_byte *valaddr = value_contents_for_printing (original_value).data ();
+ const gdb_byte *valaddr = original_value->contents_for_printing ().data ();
val = unpack_long (type, valaddr + embedded_offset * unit_size);
}
else
{
- const gdb_byte *valaddr = value_contents_for_printing (value).data ();
+ const gdb_byte *valaddr = value->contents_for_printing ().data ();
struct type *type = check_typedef (value->type ());
LONGEST val = unpack_long (type, valaddr);
if (val == 0)
{
struct type *unresolved_type = value->type ();
struct type *type = check_typedef (unresolved_type);
- const gdb_byte *valaddr = value_contents_for_printing (value).data ();
+ const gdb_byte *valaddr = value->contents_for_printing ().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).data ();
+ const gdb_byte *valaddr = original_value->contents_for_printing ().data ();
print_floating (valaddr, type, stream);
}
{
struct type *type = val->type ();
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
gdb_mpf f;
f.read_fixed_point (gdb::make_array_view (valaddr, type->length ()),
/* 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 (val->type ());
- const gdb_byte *valaddr = value_contents_for_printing (val).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
cp_print_class_member (valaddr, type, stream, "&");
}
else
break;
case TYPE_CODE_METHODPTR:
- cplus_print_method_ptr (value_contents_for_printing (val).data (), type,
+ cplus_print_method_ptr (val->contents_for_printing ().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).data ()
+ const gdb_byte *valaddr = (original_value->contents_for_printing ().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).data ();
+ const gdb_byte *valaddr = val->contents_for_printing ().data ();
/* A scalar object that does not have all bits available can't be
printed, because all bits contribute to its representation. */
throw_error (OPTIMIZED_OUT_ERROR, _("value has been optimized out"));
}
-static void
-require_not_optimized_out (const struct value *value)
+void
+value::require_not_optimized_out () const
{
- if (!value->m_optimized_out.empty ())
+ if (!m_optimized_out.empty ())
{
- if (value->m_lval == lval_register)
+ if (m_lval == lval_register)
throw_error (OPTIMIZED_OUT_ERROR,
_("register has not been saved in frame"));
else
}
}
-static void
-require_available (const struct value *value)
+void
+value::require_available () const
{
- if (!value->m_unavailable.empty ())
+ if (!m_unavailable.empty ())
throw_error (NOT_AVAILABLE_ERROR, _("value is not available"));
}
gdb::array_view<const gdb_byte>
-value_contents_for_printing (struct value *value)
+value::contents_for_printing ()
{
- if (value->m_lazy)
- value->fetch_lazy ();
+ if (m_lazy)
+ fetch_lazy ();
- ULONGEST length = value->enclosing_type ()->length ();
- return gdb::make_array_view (value->m_contents.get (), length);
+ ULONGEST length = enclosing_type ()->length ();
+ return gdb::make_array_view (m_contents.get (), length);
}
gdb::array_view<const gdb_byte>
-value_contents_for_printing_const (const struct value *value)
+value::contents_for_printing () const
{
- gdb_assert (!value->m_lazy);
+ gdb_assert (!m_lazy);
- ULONGEST length = value->enclosing_type ()->length ();
- return gdb::make_array_view (value->m_contents.get (), length);
+ ULONGEST length = enclosing_type ()->length ();
+ return gdb::make_array_view (m_contents.get (), length);
}
gdb::array_view<const gdb_byte>
-value_contents_all (struct value *value)
+value::contents_all ()
{
- gdb::array_view<const gdb_byte> result = value_contents_for_printing (value);
- require_not_optimized_out (value);
- require_available (value);
+ gdb::array_view<const gdb_byte> result = contents_for_printing ();
+ require_not_optimized_out ();
+ require_available ();
return result;
}
}
gdb::array_view<const gdb_byte>
-value_contents (struct value *value)
+value::contents ()
{
- gdb::array_view<const gdb_byte> result = value->contents_writeable ();
- require_not_optimized_out (value);
- require_available (value);
+ gdb::array_view<const gdb_byte> result = contents_writeable ();
+ require_not_optimized_out ();
+ require_available ();
return result;
}
struct type *enc_type = arg->enclosing_type ();
struct value *val = value::allocate (enc_type);
- copy (value_contents_all (arg), val->contents_all_raw ());
+ copy (arg->contents_all (), val->contents_all_raw ());
val->m_type = arg->m_type;
val->set_embedded_offset (arg->embedded_offset ());
val->set_pointed_to_offset (arg->pointed_to_offset ());
modify_field (var->u.value->type (), addr + offset,
value_as_long (newval), bitpos, bitsize);
else
- memcpy (addr + offset * unit_size, value_contents (newval).data (),
+ memcpy (addr + offset * unit_size, newval->contents ().data (),
newval->type ()->length ());
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 (val->type (), value_contents (val).data ());
+ return unpack_long (val->type (), val->contents ().data ());
}
/* Extract a value as a C pointer. Does not deallocate the value.
if (!val->type ()->is_pointer_or_reference ()
&& gdbarch_integer_to_address_p (gdbarch))
return gdbarch_integer_to_address (gdbarch, val->type (),
- value_contents (val).data ());
+ val->contents ().data ());
- return unpack_long (val->type (), value_contents (val).data ());
+ return unpack_long (val->type (), val->contents ().data ());
#endif
}
\f
if (is_floating_type (type))
{
- if (!target_float_is_valid (value_contents (val).data (), type))
+ if (!target_float_is_valid (val->contents ().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).data (),
+ arg1->contents ().data (),
arg1->embedded_offset (),
arg1->address (),
arg1);
enc_type = check_typedef (arg->enclosing_type ());
enc_type = enc_type->target_type ();
- CORE_ADDR addr = unpack_pointer (arg->type (), value_contents (arg).data ());
+ CORE_ADDR addr = unpack_pointer (arg->type (), arg->contents ().data ());
retval = value_at_lazy (enc_type, addr);
enc_type = retval->type ();
return readjust_indirect_value_type (retval, enc_type, value_type_arg_tmp,
parent->fetch_lazy ();
unpack_value_bitfield (this, bitpos (), bitsize (),
- value_contents_for_printing (parent).data (),
+ parent->contents_for_printing ().data (),
offset (), parent);
}
else
{
int i;
- gdb::array_view<const gdb_byte> buf = value_contents (new_val);
+ gdb::array_view<const gdb_byte> buf = new_val->contents ();
if (VALUE_LVAL (new_val) == lval_register)
gdb_printf (&debug_file, " register=%d",
When we store the entire object, `enclosing_type' is the run-time
type -- the complete object -- and `embedded_offset' is the offset
- of `type' within that larger type, in bytes. The value_contents()
- macro takes `embedded_offset' into account, so most GDB code
+ of `type' within that larger type, in bytes. The contents()
+ method takes `embedded_offset' into account, so most GDB code
continues to see the `type' portion of the value, just as the
inferior would.
get to the real subobject, if the value happens to represent
something embedded in a larger run-time object. */
gdb::array_view<gdb_byte> contents_raw ();
+
+ /* Actual contents of the value. For use of this value; setting it
+ uses the stuff above. Not valid if lazy is nonzero. Target
+ byte-order. We force it to be aligned properly for any possible
+ value. Note that a value therefore extends beyond what is
+ declared here. */
+ gdb::array_view<const gdb_byte> contents ();
+
+ /* The ALL variants of the above two methods do not adjust the
+ returned pointer by the embedded_offset value. */
+ gdb::array_view<const gdb_byte> contents_all ();
gdb::array_view<gdb_byte> contents_all_raw ();
+
gdb::array_view<gdb_byte> contents_writeable ();
+ /* Like 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. */
+ gdb::array_view<const gdb_byte> contents_for_printing ();
+
+ /* Like contents_for_printing, but accepts a constant value pointer.
+ Unlike contents_for_printing however, the pointed value must
+ _not_ be lazy. */
+ gdb::array_view<const gdb_byte> contents_for_printing () const;
+
/* Load the actual content of a lazy value. Fetch the data from the
user's process and clear the lazy flag to indicate that the data in
the buffer is valid.
When we store the entire object, `enclosing_type' is the run-time
type -- the complete object -- and `embedded_offset' is the
offset of `type' within that larger type, in target addressable memory
- units. The value_contents() macro takes `embedded_offset' into account,
+ units. The contents() method takes `embedded_offset' into account,
so most GDB code continues to see the `type' portion of the value, just
as the inferior would.
bits. Return true if the available bits match. */
bool contents_bits_eq (int offset1, const struct value *val2, int offset2,
int length) const;
+
+ void require_not_optimized_out () const;
+ void require_available () const;
};
inline void
extern void error_value_optimized_out (void);
-/* Actual contents of the value. For use of this value; setting it
- uses the stuff above. Not valid if lazy is nonzero. Target
- byte-order. We force it to be aligned properly for any possible
- value. Note that a value therefore extends beyond what is
- declared here. */
-
-extern gdb::array_view<const gdb_byte> value_contents (struct value *);
-
-/* The ALL variants of the above two macros do not adjust the returned
- pointer by the embedded_offset value. */
-
-extern gdb::array_view<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 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 gdb::array_view<const gdb_byte>
- value_contents_for_printing_const (const struct value *value);
-
/* If nonzero, this is the value of a variable which does not actually
exist in the program, at least partially. If the value is lazy,
this may fetch it now. */
sp -= (len + 3) & ~3;
count += (len + 3) / 4;
- write_memory (sp, value_contents_all (args[i]).data (), len);
+ write_memory (sp, args[i]->contents_all ().data (), len);
}
/* Push argument count. */
break;
/* Put argument into registers wordwise. */
- const gdb_byte *val = value_contents (args[i]).data ();
+ const gdb_byte *val = args[i]->contents ().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]).data ();
+ const gdb_byte *bytes = args[j]->contents ().data ();
typelen = args[j]->enclosing_type ()->length ();
slacklen = typelen & 1;
break;
}
gdb_printf (gdb_stdlog, " %s\n",
- host_address_to_string (value_contents (arg).data ()));
+ host_address_to_string (arg->contents ().data ()));
}
}
break;
}
info->length = arg_type->length ();
- info->contents = value_contents (arg).data ();
+ info->contents = arg->contents ().data ();
/* Align size and onstack_size. */
size = (size + info->align - 1) & ~(info->align - 1);