++new_offset;
v->set_bitpos (v->bitpos () - HOST_CHAR_BIT);
}
- set_value_offset (v, new_offset);
+ v->set_offset (new_offset);
/* Also set the parent value. This is needed when trying to
assign a new value (in inferior memory). */
w->val_bitpos,
w->val_bitsize,
value_contents_for_printing (val).data (),
- value_offset (val),
+ val->offset (),
val);
return bit_val;
- If *USING_ENC is zero, then *TOP is the offset from the start
of the complete object to the start of the embedded subobject
VALUE represents. In other words, the enclosing object starts
- at VALUE_ADDR (VALUE) + VALUE_OFFSET (VALUE) +
+ at VALUE_ADDR (VALUE) + VALUE->offset () +
value_embedded_offset (VALUE) + *TOP
- If *USING_ENC is non-zero, then *TOP is the offset from the
address of the complete object to the enclosing object stored
in VALUE. In other words, the enclosing object starts at
- VALUE_ADDR (VALUE) + VALUE_OFFSET (VALUE) + *TOP.
+ VALUE_ADDR (VALUE) + VALUE->offset () + *TOP.
If VALUE's type and enclosing type are the same, then these two
cases are equivalent.
from_contents = nullptr;
}
- ULONGEST bits_to_skip = 8 * value_offset (v);
+ ULONGEST bits_to_skip = 8 * v->offset ();
if (v->bitsize ())
{
- bits_to_skip += (8 * value_offset (v->parent ())
+ bits_to_skip += (8 * v->parent ()->offset ()
+ v->bitpos ());
if (from != nullptr
&& (type_byte_order (from->type ())
piece_closure *c = (piece_closure *) value_computed_closure (value);
int i;
- bit_offset += 8 * value_offset (value);
+ bit_offset += 8 * value->offset ();
if (value->bitsize ())
bit_offset += value->bitpos ();
return NULL;
int bit_length = 8 * type->length ();
- LONGEST bit_offset = 8 * value_offset (value);
+ LONGEST bit_offset = 8 * value->offset ();
if (value->bitsize ())
bit_offset += value->bitpos ();
std::move (this->m_pieces), this->m_frame);
retval = allocate_computed_value (subobj_type,
&pieced_value_funcs, c);
- set_value_offset (retval, subobj_offset);
+ retval->set_offset (subobj_offset);
}
else
{
if (type_byte_order (type) == BFD_ENDIAN_BIG
&& len < register_size (gdbarch, regnum))
/* Big-endian, and we want less than full size. */
- set_value_offset (value, register_size (gdbarch, regnum) - len);
+ value->set_offset (register_size (gdbarch, regnum) - len);
else
- set_value_offset (value, 0);
+ value->set_offset (0);
return value;
}
{
struct gdbarch *gdbarch = get_frame_arch (frame);
LONGEST offset = 0;
- LONGEST reg_offset = value_offset (value);
+ LONGEST reg_offset = value->offset ();
int regnum = VALUE_REGNUM (value);
int len = type_length_units (check_typedef (value->type ()));
if (entry_type->code () == TYPE_CODE_STRUCT)
{
/* Move the `this' pointer according to the virtual function table. */
- set_value_offset (arg1, value_offset (arg1)
+ arg1->set_offset (arg1->offset ()
+ value_as_long (value_field (entry, 0)));
if (!value_lazy (arg1))
TARGET_OBJECT_SIGNAL_INFO,
nullptr,
value_contents_all_raw (v).data (),
- value_offset (v),
+ v->offset (),
v->type ()->length ());
if (transferred != v->type ()->length ())
TARGET_OBJECT_SIGNAL_INFO,
nullptr,
value_contents_all_raw (fromval).data (),
- value_offset (v),
+ v->offset (),
fromval->type ()->length ());
if (transferred != fromval->type ()->length ())
struct lval_closure *c = (struct lval_closure *) value_computed_closure (v);
struct type *type = check_typedef (v->type ());
struct type *eltype = check_typedef (c->val->type ())->target_type ();
- LONGEST offset = value_offset (v);
+ LONGEST offset = v->offset ();
LONGEST elsize = eltype->length ();
int n, i, j = 0;
LONGEST lowb = 0;
struct lval_closure *c = (struct lval_closure *) value_computed_closure (v);
struct type *type = check_typedef (v->type ());
struct type *eltype = check_typedef (c->val->type ())->target_type ();
- LONGEST offset = value_offset (v);
+ LONGEST offset = v->offset ();
LONGEST elsize = eltype->length ();
int n, i, j = 0;
LONGEST lowb = 0;
&& type->length () < 8)
|| regnum_is_vxr_full (tdep, regnum)
|| (regnum >= S390_V16_REGNUM && regnum <= S390_V31_REGNUM))
- set_value_offset (value, 0);
+ value->set_offset (0);
return value;
}
case lval_internalvar_component:
{
- LONGEST offset = value_offset (toval);
+ LONGEST offset = toval->offset ();
/* Are we dealing with a bitfield?
/* VALUE_INTERNALVAR below refers to the parent value, while
the offset is relative to this parent value. */
gdb_assert (toval->parent ()->parent () == NULL);
- offset += value_offset (toval->parent ());
+ offset += toval->parent ()->offset ();
}
set_internalvar_component (VALUE_INTERNALVAR (toval),
{
struct value *parent = toval->parent ();
- changed_addr = value_address (parent) + value_offset (toval);
+ changed_addr = value_address (parent) + toval->offset ();
changed_len = (toval->bitpos ()
+ toval->bitsize ()
+ HOST_CHAR_BIT - 1)
if (toval->bitsize ())
{
struct value *parent = toval->parent ();
- LONGEST offset = value_offset (parent) + value_offset (toval);
+ LONGEST offset = parent->offset () + toval->offset ();
size_t changed_len;
gdb_byte buffer[sizeof (LONGEST)];
int optim, unavail;
}
else
put_frame_register_bytes (frame, value_reg,
- value_offset (toval),
+ toval->offset (),
value_contents (fromval));
}
{
base_offset = baseclass_offset (type, i,
value_contents_for_printing (*argp).data (),
- value_offset (*argp) + offset,
+ (*argp)->offset () + offset,
value_address (*argp), *argp);
}
else /* Non-virtual base, simply use bit position from debug
if (BASETYPE_VIA_VIRTUAL (vt, i))
{
const gdb_byte *adr = value_contents_for_printing (v).data ();
- *boffs = baseclass_offset (vt, i, adr, value_offset (v),
+ *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 ();
- *boffs += baseclass_offset (vt, i, adr, value_offset (v),
+ *boffs += baseclass_offset (vt, i, adr, v->offset (),
value_as_long (v), v);
}
return true;
}
set_value_component_location (slice, array);
- set_value_offset (slice, value_offset (array) + offset);
+ slice->set_offset (array->offset () + offset);
}
return slice;
/* Accessor methods. */
-LONGEST
-value_offset (const struct value *value)
-{
- return value->m_offset;
-}
-void
-set_value_offset (struct value *value, LONGEST offset)
-{
- value->m_offset = offset;
-}
-
gdb::array_view<gdb_byte>
value_contents_raw (struct value *value)
{
value_enclosing_type (arg1)->length ());
}
v->m_type = type;
- v->m_offset = value_offset (arg1);
+ v->m_offset = arg1->offset ();
v->m_embedded_offset = offset + value_embedded_offset (arg1) + boffset;
}
else if (NULL != TYPE_DATA_LOCATION (type))
arg1, value_embedded_offset (arg1) + offset,
type_length_units (type));
}
- v->m_offset = (value_offset (arg1) + offset
+ v->m_offset = (arg1->offset () + offset
+ value_embedded_offset (arg1));
}
set_value_component_location (v, arg1);
value_addr (*arg1p)));
/* Move the `this' pointer according to the offset.
- VALUE_OFFSET (*arg1p) += offset; */
+ (*arg1p)->offset () += offset; */
}
return v;
whole, value_embedded_offset (whole) + offset,
type_length_units (type));
}
- v->m_offset = value_offset (whole) + offset + value_embedded_offset (whole);
+ v->m_offset = whole->offset () + offset + value_embedded_offset (whole);
set_value_component_location (v, whole);
return v;
unpack_value_bitfield (val, val->bitpos (), val->bitsize (),
value_contents_for_printing (parent).data (),
- value_offset (val), parent);
+ val->offset (), parent);
}
/* Helper for value_fetch_lazy when the value is in memory. */
/* Offsets are not supported here; lazy register values must
refer to the entire register. */
- gdb_assert (value_offset (val) == 0);
+ gdb_assert (val->offset () == 0);
while (VALUE_LVAL (new_val) == lval_register && value_lazy (new_val))
{
void set_parent (struct value *parent)
{ m_parent = value_ref_ptr::new_reference (parent); }
+ /* Describes offset of a value within lval of a structure in bytes.
+ If lval == lval_memory, this is an offset to the address. If
+ lval == lval_register, this is a further offset from
+ location.address within the registers structure. Note also the
+ member embedded_offset below. */
+ LONGEST offset () const
+ { return m_offset; }
+
+ void set_offset (LONGEST offset)
+ { m_offset = offset; }
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
ULONGEST m_limited_length = 0;
};
-/* Describes offset of a value within lval of a structure in bytes.
- If lval == lval_memory, this is an offset to the address. If lval
- == lval_register, this is a further offset from location.address
- within the registers structure. Note also the member
- embedded_offset below. */
-
-extern LONGEST value_offset (const struct value *);
-extern void set_value_offset (struct value *, LONGEST offset);
-
/* The comment from "struct value" reads: ``Is it modifiable? Only
relevant if lval != not_lval.''. Shouldn't the value instead be
not_lval and be done with it? */