if (stack_temporaries.has_value ()
&& value_in_thread_stack_temporaries (retval, inferior_thread ()))
- retval = value_non_lval (retval);
+ retval = retval->non_lval ();
return retval;
}
}
else
{
- struct value *arg3 = value_non_lval (arg1);
+ struct value *arg3 = arg1->non_lval ();
struct value *arg2;
if (ptrmath_type_p (exp->language_defn, arg1->type ()))
}
else
{
- struct value *arg3 = value_non_lval (arg1);
+ struct value *arg3 = arg1->non_lval ();
struct value *arg2;
if (ptrmath_type_p (exp->language_defn, arg1->type ()))
requiring GDB to evaluate the "this" pointer. To evaluate
the this pointer, GDB needs the memory address of the
value. */
- value_force_lval (retval, ri->struct_addr);
+ retval->force_lval (ri->struct_addr);
push_thread_stack_temporary (thr, retval);
}
}
return cv_val;
}
-/* Return a version of ARG that is non-lvalue. */
+/* See value.h. */
struct value *
-value_non_lval (struct value *arg)
+value::non_lval ()
{
- if (VALUE_LVAL (arg) != not_lval)
+ if (VALUE_LVAL (this) != not_lval)
{
- struct type *enc_type = arg->enclosing_type ();
+ struct type *enc_type = enclosing_type ();
struct value *val = value::allocate (enc_type);
- gdb::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 ());
+ gdb::copy (contents_all (), val->contents_all_raw ());
+ val->m_type = m_type;
+ val->set_embedded_offset (embedded_offset ());
+ val->set_pointed_to_offset (pointed_to_offset ());
return val;
}
- return arg;
+ return this;
}
-/* Write contents of V at ADDR and set its lval type to be LVAL_MEMORY. */
+/* See value.h. */
void
-value_force_lval (struct value *v, CORE_ADDR addr)
+value::force_lval (CORE_ADDR addr)
{
- gdb_assert (VALUE_LVAL (v) == not_lval);
+ gdb_assert (VALUE_LVAL (this) == not_lval);
- write_memory (addr, v->contents_raw ().data (), v->type ()->length ());
- v->m_lval = lval_memory;
- v->m_location.address = addr;
+ write_memory (addr, contents_raw ().data (), type ()->length ());
+ m_lval = lval_memory;
+ m_location.address = addr;
}
void
for LENGTH bits as optimized out. */
void mark_bits_optimized_out (LONGEST offset, LONGEST length);
+ /* Return a version of this that is non-lvalue. */
+ struct value *non_lval ();
+
+ /* Write contents of this value at ADDR and set its lval type to be
+ LVAL_MEMORY. */
+ void force_lval (CORE_ADDR);
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
/* From values.c */
-extern struct value *value_non_lval (struct value *);
-
-extern void value_force_lval (struct value *, CORE_ADDR);
-
extern struct value *make_cv_value (int, int, struct value *);
extern void preserve_one_value (struct value *, struct objfile *, htab_t);