This patch turns a grab bag of value functions to methods of value.
These are done together because their implementations are
interrelated.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
if (field_is_static (&arg_type->field (i)))
continue;
- struct value *field = value_primitive_field (arg, 0, i, arg_type);
+ struct value *field = arg->primitive_field (0, i, arg_type);
struct type *field_type = check_typedef (field->type ());
if (!pass_in_v_vfp_candidate (gdbarch, regcache, info, field_type,
else
{
result = value::allocate (type);
- value_contents_copy (result, 0, val, 0, type->length ());
+ val->contents_copy (result, 0, 0, type->length ());
}
result->set_component_location (val);
result->set_bitsize (val->bitsize ());
bit_pos % 8, bit_size, type);
}
else
- return value_primitive_field (arg1, offset, fieldno, arg_type);
+ return arg1->primitive_field (offset, fieldno, arg_type);
}
/* Find field with name NAME in object of type TYPE. If found,
bit_val = value::allocate (val->type ());
- unpack_value_bitfield (bit_val,
- w->val_bitpos,
- w->val_bitsize,
- val->contents_for_printing ().data (),
- val->offset (),
- val);
+ val->unpack_bitfield (bit_val,
+ w->val_bitpos,
+ w->val_bitsize,
+ val->contents_for_printing ().data (),
+ val->offset ());
return bit_val;
}
if (field_is_static (&type->field (type_index)))
result = value_static_field (type, type_index);
else
- result = value_primitive_field (value, 0, type_index, type);
+ result = value->primitive_field (0, type_index, type);
}
catch (const gdb_exception_error &e)
{
}
else
{
- struct value *v = value_primitive_field (val, 0, i, type);
+ struct value *v = val->primitive_field (0, i, type);
opts->deref_ref = false;
common_val_print (v, stream, recurse + 1, opts,
current_language);
if (!val_print_check_max_depth (stream, recurse, options,
current_language))
{
- struct value *baseclass_val = value_primitive_field (val, 0,
- i, type);
+ struct value *baseclass_val = val->primitive_field (0,
+ i, type);
/* Attempt to run an extension language pretty-printer on the
baseclass if possible. */
generic optimized out value instead, so that we show
<optimized out> instead of <not saved>. */
value *tmp = value::allocate (subobj_type);
- value_contents_copy (tmp, 0, retval, 0,
- subobj_type->length ());
+ retval->contents_copy (tmp, 0, 0,
+ subobj_type->length ());
retval = tmp;
}
}
error (_("length type is larger than the value type"));
struct value *result = value::allocate (type);
- value_contents_copy (result, 0, old_value, 0, type->length ());
+ old_value->contents_copy (result, 0, 0, type->length ());
return result;
}
gdb_assert (dst_offset + v->type ()->length ()
<= result->type ()->length ());
gdb_assert (v->type ()->length () == elm_len);
- value_contents_copy (result, dst_offset, v, 0, elm_len);
+ v->contents_copy (result, dst_offset, 0, elm_len);
/* Peel another dimension of the array. */
array_type = array_type->target_type ();
available offset. */
void copy_element_to_dest (struct value *elt)
{
- value_contents_copy (m_dest, m_dest_offset, elt, 0,
- elt->type ()->length ());
+ elt->contents_copy (m_dest, m_dest_offset, 0,
+ elt->type ()->length ());
m_dest_offset += elt->type ()->length ();
}
gdb_assert (dst_offset + v->type ()->length ()
<= result->type ()->length ());
gdb_assert (v->type ()->length () == elm_len);
- value_contents_copy (result, dst_offset, v, 0, elm_len);
+ v->contents_copy (result, dst_offset, 0, elm_len);
/* Peel another dimension of the array. */
val_type = val_type->target_type ();
if (reg_len > len)
reg_len = len;
- value_contents_copy (value, offset, regval, reg_offset, reg_len);
+ regval->contents_copy (value, offset, reg_offset, reg_len);
offset += reg_len;
len -= reg_len;
/* The virtual function table is now an array of structures
which have the form { int16 offset, delta; void *pfn; }. */
- vtbl = value_primitive_field (arg1, 0, context_vptr_fieldno,
+ vtbl = arg1->primitive_field (0, context_vptr_fieldno,
context_vptr_basetype);
/* With older versions of g++, the vtbl field pointed to an array
opts.deref_ref = false;
- struct value *v = value_primitive_field (val, 0, i,
- val->type ());
+ struct value *v = val->primitive_field (0, i,
+ val->type ());
common_val_print (v, stream, recurse + 1, &opts,
current_language);
}
struct value *base_value;
try
{
- base_value = value_primitive_field (val, 0, i, type);
+ base_value = val->primitive_field (0, i, type);
}
catch (const gdb_exception_error &ex)
{
field_number, type->name ());
int fieldno = rust_enum_variant (type);
- lhs = value_primitive_field (lhs, 0, fieldno, type);
+ lhs = lhs->primitive_field (0, fieldno, type);
outer_type = type;
type = lhs->type ();
}
field_number, type->name ());
}
- return value_primitive_field (lhs, 0, field_number, type);
+ return lhs->primitive_field (0, field_number, type);
}
else
error(_("Anonymous field access is only allowed on tuples, \
field_name, type->name ());
int fieldno = rust_enum_variant (type);
- lhs = value_primitive_field (lhs, 0, fieldno, type);
+ lhs = lhs->primitive_field (0, fieldno, type);
struct type *outer_type = type;
type = lhs->type ();
{
val = value::allocate (arraytype);
for (idx = 0; idx < nelem; idx++)
- value_contents_copy (val, idx * typelength, elemvec[idx], 0,
- typelength);
+ elemvec[idx]->contents_copy (val, idx * typelength, 0, typelength);
return val;
}
val = value::allocate (arraytype);
for (idx = 0; idx < nelem; idx++)
- value_contents_copy (val, idx * typelength, elemvec[idx], 0, typelength);
+ elemvec[idx]->contents_copy (val, idx * typelength, 0, typelength);
return val;
}
if (field_is_static (&type->field (i)))
v = value_static_field (type, i);
else
- v = value_primitive_field (arg1, offset, i, type);
+ v = arg1->primitive_field (offset, i, type);
update_result (v, offset);
return;
search (v2, 0, TYPE_BASECLASS (type, i));
}
else if (found_baseclass)
- v = value_primitive_field (arg1, offset, i, type);
+ v = arg1->primitive_field (offset, i, type);
else
{
search (arg1, offset + TYPE_BASECLASS_BITPOS (type, i) / 8,
if (!field_is_static (&t->field (i))
&& bitpos == t->field (i).loc_bitpos ()
&& types_equal (ftype, t->field (i).type ()))
- return value_primitive_field (*argp, 0, i, t);
+ return (*argp)->primitive_field (0, i, t);
}
error (_("No field with matching bitpos and type."));
else
{
slice = value::allocate (slice_type);
- value_contents_copy (slice, 0, array, offset,
- type_length_units (slice_type));
+ array->contents_copy (slice, 0, offset,
+ type_length_units (slice_type));
}
slice->set_component_location (array);
maybe_print_array_index (index_type, i + low_bound,
stream, options);
- struct value *element = value_from_component_bitsize (val, elttype,
- bit_stride * i,
- bit_stride);
+ struct value *element = val->from_component_bitsize (elttype,
+ bit_stride * i,
+ bit_stride);
rep1 = i + 1;
reps = 1;
/* Only check for reps if repeat_count_threshold is not set to
while (rep1 < len)
{
struct value *rep_elt
- = value_from_component_bitsize (val, elttype,
- rep1 * bit_stride,
- bit_stride);
+ = val->from_component_bitsize (elttype,
+ rep1 * bit_stride,
+ bit_stride);
bool repeated = ((available
&& rep_elt->entirely_available ()
&& element->contents_eq (rep_elt))
}
}
-/* Copy the ranges metadata in SRC that overlaps [SRC_BIT_OFFSET,
- SRC_BIT_OFFSET+BIT_LENGTH) into DST, adjusted. */
+/* See value.h. */
-static void
-value_ranges_copy_adjusted (struct value *dst, int dst_bit_offset,
- const struct value *src, int src_bit_offset,
- int bit_length)
+void
+value::ranges_copy_adjusted (struct value *dst, int dst_bit_offset,
+ int src_bit_offset, int bit_length) const
{
- ranges_copy_adjusted (&dst->m_unavailable, dst_bit_offset,
- src->m_unavailable, src_bit_offset,
- bit_length);
- ranges_copy_adjusted (&dst->m_optimized_out, dst_bit_offset,
- src->m_optimized_out, src_bit_offset,
- bit_length);
+ ::ranges_copy_adjusted (&dst->m_unavailable, dst_bit_offset,
+ m_unavailable, src_bit_offset,
+ bit_length);
+ ::ranges_copy_adjusted (&dst->m_optimized_out, dst_bit_offset,
+ m_optimized_out, src_bit_offset,
+ bit_length);
}
-/* Copy LENGTH target addressable memory units of SRC value's (all) contents
- (value_contents_all) starting at SRC_OFFSET, into DST value's (all)
- contents, starting at DST_OFFSET. If unavailable contents are
- being copied from SRC, the corresponding DST contents are marked
- unavailable accordingly. Neither DST nor SRC may be lazy
- values.
-
- It is assumed the contents of DST in the [DST_OFFSET,
- DST_OFFSET+LENGTH) range are wholly available. */
+/* See value.h. */
-static void
-value_contents_copy_raw (struct value *dst, LONGEST dst_offset,
- struct value *src, LONGEST src_offset, LONGEST length)
+void
+value::contents_copy_raw (struct value *dst, LONGEST dst_offset,
+ LONGEST src_offset, LONGEST length)
{
LONGEST src_bit_offset, dst_bit_offset, bit_length;
- struct gdbarch *arch = src->arch ();
- int unit_size = gdbarch_addressable_memory_unit_size (arch);
+ int unit_size = gdbarch_addressable_memory_unit_size (arch ());
/* A lazy DST would make that this copy operation useless, since as
soon as DST's contents were un-lazied (by a later value_contents
call, say), the contents would be overwritten. A lazy SRC would
mean we'd be copying garbage. */
- gdb_assert (!dst->m_lazy && !src->m_lazy);
+ gdb_assert (!dst->m_lazy && !m_lazy);
/* The overwritten DST range gets unavailability ORed in, not
replaced. Make sure to remember to implement replacing if it
= dst->contents_all_raw ().slice (dst_offset * unit_size,
length * unit_size);
gdb::array_view<const gdb_byte> src_contents
- = src->contents_all_raw ().slice (src_offset * unit_size,
- length * unit_size);
+ = contents_all_raw ().slice (src_offset * unit_size,
+ length * unit_size);
gdb::copy (src_contents, dst_contents);
/* Copy the meta-data, adjusted. */
dst_bit_offset = dst_offset * unit_size * HOST_CHAR_BIT;
bit_length = length * unit_size * HOST_CHAR_BIT;
- value_ranges_copy_adjusted (dst, dst_bit_offset,
- src, src_bit_offset,
- bit_length);
+ ranges_copy_adjusted (dst, dst_bit_offset,
+ src_bit_offset, bit_length);
}
-/* A helper for value_from_component_bitsize that copies bits from SRC
- to DEST. */
+/* See value.h. */
-static void
-value_contents_copy_raw_bitwise (struct value *dst, LONGEST dst_bit_offset,
- struct value *src, LONGEST src_bit_offset,
- LONGEST bit_length)
+void
+value::contents_copy_raw_bitwise (struct value *dst, LONGEST dst_bit_offset,
+ LONGEST src_bit_offset,
+ LONGEST bit_length)
{
/* A lazy DST would make that this copy operation useless, since as
soon as DST's contents were un-lazied (by a later value_contents
call, say), the contents would be overwritten. A lazy SRC would
mean we'd be copying garbage. */
- gdb_assert (!dst->m_lazy && !src->m_lazy);
+ gdb_assert (!dst->m_lazy && !m_lazy);
/* The overwritten DST range gets unavailability ORed in, not
replaced. Make sure to remember to implement replacing if it
/* Copy the data. */
gdb::array_view<gdb_byte> dst_contents = dst->contents_all_raw ();
- gdb::array_view<const gdb_byte> src_contents = src->contents_all_raw ();
+ gdb::array_view<const gdb_byte> src_contents = contents_all_raw ();
copy_bitwise (dst_contents.data (), dst_bit_offset,
src_contents.data (), src_bit_offset,
bit_length,
- type_byte_order (src->type ()) == BFD_ENDIAN_BIG);
+ type_byte_order (type ()) == BFD_ENDIAN_BIG);
/* Copy the meta-data. */
- value_ranges_copy_adjusted (dst, dst_bit_offset,
- src, src_bit_offset,
- bit_length);
+ ranges_copy_adjusted (dst, dst_bit_offset, src_bit_offset, bit_length);
}
-/* Copy LENGTH bytes of SRC value's (all) contents
- (value_contents_all) starting at SRC_OFFSET byte, into DST value's
- (all) contents, starting at DST_OFFSET. If unavailable contents
- are being copied from SRC, the corresponding DST contents are
- marked unavailable accordingly. DST must not be lazy. If SRC is
- lazy, it will be fetched now.
-
- It is assumed the contents of DST in the [DST_OFFSET,
- DST_OFFSET+LENGTH) range are wholly available. */
+/* See value.h. */
void
-value_contents_copy (struct value *dst, LONGEST dst_offset,
- struct value *src, LONGEST src_offset, LONGEST length)
+value::contents_copy (struct value *dst, LONGEST dst_offset,
+ LONGEST src_offset, LONGEST length)
{
- if (src->m_lazy)
- src->fetch_lazy ();
+ if (m_lazy)
+ fetch_lazy ();
- value_contents_copy_raw (dst, dst_offset, src, src_offset, length);
+ contents_copy_raw (dst, dst_offset, src_offset, length);
}
gdb::array_view<const gdb_byte>
m_enclosing_type = new_encl_type;
}
-/* Given a value ARG1 (offset by OFFSET bytes)
- of a struct or union type ARG_TYPE,
- extract and return the value of one of its (non-static) fields.
- FIELDNO says which field. */
+/* See value.h. */
struct value *
-value_primitive_field (struct value *arg1, LONGEST offset,
- int fieldno, struct type *arg_type)
+value::primitive_field (LONGEST offset, int fieldno, struct type *arg_type)
{
struct value *v;
struct type *type;
- struct gdbarch *arch = arg1->arch ();
- int unit_size = gdbarch_addressable_memory_unit_size (arch);
+ int unit_size = gdbarch_addressable_memory_unit_size (arch ());
arg_type = check_typedef (arg_type);
type = arg_type->field (fieldno).type ();
v->set_bitpos (bitpos % container_bitsize);
else
v->set_bitpos (bitpos % 8);
- v->set_offset ((arg1->embedded_offset ()
+ v->set_offset ((embedded_offset ()
+ offset
+ (bitpos - v->bitpos ()) / 8));
- v->set_parent (arg1);
- if (!arg1->lazy ())
+ v->set_parent (this);
+ if (!lazy ())
v->fetch_lazy ();
}
else if (fieldno < TYPE_N_BASECLASSES (arg_type))
LONGEST boffset;
/* Lazy register values with offsets are not supported. */
- if (VALUE_LVAL (arg1) == lval_register && arg1->lazy ())
- arg1->fetch_lazy ();
+ if (VALUE_LVAL (this) == lval_register && lazy ())
+ fetch_lazy ();
/* We special case virtual inheritance here because this
requires access to the contents, which we would rather avoid
for references to ordinary fields of unavailable values. */
if (BASETYPE_VIA_VIRTUAL (arg_type, fieldno))
boffset = baseclass_offset (arg_type, fieldno,
- arg1->contents ().data (),
- arg1->embedded_offset (),
- arg1->address (),
- arg1);
+ contents ().data (),
+ embedded_offset (),
+ address (),
+ this);
else
boffset = arg_type->field (fieldno).loc_bitpos () / 8;
- if (arg1->lazy ())
- v = value::allocate_lazy (arg1->enclosing_type ());
+ if (lazy ())
+ v = value::allocate_lazy (enclosing_type ());
else
{
- v = value::allocate (arg1->enclosing_type ());
- value_contents_copy_raw (v, 0, arg1, 0,
- arg1->enclosing_type ()->length ());
+ v = value::allocate (enclosing_type ());
+ contents_copy_raw (v, 0, 0, enclosing_type ()->length ());
}
v->deprecated_set_type (type);
- v->set_offset (arg1->offset ());
- v->set_embedded_offset (offset + arg1->embedded_offset () + boffset);
+ v->set_offset (this->offset ());
+ v->set_embedded_offset (offset + embedded_offset () + boffset);
}
else if (NULL != TYPE_DATA_LOCATION (type))
{
/ (HOST_CHAR_BIT * unit_size));
/* Lazy register values with offsets are not supported. */
- if (VALUE_LVAL (arg1) == lval_register && arg1->lazy ())
- arg1->fetch_lazy ();
+ if (VALUE_LVAL (this) == lval_register && lazy ())
+ fetch_lazy ();
- if (arg1->lazy ())
+ if (lazy ())
v = value::allocate_lazy (type);
else
{
v = value::allocate (type);
- value_contents_copy_raw (v, v->embedded_offset (),
- arg1, arg1->embedded_offset () + offset,
- type_length_units (type));
+ contents_copy_raw (v, v->embedded_offset (),
+ embedded_offset () + offset,
+ type_length_units (type));
}
- v->set_offset ((arg1->offset () + offset
- + arg1->embedded_offset ()));
+ v->set_offset (this->offset () + offset + embedded_offset ());
}
- v->set_component_location (arg1);
+ v->set_component_location (this);
return v;
}
struct value *
value_field (struct value *arg1, int fieldno)
{
- return value_primitive_field (arg1, 0, fieldno, arg1->type ());
+ return arg1->primitive_field (0, fieldno, arg1->type ());
}
/* Return a non-virtual function as a value.
return unpack_bits_as_long (field_type, valaddr, bitpos, bitsize);
}
-/* Unpack a bitfield of BITSIZE bits found at BITPOS in the object at
- VALADDR + EMBEDDEDOFFSET that has the type of DEST_VAL and store
- the contents in DEST_VAL, zero or sign extending if the type of
- DEST_VAL is wider than BITSIZE. VALADDR points to the contents of
- VAL. If the VAL's contents required to extract the bitfield from
- are unavailable/optimized out, DEST_VAL is correspondingly
- marked unavailable/optimized out. */
+/* See value.h. */
void
-unpack_value_bitfield (struct value *dest_val,
- LONGEST bitpos, LONGEST bitsize,
- const gdb_byte *valaddr, LONGEST embedded_offset,
- const struct value *val)
+value::unpack_bitfield (struct value *dest_val,
+ LONGEST bitpos, LONGEST bitsize,
+ const gdb_byte *valaddr, LONGEST embedded_offset)
+ const
{
enum bfd_endian byte_order;
int src_bit_offset;
dst_bit_offset = field_type->length () * TARGET_CHAR_BIT - bitsize;
else
dst_bit_offset = 0;
- value_ranges_copy_adjusted (dest_val, dst_bit_offset,
- val, src_bit_offset, bitsize);
+ ranges_copy_adjusted (dest_val, dst_bit_offset, src_bit_offset, bitsize);
}
/* Return a new value with type TYPE, which is FIELDNO field of the
int bitsize = TYPE_FIELD_BITSIZE (type, fieldno);
struct value *res_val = value::allocate (type->field (fieldno).type ());
- unpack_value_bitfield (res_val, bitpos, bitsize,
- valaddr, embedded_offset, val);
+ val->unpack_bitfield (res_val, bitpos, bitsize, valaddr, embedded_offset);
return res_val;
}
else
{
v = value::allocate (type);
- value_contents_copy (v, v->embedded_offset (),
- whole, whole->embedded_offset () + offset,
- type_length_units (type));
+ whole->contents_copy (v, v->embedded_offset (),
+ whole->embedded_offset () + offset,
+ type_length_units (type));
}
v->set_offset (whole->offset () + offset + whole->embedded_offset ());
v->set_component_location (whole);
/* See value.h. */
struct value *
-value_from_component_bitsize (struct value *whole, struct type *type,
- LONGEST bit_offset, LONGEST bit_length)
+value::from_component_bitsize (struct type *type,
+ LONGEST bit_offset, LONGEST bit_length)
{
- gdb_assert (!whole->lazy ());
+ gdb_assert (!lazy ());
/* Preserve lvalue-ness if possible. This is needed to avoid
array-printing failures (including crashes) when printing Ada
if ((bit_offset % TARGET_CHAR_BIT) == 0
&& (bit_length % TARGET_CHAR_BIT) == 0
&& bit_length == TARGET_CHAR_BIT * type->length ())
- return value_from_component (whole, type, bit_offset / TARGET_CHAR_BIT);
+ return value_from_component (this, type, bit_offset / TARGET_CHAR_BIT);
struct value *v = value::allocate (type);
if (is_scalar_type (type) && type_byte_order (type) == BFD_ENDIAN_BIG)
dst_offset += TARGET_CHAR_BIT * type->length () - bit_length;
- value_contents_copy_raw_bitwise (v, dst_offset,
- whole,
- TARGET_CHAR_BIT
- * whole->embedded_offset ()
- + bit_offset,
- bit_length);
+ contents_copy_raw_bitwise (v, dst_offset,
+ TARGET_CHAR_BIT
+ * embedded_offset ()
+ + bit_offset,
+ bit_length);
return v;
}
if (parent->lazy ())
parent->fetch_lazy ();
- unpack_value_bitfield (this, bitpos (), bitsize (),
- parent->contents_for_printing ().data (),
- offset (), parent);
+ parent->unpack_bitfield (this, bitpos (), bitsize (),
+ parent->contents_for_printing ().data (),
+ offset ());
}
/* See value.h. */
/* Copy the contents and the unavailability/optimized-out
meta-data from NEW_VAL to VAL. */
set_lazy (0);
- value_contents_copy (this, embedded_offset (),
- new_val, new_val->embedded_offset (),
- type_length_units (type));
+ new_val->contents_copy (this, embedded_offset (),
+ new_val->embedded_offset (),
+ type_length_units (type));
if (frame_debug)
{
used to prevent cycles / duplicates. */
void preserve (struct objfile *objfile, htab_t copied_types);
+ /* Unpack a bitfield of BITSIZE bits found at BITPOS in the object
+ at VALADDR + EMBEDDEDOFFSET that has the type of DEST_VAL and
+ store the contents in DEST_VAL, zero or sign extending if the
+ type of DEST_VAL is wider than BITSIZE. VALADDR points to the
+ contents of this value. If this value's contents required to
+ extract the bitfield from are unavailable/optimized out, DEST_VAL
+ is correspondingly marked unavailable/optimized out. */
+ void unpack_bitfield (struct value *dest_val,
+ LONGEST bitpos, LONGEST bitsize,
+ const gdb_byte *valaddr, LONGEST embedded_offset)
+ const;
+
+ /* Copy LENGTH bytes of this value's (all) contents
+ (value_contents_all) starting at SRC_OFFSET byte, into DST
+ value's (all) contents, starting at DST_OFFSET. If unavailable
+ contents are being copied from this value, the corresponding DST
+ contents are marked unavailable accordingly. DST must not be
+ lazy. If this value is lazy, it will be fetched now.
+
+ It is assumed the contents of DST in the [DST_OFFSET,
+ DST_OFFSET+LENGTH) range are wholly available. */
+ void contents_copy (struct value *dst, LONGEST dst_offset,
+ LONGEST src_offset, LONGEST length);
+
+ /* Given a value (offset by OFFSET bytes)
+ of a struct or union type ARG_TYPE,
+ extract and return the value of one of its (non-static) fields.
+ FIELDNO says which field. */
+ struct value *primitive_field (LONGEST offset, int fieldno,
+ struct type *arg_type);
+
+ /* Create a new value by extracting it from this value. TYPE is the
+ type of the new value. BIT_OFFSET and BIT_LENGTH describe the
+ offset and field width of the value to extract from this value --
+ BIT_LENGTH may differ from TYPE's length in the case where this
+ value's type is packed.
+
+ When the value does come from a non-byte-aligned offset or field
+ width, it will be marked non_lval. */
+ struct value *from_component_bitsize (struct type *type,
+ LONGEST bit_offset,
+ LONGEST bit_length);
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
value is lazy, it'll be read now. Note that RANGE is a pointer
to pointer because reading the value might change *RANGE. */
int entirely_covered_by_range_vector (const std::vector<range> &ranges);
+
+ /* Copy the ranges metadata from this value that overlaps
+ [SRC_BIT_OFFSET, SRC_BIT_OFFSET+BIT_LENGTH) into DST,
+ adjusted. */
+ void ranges_copy_adjusted (struct value *dst, int dst_bit_offset,
+ int src_bit_offset, int bit_length) const;
+
+ /* Copy LENGTH target addressable memory units of this value's (all)
+ contents (value_contents_all) starting at SRC_OFFSET, into DST
+ value's (all) contents, starting at DST_OFFSET. If unavailable
+ contents are being copied from this, the corresponding DST
+ contents are marked unavailable accordingly. Neither DST nor
+ this value may be lazy values.
+
+ It is assumed the contents of DST in the [DST_OFFSET,
+ DST_OFFSET+LENGTH) range are wholly available. */
+ void contents_copy_raw (struct value *dst, LONGEST dst_offset,
+ LONGEST src_offset, LONGEST length);
+
+ /* A helper for value_from_component_bitsize that copies bits from
+ this value to DEST. */
+ void contents_copy_raw_bitwise (struct value *dst, LONGEST dst_bit_offset,
+ LONGEST src_bit_offset, LONGEST bit_length);
};
inline void
LONGEST embedded_offset, int fieldno,
const struct value *val, LONGEST *result);
-extern void unpack_value_bitfield (struct value *dest_val,
- LONGEST bitpos, LONGEST bitsize,
- const gdb_byte *valaddr,
- LONGEST embedded_offset,
- const struct value *val);
-
extern struct value *value_field_bitfield (struct type *type, int fieldno,
const gdb_byte *valaddr,
LONGEST embedded_offset,
LONGEST);
-/* Create a new value by extracting it from WHOLE. TYPE is the type
- of the new value. BIT_OFFSET and BIT_LENGTH describe the offset
- and field width of the value to extract from WHOLE -- BIT_LENGTH
- may differ from TYPE's length in the case where WHOLE's type is
- packed.
-
- When the value does come from a non-byte-aligned offset or field
- width, it will be marked non_lval. */
-
-extern struct value *value_from_component_bitsize (struct value *whole,
- struct type *type,
- LONGEST bit_offset,
- LONGEST bit_length);
-
extern struct value *value_at (struct type *type, CORE_ADDR addr);
extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
const struct block *var_block,
frame_info_ptr frame);
-extern void value_contents_copy (struct value *dst, LONGEST dst_offset,
- struct value *src, LONGEST src_offset,
- LONGEST length);
-
extern struct value *allocate_repeat_value (struct type *type, int count);
extern struct value *value_mark (void);
extern struct value *value_field (struct value *arg1, int fieldno);
-extern struct value *value_primitive_field (struct value *arg1, LONGEST offset,
- int fieldno,
- struct type *arg_type);
-
-
extern struct type *value_rtti_indirect_type (struct value *, int *, LONGEST *,
int *);