result = value::allocate_optimized_out (type);
else if (val->lazy ()
/* Be careful not to make a lazy not_lval value. */
- || (VALUE_LVAL (val) != not_lval
+ || (val->lval () != not_lval
&& type->length () > val->type ()->length ()))
result = value::allocate_lazy (type);
else
result->set_component_location (val);
result->set_bitsize (val->bitsize ());
result->set_bitpos (val->bitpos ());
- if (VALUE_LVAL (result) == lval_memory)
+ if (result->lval () == lval_memory)
result->set_address (val->address ());
return result;
}
v = value::allocate (type);
src = valaddr + offset;
}
- else if (VALUE_LVAL (obj) == lval_memory && obj->lazy ())
+ else if (obj->lval () == lval_memory && obj->lazy ())
{
int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
gdb_byte *buf;
if (!toval->deprecated_modifiable ())
error (_("Left operand of assignment is not a modifiable lvalue."));
- if (VALUE_LVAL (toval) == lval_memory
+ if (toval->lval () == lval_memory
&& bits > 0
&& (type->code () == TYPE_CODE_FLT
|| type->code () == TYPE_CODE_STRUCT))
static struct value *
ensure_lval (struct value *val)
{
- if (VALUE_LVAL (val) == not_lval
- || VALUE_LVAL (val) == lval_internalvar)
+ if (val->lval () == not_lval
+ || val->lval () == lval_internalvar)
{
int len = ada_check_typedef (val->type ())->length ();
const CORE_ADDR addr =
result = desc_data (actual);
else if (formal_type->code () != TYPE_CODE_PTR)
{
- if (VALUE_LVAL (actual) != lval_memory)
+ if (actual->lval () != lval_memory)
{
struct value *val;
if (type == type0 && val0 != NULL)
return val0;
- if (VALUE_LVAL (val0) != lval_memory)
+ if (val0->lval () != lval_memory)
{
/* Our value does not live in memory; it could be a convenience
variable, for instance. Create a not_lval value using val0's
In the case of assigning to a convenience variable, the lhs
should be exactly the result of the evaluation of the rhs. */
struct type *type = arg1->type ();
- if (VALUE_LVAL (arg1) == lval_internalvar)
+ if (arg1->lval () == lval_internalvar)
type = NULL;
value *arg2 = std::get<1> (m_storage)->evaluate (type, exp, noside);
if (noside == EVAL_AVOID_SIDE_EFFECTS)
return arg1;
- if (VALUE_LVAL (arg1) == lval_internalvar)
+ if (arg1->lval () == lval_internalvar)
{
/* Nothing. */
}
convert to a pointer. */
if (array->type ()->code () == TYPE_CODE_REF
|| (array->type ()->code () == TYPE_CODE_ARRAY
- && VALUE_LVAL (array) == lval_memory))
+ && array->lval () == lval_memory))
array = value_addr (array);
if (noside == EVAL_AVOID_SIDE_EFFECTS
/* Follow the Ada language semantics that do not allow taking
an address of the result of a cast (view conversion in Ada). */
- if (VALUE_LVAL (val) == lval_memory)
+ if (val->lval () == lval_memory)
{
if (val->lazy ())
val->fetch_lazy ();
/* Follow the Ada language semantics that do not allow taking
an address of the result of a cast (view conversion in Ada). */
- if (VALUE_LVAL (val) == lval_memory)
+ if (val->lval () == lval_memory)
{
if (val->lazy ())
val->fetch_lazy ();
callee = ada_to_fixed_value (coerce_ref (callee));
}
else if (callee->type ()->code () == TYPE_CODE_ARRAY
- && VALUE_LVAL (callee) == lval_memory)
+ && callee->lval () == lval_memory)
callee = value_addr (callee);
struct type *type = ada_check_typedef (callee->type ());
must watch it. If the first value returned is
still lazy, that means an error occurred reading it;
watch it anyway in case it becomes readable. */
- if (VALUE_LVAL (v) == lval_memory
+ if (v->lval () == lval_memory
&& (v == val_chain[0] || ! v->lazy ()))
{
struct type *vtype = check_typedef (v->type ());
{
struct value *v = iter.get ();
- if (VALUE_LVAL (v) == lval_memory)
+ if (v->lval () == lval_memory)
{
if (v != head && v->lazy ())
/* A lazy memory lvalue in the chain is one that GDB never
}
}
}
- else if (VALUE_LVAL (v) != not_lval
+ else if (v->lval () != not_lval
&& v->deprecated_modifiable () == 0)
return 0; /* These are values from the history (e.g., $1). */
- else if (VALUE_LVAL (v) == lval_register)
+ else if (v->lval () == lval_register)
return 0; /* Cannot watch a register with a HW watchpoint. */
}
C struct hack. So, only do this if either no length was
specified, or the length is within the existing bounds. This
avoids running off the end of the value's contents. */
- if ((VALUE_LVAL (value) == not_lval
- || VALUE_LVAL (value) == lval_internalvar
+ if ((value->lval () == not_lval
+ || value->lval () == lval_internalvar
|| type->code () == TYPE_CODE_ARRAY)
&& fetchlimit != UINT_MAX
&& (*length < 0 || *length <= fetchlimit))
CORE_ADDR addr;
if (type->code () == TYPE_CODE_ARRAY)
{
- if (VALUE_LVAL (value) != lval_memory)
+ if (value->lval () != lval_memory)
error (_("Attempt to take address of value "
"not located in memory."));
addr = value->address ();
{
CORE_ADDR vaddr;
- if (VALUE_LVAL (val))
+ if (val->lval ())
{
vaddr = val->address ();
}
}
val = read_var_value (sym.symbol, sym.block, frame);
- if (VALUE_LVAL (val) != lval_memory)
+ if (val->lval () != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation "
"evaluation as its address has not been found."),
sym.symbol->print_name ());
}
val = read_var_value (sym.symbol, sym.block, frame);
- if (VALUE_LVAL (val) != lval_memory)
+ if (val->lval () != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation "
"evaluation as its address has not been found."),
sym.symbol->print_name ());
sym->print_name ());
val = read_var_value (sym, NULL, frame);
- if (VALUE_LVAL (val) != lval_memory)
+ if (val->lval () != lval_memory)
error (_("Symbol \"%s\" cannot be used for compilation evaluation "
"as its address has not been found."),
sym->print_name ());
ctx.push_address (initial, initial_in_stack_memory);
value *result_val = ctx.evaluate (exp, len, true, nullptr, this_frame);
- if (VALUE_LVAL (result_val) == lval_memory)
+ if (result_val->lval () == lval_memory)
return result_val->address ();
else
return value_as_address (result_val);
dwarf_block->per_cu,
dwarf_block->per_objfile);
/* DW_AT_call_target is a DWARF expression, not a DWARF location. */
- if (VALUE_LVAL (val) == lval_memory)
+ if (val->lval () == lval_memory)
callback (val->address ());
else
callback (value_as_address (val));
if (result->optimized_out ())
return 0;
- if (VALUE_LVAL (result) == lval_memory)
+ if (result->lval () == lval_memory)
*valp = result->address ();
else
{
- if (VALUE_LVAL (result) == not_lval)
+ if (result->lval () == not_lval)
*is_reference = false;
*valp = value_as_address (result);
struct value *arg3 = value_struct_elt (&arg1, {}, string,
NULL, "structure");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- arg3 = value::zero (arg3->type (), VALUE_LVAL (arg3));
+ arg3 = value::zero (arg3->type (), arg3->lval ());
return arg3;
}
struct value *arg3 = value_struct_elt (&arg1, {}, string,
NULL, "structure pointer");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- arg3 = value::zero (arg3->type (), VALUE_LVAL (arg3));
+ arg3 = value::zero (arg3->type (), arg3->lval ());
return arg3;
}
}
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value::zero (type->target_type (), VALUE_LVAL (arg1));
+ return value::zero (type->target_type (), arg1->lval ());
else
return value_subscript (arg1, value_as_long (arg2));
}
if (TYPE_IS_REFERENCE (type))
return value::zero (lookup_pointer_type (type->target_type ()),
not_lval);
- else if (VALUE_LVAL (x) == lval_memory || value_must_coerce_to_target (x))
+ else if (x->lval () == lval_memory || value_must_coerce_to_target (x))
return value::zero (lookup_pointer_type (x->type ()),
not_lval);
else
val = value_cast (to_type, val);
/* Don't allow e.g. '&(int)var_with_no_debug_info'. */
- if (VALUE_LVAL (val) == lval_memory)
+ if (val->lval () == lval_memory)
{
if (val->lazy ())
val->fetch_lazy ();
val = value_cast (to_type, val);
/* Don't allow e.g. '&(int)var_with_no_debug_info'. */
- if (VALUE_LVAL (val) == lval_memory)
+ if (val->lval () == lval_memory)
{
if (val->lazy ())
val->fetch_lazy ();
expected type. This avoids a weird case where re-assigning a
string or array to an internal variable could error with "Too
many array elements". */
- struct type *xtype = (VALUE_LVAL (lhs) == lval_internalvar
+ struct type *xtype = (lhs->lval () == lval_internalvar
? nullptr
: lhs->type ());
value *rhs = std::get<1> (m_storage)->evaluate (xtype, exp, noside);
if (index < lb
|| (dim_type->index_type ()->bounds ()->high.kind () != PROP_UNDEFINED
&& index > ub)
- || (VALUE_LVAL (array) != lval_memory
+ || (array->lval () != lval_memory
&& dim_type->index_type ()->bounds ()->high.kind () == PROP_UNDEFINED))
{
if (type_not_associated (dim_type))
}
else
{
- if (VALUE_LVAL (array) == lval_memory)
+ if (array->lval () == lval_memory)
{
/* If the value we're taking a slice from is not yet loaded, or
the requested slice is outside the values content range then
= gdb::make_array_view (valaddr, elt_type->length ());
elt_type = resolve_dynamic_type (elt_type, view, address);
}
- elt = value::zero (elt_type, VALUE_LVAL (elt));
+ elt = value::zero (elt_type, elt->lval ());
}
return elt;
{
/* If the value is not in the inferior e.g. registers values,
convenience variables and user input. */
- if (VALUE_LVAL (value) != lval_memory)
+ if (value->lval () != lval_memory)
{
struct type *type = value->type ();
const int length = type->length ();
int regnum = VALUE_REGNUM (value);
int len = type_length_units (check_typedef (value->type ()));
- gdb_assert (VALUE_LVAL (value) == lval_register);
+ gdb_assert (value->lval () == lval_register);
/* Skip registers wholly inside of REG_OFFSET. */
while (reg_offset >= register_size (gdbarch, regnum))
and get_prev_frame performs a series of checks that are relatively
expensive). This optimization is particularly useful when this function
is called from another function (such as value_fetch_lazy, case
- VALUE_LVAL (val) == lval_register) which already loops over all frames,
+ val->lval () == lval_register) which already loops over all frames,
making the overall behavior O(n^2). */
frame = frame_stash_find (id);
if (frame)
*optimizedp = value->optimized_out ();
*unavailablep = !value->entirely_available ();
- *lvalp = VALUE_LVAL (value);
+ *lvalp = value->lval ();
*addrp = value->address ();
if (*lvalp == lval_register)
*realnump = VALUE_REGNUM (value);
}
else
{
- if (VALUE_LVAL (value) == lval_register)
+ if (value->lval () == lval_register)
gdb_printf (&debug_file, " register=%d",
VALUE_REGNUM (value));
- else if (VALUE_LVAL (value) == lval_memory)
+ else if (value->lval () == lval_memory)
gdb_printf (&debug_file, " address=%s",
paddress (gdbarch,
value->address ()));
if (TYPE_IS_REFERENCE (parm) && value != NULL)
{
- if (VALUE_LVAL (value) == not_lval)
+ if (value->lval () == not_lval)
{
/* Rvalues should preferably bind to rvalue references or const
lvalue references. */
int found_descriptor = 0;
funaddr = 0; /* pacify "gcc -Werror" */
- if (VALUE_LVAL (function) == lval_memory)
+ if (function->lval () == lval_memory)
{
CORE_ADDR nfunaddr;
}
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- return value::zero (type->target_type (), VALUE_LVAL (arg1));
+ return value::zero (type->target_type (), arg1->lval ());
else
return value_subscript (arg1, value_as_long (arg2));
}
else
{
/* Check whether to create a lvalue or not. */
- if (VALUE_LVAL (val) != not_lval && !array_has_dups (indices, n))
+ if (val->lval () != not_lval && !array_has_dups (indices, n))
{
struct lval_closure *c = allocate_lval_closure (indices, n, val);
ret = value::allocate_computed (dst_type, &opencl_value_funcs, c);
struct type *type1 = arg1->type ();
if (arg1->deprecated_modifiable ()
- && VALUE_LVAL (arg1) != lval_internalvar)
+ && arg1->lval () != lval_internalvar)
arg2 = opencl_value_cast (type1, arg2);
return value_assign (arg1, arg2);
NULL, "structure");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- v = value::zero (v->type (), VALUE_LVAL (v));
+ v = value::zero (v->type (), v->lval ());
return v;
}
}
struct value *v = iter.get ();
/* Constants and values from the history are fine. */
- if (VALUE_LVAL (v) == not_lval || v->->deprecated_modifiable () == 0)
+ if (v->lval () == not_lval || v->->deprecated_modifiable () == 0)
continue;
- else if (VALUE_LVAL (v) == lval_memory)
+ else if (v->lval () == lval_memory)
{
/* A lazy memory lvalue is one that GDB never needed to fetch;
we either just used its address (e.g., `a' in `a.b') or
return 0;
if (num_accesses_left == 1 && num_accesses_right == 0
- && VALUE_LVAL (left_val) == lval_memory
+ && left_val->lval () == lval_memory
&& left_val->address () == watch_addr)
{
*data_value = value_as_long (right_val);
*len = check_typedef (left_val->type ())->length ();
}
else if (num_accesses_left == 0 && num_accesses_right == 1
- && VALUE_LVAL (right_val) == lval_memory
+ && right_val->lval () == lval_memory
&& right_val->address () == watch_addr)
{
*data_value = value_as_long (left_val);
struct type *type = check_typedef (val->type ());
int len = type->length ();
- if (VALUE_LVAL (val) == lval_memory)
+ if (val->lval () == lval_memory)
next_address = val->address () + len;
if (size)
/* In rvalue contexts, such as this, functions are coerced into
pointers to functions. This makes "x/i main" work. */
if (val->type ()->code () == TYPE_CODE_FUNC
- && VALUE_LVAL (val) == lval_memory)
+ && val->lval () == lval_memory)
next_address = val->address ();
else
next_address = value_as_address (val);
const gdb_byte *str;
if (value->type ()->code () != TYPE_CODE_PTR
- && VALUE_LVAL (value) == lval_internalvar
+ && value->lval () == lval_internalvar
&& c_is_string_type_p (value->type ()))
{
size_t len = value->type ()->length ();
"wchar_t", NULL, 0);
int wcwidth = wctype->length ();
- if (VALUE_LVAL (value) == lval_internalvar
+ if (value->lval () == lval_internalvar
&& c_is_string_type_p (value->type ()))
{
str = value->contents ().data ();
{
struct value *user_reg_value
= value_of_user_reg (regnum, pending_frame->frame_info);
- if (VALUE_LVAL (user_reg_value) == lval_register)
+ if (user_reg_value->lval () == lval_register)
regnum = VALUE_REGNUM (user_reg_value);
if (regnum >= gdbarch_num_cooked_regs (pending_frame->gdbarch))
{
else
new_type = base_type;
- return value::zero (new_type, VALUE_LVAL (lhs));
+ return value::zero (new_type, lhs->lval ());
}
else
{
else
result = value_struct_elt (&lhs, {}, field_name, NULL, "structure");
if (noside == EVAL_AVOID_SIDE_EFFECTS)
- result = value::zero (result->type (), VALUE_LVAL (result));
+ result = value::zero (result->type (), result->lval ());
return result;
}
if (!value->optimized_out () && value->entirely_available ())
{
- if (VALUE_LVAL (value) == not_lval)
+ if (value->lval () == not_lval)
{
CORE_ADDR sp;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
gdb_puts (paddress (gdbarch, sp));
gdb_printf ("\n");
}
- else if (VALUE_LVAL (value) == lval_memory)
+ else if (value->lval () == lval_memory)
{
gdb_printf (" Previous frame's sp at ");
gdb_puts (paddress (gdbarch, value->address ()));
gdb_printf ("\n");
}
- else if (VALUE_LVAL (value) == lval_register)
+ else if (value->lval () == lval_register)
{
gdb_printf (" Previous frame's sp in %s\n",
gdbarch_register_name (gdbarch,
result = value_from_pointer (valptrtype,
value_as_address (arg1) + sz * arg2);
- if (VALUE_LVAL (result) != lval_internalvar)
+ if (result->lval () != lval_internalvar)
result->set_component_location (arg1);
return result;
}
if (!lowerbound.has_value ())
lowerbound = 0;
- if (VALUE_LVAL (array) != lval_memory)
+ if (array->lval () != lval_memory)
return value_subscripted_rvalue (array, index, *lowerbound);
gdb::optional<LONGEST> upperbound
if (index < lowerbound
|| (!array_upper_bound_undefined
&& elt_offs >= type_length_units (array_type))
- || (VALUE_LVAL (array) != lval_memory && array_upper_bound_undefined))
+ || (array->lval () != lval_memory && array_upper_bound_undefined))
{
if (type_not_associated (array_type))
error (_("no such vector element (vector not associated)"));
if (return_type == NULL)
error (_("Xmethod is missing return type."));
- return value::zero (return_type, VALUE_LVAL (arg1));
+ return value::zero (return_type, arg1->lval ());
}
return argvec[0]->call_xmethod (argvec.slice (1));
}
struct type *return_type;
return_type = check_typedef (argvec[0]->type ())->target_type ();
- return value::zero (return_type, VALUE_LVAL (arg1));
+ return value::zero (return_type, arg1->lval ());
}
return call_function_by_hand (argvec[0], NULL,
argvec.slice (1, 2 - static_memfuncp));
if (return_type == NULL)
error (_("Xmethod is missing return type."));
- return value::zero (return_type, VALUE_LVAL (arg1));
+ return value::zero (return_type, arg1->lval ());
}
return argvec[0]->call_xmethod (argvec[1]);
}
struct type *return_type;
return_type = check_typedef (argvec[0]->type ())->target_type ();
- return value::zero (return_type, VALUE_LVAL (arg1));
+ return value::zero (return_type, arg1->lval ());
}
return call_function_by_hand (argvec[0], NULL,
argvec.slice (1, nargs));
arg2->set_pointed_to_offset (0); /* pai: chk_val */
return arg2;
}
- else if (VALUE_LVAL (arg2) == lval_memory)
+ else if (arg2->lval () == lval_memory)
return value_at_lazy (to_type, arg2->address ());
else
{
}
/* value_one result is never used for assignments to. */
- gdb_assert (VALUE_LVAL (val) == not_lval);
+ gdb_assert (val->lval () == not_lval);
return val;
}
toval = coerce_ref (toval);
type = toval->type ();
- if (VALUE_LVAL (toval) != lval_internalvar)
+ if (toval->lval () != lval_internalvar)
fromval = value_cast (type, fromval);
else
{
and then restore the new frame afterwards. */
old_frame = get_frame_id (deprecated_safe_get_selected_frame ());
- switch (VALUE_LVAL (toval))
+ switch (toval->lval ())
{
case lval_internalvar:
set_internalvar (VALUE_INTERNALVAR (toval), fromval);
cause the frame cache and regcache to be out of date. Assigning to memory
also can. We just do this on all assignments to registers or
memory, for simplicity's sake; I doubt the slowdown matters. */
- switch (VALUE_LVAL (toval))
+ switch (toval->lval ())
{
case lval_memory:
case lval_register:
{
struct value *val;
- if (VALUE_LVAL (arg1) != lval_memory)
+ if (arg1->lval () != lval_memory)
error (_("Only values in memory can be extended with '@'."));
if (count < 1)
error (_("Invalid number %d of repetitions."), count);
val = value_of_variable (var, b);
type = val->type ();
- if ((VALUE_LVAL (val) == lval_memory && val->lazy ())
+ if ((val->lval () == lval_memory && val->lazy ())
|| type->code () == TYPE_CODE_FUNC)
{
CORE_ADDR addr = val->address ();
}
/* Not a memory address; check what the problem was. */
- switch (VALUE_LVAL (val))
+ switch (val->lval ())
{
case lval_register:
{
struct type *valtype;
/* The only lval kinds which do not live in target memory. */
- if (VALUE_LVAL (val) != not_lval
- && VALUE_LVAL (val) != lval_internalvar
- && VALUE_LVAL (val) != lval_xcallable)
+ if (val->lval () != not_lval
+ && val->lval () != lval_internalvar
+ && val->lval () != lval_xcallable)
return false;
valtype = check_typedef (val->type ());
be a good time to do so. */
arg1 = value_coerce_to_target (arg1);
- if (VALUE_LVAL (arg1) != lval_memory)
+ if (arg1->lval () != lval_memory)
error (_("Attempt to take address of value not located in memory."));
return value_from_pointer (lookup_pointer_type (type->target_type ()),
{
struct value *retval;
- if (VALUE_LVAL (arg1) != lval_memory)
+ if (arg1->lval () != lval_memory)
error (_("Attempt to take address of value not located in memory."));
retval = value_from_pointer (lookup_pointer_type (arg1->type ()),
then this would be a good time to force it to memory. */
arg1 = value_coerce_to_target (arg1);
- if (VALUE_LVAL (arg1) != lval_memory)
+ if (arg1->lval () != lval_memory)
error (_("Attempt to take address of value not located in memory."));
/* Get target memory address. */
base_type = check_typedef (arg1->type ());
- if (VALUE_LVAL (arg1) == lval_computed)
+ if (arg1->lval () == lval_computed)
{
const struct lval_funcs *funcs = arg1->computed_funcs ();
}
/* Check if object is in memory. */
- if (VALUE_LVAL (argp) != lval_memory)
+ if (argp->lval () != lval_memory)
{
warning (_("Couldn't retrieve complete object of RTTI "
"type %s; object may be in register(s)."),
slice_range_type);
slice_type->set_code (array_type->code ());
- if (VALUE_LVAL (array) == lval_memory && array->lazy ())
+ if (array->lval () == lval_memory && array->lazy ())
slice = value::allocate_lazy (slice_type);
else
{
value::~value ()
{
- if (VALUE_LVAL (this) == lval_computed)
+ if (this->lval () == lval_computed)
{
const struct lval_funcs *funcs = m_location.computed.funcs;
if (funcs->free_closure)
funcs->free_closure (this);
}
- else if (VALUE_LVAL (this) == lval_xcallable)
+ else if (this->lval () == lval_xcallable)
delete m_location.xm_worker;
}
{
/* See if we can compute the result without fetching the
value. */
- if (VALUE_LVAL (this) == lval_memory)
+ if (this->lval () == lval_memory)
return false;
- else if (VALUE_LVAL (this) == lval_computed)
+ else if (this->lval () == lval_computed)
{
const struct lval_funcs *funcs = m_location.computed.funcs;
gdb::copy (arg_view, val_contents);
}
- if (VALUE_LVAL (val) == lval_computed)
+ if (val->lval () == lval_computed)
{
const struct lval_funcs *funcs = val->m_location.computed.funcs;
struct value *
value::non_lval ()
{
- if (VALUE_LVAL (this) != not_lval)
+ if (this->lval () != not_lval)
{
struct type *enc_type = enclosing_type ();
struct value *val = value::allocate (enc_type);
void
value::force_lval (CORE_ADDR addr)
{
- gdb_assert (VALUE_LVAL (this) == not_lval);
+ gdb_assert (this->lval () == not_lval);
write_memory (addr, contents_raw ().data (), type ()->length ());
m_lval = lval_memory;
carry around both the parent value contents, and the contents of
any dynamic fields within the parent. This is a substantial
change to how values work in GDB. */
- if (VALUE_LVAL (this) == lval_internalvar_component)
+ if (this->lval () == lval_internalvar_component)
{
gdb_assert (lazy ());
m_lval = lval_memory;
}
else
- gdb_assert (VALUE_LVAL (this) == lval_memory);
+ gdb_assert (this->lval () == lval_memory);
set_address (TYPE_DATA_LOCATION_ADDR (type));
}
}
break;
case TYPE_CODE_INTERNAL_FUNCTION:
- gdb_assert (VALUE_LVAL (val) == lval_internalvar);
+ gdb_assert (val->lval () == lval_internalvar);
new_kind = INTERNALVAR_FUNCTION;
get_internalvar_function (VALUE_INTERNALVAR (val),
&new_data.fn.function);
struct internal_function *ifn;
int result;
- gdb_assert (VALUE_LVAL (val) == lval_internalvar);
+ gdb_assert (val->lval () == lval_internalvar);
result = get_internalvar_function (VALUE_INTERNALVAR (val), &ifn);
gdb_assert (result);
struct internal_function *ifn;
int result;
- gdb_assert (VALUE_LVAL (func) == lval_internalvar);
+ gdb_assert (func->lval () == lval_internalvar);
result = get_internalvar_function (VALUE_INTERNALVAR (func), &ifn);
gdb_assert (result);
LONGEST boffset;
/* Lazy register values with offsets are not supported. */
- if (VALUE_LVAL (this) == lval_register && lazy ())
+ if (this->lval () == lval_register && lazy ())
fetch_lazy ();
/* We special case virtual inheritance here because this
/ (HOST_CHAR_BIT * unit_size));
/* Lazy register values with offsets are not supported. */
- if (VALUE_LVAL (this) == lval_register && lazy ())
+ if (this->lval () == lval_register && lazy ())
fetch_lazy ();
if (lazy ())
{
struct value *v;
- if (VALUE_LVAL (whole) == lval_memory && whole->lazy ())
+ if (whole->lval () == lval_memory && whole->lazy ())
v = value::allocate_lazy (type);
else
{
refer to the entire register. */
gdb_assert (offset () == 0);
- while (VALUE_LVAL (new_val) == lval_register && new_val->lazy ())
+ while (new_val->lval () == lval_register && new_val->lazy ())
{
struct frame_id next_frame_id = VALUE_NEXT_FRAME_ID (new_val);
sniffer trying to unwind), bypassing its validations. In
any case, it should always be an internal error to end up
in this situation. */
- if (VALUE_LVAL (new_val) == lval_register
+ if (new_val->lval () == lval_register
&& new_val->lazy ()
&& VALUE_NEXT_FRAME_ID (new_val) == next_frame_id)
internal_error (_("infinite loop while fetching a register"));
int i;
gdb::array_view<const gdb_byte> buf = new_val->contents ();
- if (VALUE_LVAL (new_val) == lval_register)
+ if (new_val->lval () == lval_register)
gdb_printf (&debug_file, " register=%d",
VALUE_REGNUM (new_val));
- else if (VALUE_LVAL (new_val) == lval_memory)
+ else if (new_val->lval () == lval_memory)
gdb_printf (&debug_file, " address=%s",
paddress (gdbarch,
new_val->address ()));
}
else if (bitsize ())
fetch_lazy_bitfield ();
- else if (VALUE_LVAL (this) == lval_memory)
+ else if (this->lval () == lval_memory)
fetch_lazy_memory ();
- else if (VALUE_LVAL (this) == lval_register)
+ else if (this->lval () == lval_register)
fetch_lazy_register ();
- else if (VALUE_LVAL (this) == lval_computed
+ else if (this->lval () == lval_computed
&& computed_funcs ()->read != NULL)
computed_funcs ()->read (this);
else
uses. */
void *computed_closure () const;
- enum lval_type *deprecated_lval_hack ()
- { return &m_lval; }
-
enum lval_type lval () const
{ return m_lval; }
extern void error_value_optimized_out (void);
-/* While the following fields are per- VALUE .CONTENT .PIECE (i.e., a
- single value might have multiple LVALs), this hacked interface is
- limited to just the first PIECE. Expect further change. */
-/* Type of value; either not an lval, or one of the various different
- possible kinds of lval. */
-#define VALUE_LVAL(val) (*((val)->deprecated_lval_hack ()))
-
/* Pointer to internal variable. */
#define VALUE_INTERNALVAR(val) (*((val)->deprecated_internalvar_hack ()))
struct type *type;
if (!(var->root->is_valid && var->value != nullptr
- && VALUE_LVAL (var->value.get ())))
+ && var->value.get ()->lval ()))
return false;
type = varobj_get_value_type (var);