@@ -270,9 +270,9 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
fputs_styled ("<optimized out or zero length>",
metadata_style.style (), stream);
}
- else if (value_bits_synthetic_pointer
- (val, type->field (i).loc_bitpos (),
- TYPE_FIELD_BITSIZE (type, i)))
+ else if (val->bits_synthetic_pointer
+ (type->field (i).loc_bitpos (),
+ TYPE_FIELD_BITSIZE (type, i)))
{
fputs_styled (_("<synthetic pointer>"),
metadata_style.style (), stream);
@@ -576,8 +576,8 @@ coerce_pieced_ref (const value *value)
{
struct type *type = check_typedef (value->type ());
- if (value_bits_synthetic_pointer (value, value->embedded_offset (),
- TARGET_CHAR_BIT * type->length ()))
+ if (value->bits_synthetic_pointer (value->embedded_offset (),
+ TARGET_CHAR_BIT * type->length ()))
{
const piece_closure *closure
= (piece_closure *) value->computed_closure ();
@@ -215,9 +215,8 @@ lval_func_check_synthetic_pointer (const struct value *v,
int comp_offset = (i == start) ? startrest : 0;
int comp_length = (i == end) ? endrest : elsize;
- if (!value_bits_synthetic_pointer (c->val,
- c->indices[i] * elsize + comp_offset,
- comp_length))
+ if (!c->val->bits_synthetic_pointer (c->indices[i] * elsize + comp_offset,
+ comp_length))
return 0;
}
@@ -609,9 +609,9 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
fputs_styled ("<optimized out or zero length>",
metadata_style.style (), stream);
}
- else if (value_bits_synthetic_pointer
- (val, type->field (i).loc_bitpos (),
- TYPE_FIELD_BITSIZE (type, i)))
+ else if (val->bits_synthetic_pointer
+ (type->field (i).loc_bitpos (),
+ TYPE_FIELD_BITSIZE (type, i)))
{
fputs_styled (_("<synthetic pointer>"),
metadata_style.style (), stream);
@@ -1556,8 +1556,8 @@ value_addr (struct value *arg1)
if (TYPE_IS_REFERENCE (type))
{
- if (value_bits_synthetic_pointer (arg1, arg1->embedded_offset (),
- TARGET_CHAR_BIT * type->length ()))
+ if (arg1->bits_synthetic_pointer (arg1->embedded_offset (),
+ TARGET_CHAR_BIT * type->length ()))
arg1 = coerce_ref (arg1);
else
{
@@ -381,8 +381,8 @@ valprint_check_validity (struct ui_file *stream,
return 0;
}
- if (value_bits_synthetic_pointer (val, TARGET_CHAR_BIT * embedded_offset,
- TARGET_CHAR_BIT * type->length ()))
+ if (val->bits_synthetic_pointer (TARGET_CHAR_BIT * embedded_offset,
+ TARGET_CHAR_BIT * type->length ()))
{
const int is_ref = type->code () == TYPE_CODE_REF;
int ref_is_addressable = 0;
@@ -568,9 +568,8 @@ generic_val_print_ref (struct type *type,
struct type *elttype = check_typedef (type->target_type ());
struct value *deref_val = NULL;
const int value_is_synthetic
- = value_bits_synthetic_pointer (original_value,
- TARGET_CHAR_BIT * embedded_offset,
- TARGET_CHAR_BIT * type->length ());
+ = original_value->bits_synthetic_pointer (TARGET_CHAR_BIT * embedded_offset,
+ TARGET_CHAR_BIT * type->length ());
const int must_coerce_ref = ((options->addressprint && value_is_synthetic)
|| options->deref_ref);
const int type_is_defined = elttype->code () != TYPE_CODE_UNDEF;
@@ -1237,15 +1237,13 @@ mark_value_bits_optimized_out (struct value *value,
}
int
-value_bits_synthetic_pointer (const struct value *value,
- LONGEST offset, LONGEST length)
+value::bits_synthetic_pointer (LONGEST offset, LONGEST length) const
{
- if (value->m_lval != lval_computed
- || !value->m_location.computed.funcs->check_synthetic_pointer)
+ if (m_lval != lval_computed
+ || !m_location.computed.funcs->check_synthetic_pointer)
return 0;
- return value->m_location.computed.funcs->check_synthetic_pointer (value,
- offset,
- length);
+ return m_location.computed.funcs->check_synthetic_pointer (this, offset,
+ length);
}
const struct lval_funcs *
@@ -456,6 +456,11 @@ struct value
values. */
bool contents_eq (const struct value *val2) const;
+ /* Given a value, determine whether the bits starting at OFFSET and
+ extending for LENGTH bits are a synthetic pointer. */
+
+ int bits_synthetic_pointer (LONGEST offset, LONGEST length) const;
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
@@ -828,12 +833,6 @@ extern struct value *coerce_ref (struct value *value);
extern struct value *coerce_array (struct value *value);
-/* Given a value, determine whether the bits starting at OFFSET and
- extending for LENGTH bits are a synthetic pointer. */
-
-extern int value_bits_synthetic_pointer (const struct value *value,
- LONGEST offset, LONGEST length);
-
/* Given a value, determine whether the contents bytes starting at
OFFSET and extending for LENGTH bytes are available. This returns
nonzero if all bytes in the given range are available, zero if any