result->set_bitsize (val->bitsize ());
result->set_bitpos (val->bitpos ());
if (VALUE_LVAL (result) == lval_memory)
- set_value_address (result, value_address (val));
+ result->set_address (val->address ());
return result;
}
}
if (type->code () == TYPE_CODE_PTR)
return value_cast (data_type, value_copy (val));
else
- return value_from_longest (data_type, value_address (val));
+ return value_from_longest (data_type, val->address ());
}
/* True iff TYPE indicates a "thick" array pointer type. */
if (type->code () == TYPE_CODE_PTR)
addr = value_as_long (arr);
else
- addr = value_address (arr);
+ addr = arr->address ();
return
value_from_longest (lookup_pointer_type (bounds_type),
we further resolve the array bounds here and then update the
sizes. */
const gdb_byte *valaddr = value_contents_for_printing (arr).data ();
- CORE_ADDR address = value_address (arr);
+ CORE_ADDR address = arr->address ();
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, type->length ());
type = resolve_dynamic_type (type, view, address);
int src_len = (bit_size + bit_offset + HOST_CHAR_BIT - 1) / 8;
gdb_byte *buf;
- v = value_at (type, value_address (obj) + offset);
+ v = value_at (type, obj->address () + offset);
buf = (gdb_byte *) alloca (src_len);
- read_memory (value_address (v), buf, src_len);
+ read_memory (v->address (), buf, src_len);
src = buf;
}
else
int from_size;
gdb_byte *buffer = (gdb_byte *) alloca (len);
struct value *val;
- CORE_ADDR to_addr = value_address (toval);
+ CORE_ADDR to_addr = toval->address ();
if (type->code () == TYPE_CODE_FLT)
fromval = value_cast (type, fromval);
struct value *val)
{
LONGEST offset_in_container =
- (LONGEST) (value_address (component) - value_address (container));
+ (LONGEST) (component->address () - container->address ());
int bit_offset_in_container =
component->bitpos () - container->bitpos ();
int bits;
value_as_long (value_allocate_space_in_inferior (len));
VALUE_LVAL (val) = lval_memory;
- set_value_address (val, addr);
+ val->set_address (addr);
write_memory (addr, value_contents (val).data (), len);
}
CORE_ADDR address;
if (t->code () == TYPE_CODE_PTR)
- address = value_address (ada_value_ind (arg));
+ address = ada_value_ind (arg)->address ();
else
- address = value_address (ada_coerce_ref (arg));
+ address = ada_coerce_ref (arg)->address ();
/* Check to see if this is a tagged type. We also need to handle
the case where the type is a reference to a tagged type, but
gdb_byte *buf = (gdb_byte *) alloca (len);
CORE_ADDR addr;
- addr = value_address (value);
+ addr = value->address ();
gdbarch_address_to_pointer (type->arch (), type, buf, addr);
addr = extract_unsigned_integer (buf, len, type_byte_order (type));
return addr;
offset_to_top = -offset_to_top;
}
- base_address = value_address (obj) + offset_to_top;
+ base_address = obj->address () + offset_to_top;
tag = value_tag_from_contents_and_address (obj_type, NULL, base_address);
/* Make sure that we have a proper tag at the new address.
if (real_type != NULL)
return to_fixed_record_type
(real_type, NULL,
- value_address (ada_tag_value_at_base_address (obj)), NULL);
+ ada_tag_value_at_base_address (obj)->address (), NULL);
}
/* Check to see if there is a parallel ___XVZ variable.
ada_to_fixed_value (struct value *val)
{
val = unwrap_value (val);
- val = ada_to_fixed_value_create (val->type (), value_address (val), val);
+ val = ada_to_fixed_value_create (val->type (), val->address (), val);
return val;
}
\f
return
coerce_unspec_val_to_type
(val, ada_to_fixed_type (raw_real_type, 0,
- value_address (val),
+ val->address (),
NULL, 1));
}
}
return NULL;
gdb::unique_xmalloc_ptr<char> e_msg ((char *) xmalloc (e_msg_len + 1));
- read_memory (value_address (e_msg_val), (gdb_byte *) e_msg.get (),
+ read_memory (e_msg_val->address (), (gdb_byte *) e_msg.get (),
e_msg_len);
e_msg.get ()[e_msg_len] = '\0';
/* Extract LEN characters from the fat string. */
array_val = value_ind (value_field (val, array_fieldno));
- read_memory (value_address (array_val), (gdb_byte *) dest, len);
+ read_memory (array_val->address (), (gdb_byte *) dest, len);
/* Add the NUL character to close the string. */
dest[len] = '\0';
struct type *saved_type = type;
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
- CORE_ADDR address = value_address (val);
+ CORE_ADDR address = val->address ();
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, type->length ());
type = ada_check_typedef (resolve_dynamic_type (type, view, address));
bitsize = b->val_bitsize;
}
- addr = value_address (v);
+ addr = v->address ();
if (bitsize != 0)
{
/* Skip the bytes that don't contain the bitfield. */
|| (vtype->code () != TYPE_CODE_STRUCT
&& vtype->code () != TYPE_CODE_ARRAY))
{
- CORE_ADDR vaddr = value_address (v);
+ CORE_ADDR vaddr = v->address ();
int len;
int num_regs;
if (VALUE_LVAL (value) != lval_memory)
error (_("Attempt to take address of value "
"not located in memory."));
- addr = value_address (value);
+ addr = value->address ();
}
else
addr = value_as_address (value);
const struct value_print_options *options)
{
struct type *type = check_typedef (val->type ());
- CORE_ADDR address = value_address (val);
+ CORE_ADDR address = val->address ();
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
struct type *unresolved_elttype = type->target_type ();
struct type *elttype = check_typedef (unresolved_elttype);
if (VALUE_LVAL (val))
{
- vaddr = value_address (val);
+ vaddr = val->address ();
}
else
{
sym.symbol->print_name ());
kind = GCC_C_SYMBOL_VARIABLE;
- addr = value_address (val);
+ addr = val->address ();
}
break;
sym.symbol->print_name ());
kind = GCC_CP_SYMBOL_VARIABLE;
- addr = value_address (val);
+ addr = val->address ();
}
break;
gdb_printf (stream, "%*s%s = %s;\n",
indent, "", result_name,
- core_addr_to_string (value_address (val)));
+ core_addr_to_string (val->address ()));
gdb_printf (stream, "%*s}\n", indent - 2, "");
return;
}
struct type **dont_print_vb)
{
struct type *type = check_typedef (val->type ());
- CORE_ADDR address = value_address (val);
+ CORE_ADDR address = val->address ();
struct type **last_dont_print
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
struct obstack tmp_obstack = dont_print_vb_obstack;
if (real_type->code () == TYPE_CODE_STRUCT)
{
CORE_ADDR *first_dont_print;
- CORE_ADDR addr = value_address (val);
+ CORE_ADDR addr = val->address ();
int i;
first_dont_print
{
case TYPE_CODE_STRUCT:
ret = dynamic_array_type (type, val->embedded_offset (),
- value_address (val),
+ val->address (),
stream, recurse, val, options);
if (ret == 0)
break;
value *result_val = ctx.evaluate (exp, len, true, nullptr, this_frame);
if (VALUE_LVAL (result_val) == lval_memory)
- return value_address (result_val);
+ return result_val->address ();
else
return value_as_address (result_val);
}
dwarf2_evaluate_loc_desc returns a value representing a variable at
that address. The frame base address is thus this variable's
address. */
- return value_address (result);
+ return result->address ();
}
/* Vector for inferior functions as represented by LOC_BLOCK, if the inferior
dwarf2_evaluate_loc_desc returns a value representing a variable at
that address. The frame base address is thus this variable's
address. */
- return value_address (result);
+ return result->address ();
}
/* Vector for inferior functions as represented by LOC_BLOCK, if the inferior
dwarf_block->per_objfile);
/* DW_AT_call_target is a DWARF expression, not a DWARF location. */
if (VALUE_LVAL (val) == lval_memory)
- callback (value_address (val));
+ callback (val->address ());
else
callback (value_as_address (val));
}
return 0;
if (VALUE_LVAL (result) == lval_memory)
- *valp = value_address (result);
+ *valp = result->address ();
else
{
if (VALUE_LVAL (result) == not_lval)
function = allocate_value (func_func_type);
VALUE_LVAL (function) = lval_memory;
- set_value_address (function, pc);
+ function->set_address (pc);
/* STT_GNU_IFUNC resolver functions usually receive the HWCAP vector as
parameter. FUNCTION is the function entry address. ADDRESS may be a
func_func = allocate_value (func_func_type);
VALUE_LVAL (func_func) = lval_memory;
- set_value_address (func_func, b->loc->related_address);
+ func_func->set_address (b->loc->related_address);
value = allocate_value (value_type);
gdbarch_return_value_as_value (gdbarch, func_func, value_type, regcache,
{
if (ftype->is_gnu_ifunc ())
{
- CORE_ADDR address = value_address (callee);
+ CORE_ADDR address = callee->address ();
type *resolved_type = find_gnu_ifunc_target_type (address);
if (resolved_type != NULL)
``this'' pointer if necessary, so modify it to reflect any
``this'' changes. */
vals[0] = value_from_longest (lookup_pointer_type (temp->type ()),
- value_address (temp)
+ temp->address ()
+ temp->embedded_offset ());
}
enum noside noside,
value *func, const char *var)
{
- CORE_ADDR addr = value_address (func);
+ CORE_ADDR addr = func->address ();
const block *blk = block_for_pc (addr);
struct block_symbol sym = lookup_symbol (var, blk, VAR_DOMAIN, NULL);
if (sym.symbol == NULL)
if (pointer_type->code () == TYPE_CODE_PTR)
pointer_addr = value_as_address (pointer);
else
- pointer_addr = value_address (pointer);
+ pointer_addr = pointer->address ();
/* The single argument case, is POINTER associated with anything? */
if (target == nullptr)
if (target_type->code () == TYPE_CODE_PTR)
target_addr = value_as_address (target);
else
- target_addr = value_address (target);
+ target_addr = target->address ();
/* Wrap the following checks inside a do { ... } while (false) loop so
that we can use `break' to jump out of the loop. */
else
result_type = builtin_f_type (exp->gdbarch)->builtin_integer_s8;
- LONGEST result_value = value_address (arg1);
+ LONGEST result_value = arg1->address ();
return value_from_longest (result_type, result_value);
}
debug_printf (" |-> Total offset: %s\n",
plongest (total_offset));
debug_printf (" |-> Base address: %s\n",
- core_addr_to_string (value_address (array)));
+ core_addr_to_string (array->address ()));
debug_printf (" '-> Contiguous = %s\n",
(is_all_contiguous ? "Yes" : "No"));
}
> check_typedef (array->type ())->length ()))
{
fortran_array_walker<fortran_lazy_array_repacker_impl> p
- (array_slice_type, value_address (array) + total_offset, dest);
+ (array_slice_type, array->address () + total_offset, dest);
p.walk ();
}
else
{
fortran_array_walker<fortran_array_repacker_impl> p
- (array_slice_type, value_address (array) + total_offset,
+ (array_slice_type, array->address () + total_offset,
total_offset, array, dest);
p.walk ();
}
|| (total_offset + array_slice_type->length ()
> check_typedef (array->type ())->length ()))
array = value_at_lazy (array_slice_type,
- value_address (array) + total_offset);
+ array->address () + total_offset);
else
array = value_from_contents_and_address
(array_slice_type, value_contents (array).data () + total_offset,
- value_address (array) + total_offset);
+ array->address () + total_offset);
}
else if (!array->lazy ())
array = value_from_component (array, array_slice_type, total_offset);
if (is_dynamic_type (elt_type))
{
const gdb_byte *valaddr = value_contents_for_printing (elt).data ();
- CORE_ADDR address = value_address (elt);
+ CORE_ADDR address = elt->address ();
gdb::array_view<const gdb_byte> view
= gdb::make_array_view (valaddr, elt_type->length ());
elt_type = resolve_dynamic_type (elt_type, view, address);
CORE_ADDR addr;
int index;
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
- const CORE_ADDR address = value_address (val);
+ const CORE_ADDR address = val->address ();
switch (type->code ())
{
*optimizedp = value_optimized_out (value);
*unavailablep = !value_entirely_available (value);
*lvalp = VALUE_LVAL (value);
- *addrp = value_address (value);
+ *addrp = value->address ();
if (*lvalp == lval_register)
*realnump = VALUE_REGNUM (value);
else
else if (VALUE_LVAL (value) == lval_memory)
gdb_printf (&debug_file, " address=%s",
paddress (gdbarch,
- value_address (value)));
+ value->address ()));
else
gdb_printf (&debug_file, " computed");
if (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION)
{
store_unsigned_integer (valbuf, 4, byte_order,
- value_address (arg));
+ arg->address ());
typecode = TYPE_CODE_PTR;
len = 4;
val = valbuf;
return is_unique_ancestor_worker (base, val->type (), &offset,
value_contents_for_printing (val).data (),
val->embedded_offset (),
- value_address (val), val) == 1;
+ val->address (), val) == 1;
}
/* See gdbtypes.h. */
/* We can't use value_ind here, because it would want to use RTTI, and
we'd waste a bunch of time figuring out we already know the type.
Besides, we don't care about the type, just the actual pointer. */
- if (value_address (value_field (v, known_type_vptr_fieldno)) == 0)
+ if (value_field (v, known_type_vptr_fieldno)->address () == 0)
return NULL;
vtbl = value_as_address (value_field (v, known_type_vptr_fieldno));
/* Find the linker symbol for this vtable. */
vtable_symbol
- = lookup_minimal_symbol_by_pc (value_address (vtable)
+ = lookup_minimal_symbol_by_pc (vtable->address ()
+ vtable->embedded_offset ()).minsym;
if (! vtable_symbol)
return NULL;
{
const struct value_and_voffset *o = (const struct value_and_voffset *) p;
- return value_address (o->value) + o->value->embedded_offset ();
+ return o->value->address () + o->value->embedded_offset ();
}
/* Equality function for value_and_voffset. */
const struct value_and_voffset *ova = (const struct value_and_voffset *) a;
const struct value_and_voffset *ovb = (const struct value_and_voffset *) b;
- return (value_address (ova->value) + ova->value->embedded_offset ()
- == value_address (ovb->value) + ovb->value->embedded_offset ());
+ return (ova->value->address () + ova->value->embedded_offset ()
+ == ovb->value->address () + ovb->value->embedded_offset ());
}
/* Comparison function for value_and_voffset. */
compare_value_and_voffset (const struct value_and_voffset *va,
const struct value_and_voffset *vb)
{
- CORE_ADDR addra = (value_address (va->value)
+ CORE_ADDR addra = (va->value->address ()
+ va->value->embedded_offset ());
- CORE_ADDR addrb = (value_address (vb->value)
+ CORE_ADDR addrb = (vb->value->address ()
+ vb->value->embedded_offset ());
return addra < addrb;
CORE_ADDR vt_addr;
vtable = gnuv3_get_vtable (gdbarch, type,
- value_address (value)
+ value->address ()
+ value->embedded_offset ());
- vt_addr = value_address (value_field (vtable,
- vtable_field_virtual_functions));
+ vt_addr = value_field (vtable,
+ vtable_field_virtual_functions)->address ();
gdb_printf (_("vtable for '%s' @ %s (subobject @ %s):\n"),
TYPE_SAFE_NAME (type),
paddress (gdbarch, vt_addr),
- paddress (gdbarch, (value_address (value)
+ paddress (gdbarch, (value->address ()
+ value->embedded_offset ())));
for (i = 0; i <= max_voffset; ++i)
&& gnuv3_dynamic_class (type))
{
struct value *vtable, *typeinfo_value;
- CORE_ADDR address = value_address (value) + value->embedded_offset ();
+ CORE_ADDR address = value->address () + value->embedded_offset ();
vtable = gnuv3_get_vtable (gdbarch, type, address);
if (vtable == NULL)
if (! options->raw)
{
print_go_string (type, val->embedded_offset (),
- value_address (val),
+ val->address (),
stream, recurse, val, options);
return;
}
low_bound,
low_bound + length - 1);
}
- addr = value_address (value);
+ addr = value->address ();
break;
}
case TYPE_CODE_PTR:
break;
default:
/* Should flag an error here. PR 20769. */
- addr = value_address (value);
+ addr = value->address ();
break;
}
/* Determine address to call. */
if (ftype->code () == TYPE_CODE_FUNC
|| ftype->code () == TYPE_CODE_METHOD)
- funaddr = value_address (function);
+ funaddr = function->address ();
else if (ftype->code () == TYPE_CODE_PTR)
{
funaddr = value_as_address (function);
lastval = get_last_thread_stack_temporary (call_thread.get ());
if (lastval != NULL)
{
- CORE_ADDR lastval_addr = value_address (lastval);
+ CORE_ADDR lastval_addr = lastval->address ();
if (gdbarch_inner_than (gdbarch, 1, 2))
{
|| ((current_language->la_language == language_m2)
&& (type->code () == TYPE_CODE_CHAR)))
&& (options->format == 0 || options->format == 's'))
- val_print_string (type, NULL, value_address (val), len+1, stream,
+ val_print_string (type, NULL, val->address (), len+1, stream,
options);
else
{
struct type *elttype;
CORE_ADDR addr;
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
- const CORE_ADDR address = value_address (val);
+ const CORE_ADDR address = val->address ();
struct type *type = check_typedef (val->type ());
switch (type->code ())
&& (typecode == TYPE_CODE_STRUCT || typecode == TYPE_CODE_UNION))
{
store_unsigned_integer (valbuf, 4, byte_order,
- value_address (args[argnum]));
+ args[argnum]->address ());
typecode = TYPE_CODE_PTR;
len = 4;
val = valbuf;
{
gdb_assert (abi_regsize <= ARRAY_SIZE (ref_valbuf));
store_unsigned_integer (ref_valbuf, abi_regsize, byte_order,
- value_address (arg));
+ arg->address ());
typecode = TYPE_CODE_PTR;
len = abi_regsize;
val = ref_valbuf;
arg_len = push_size;
gdb_assert (push_size <= MN10300_MAX_REGISTER_SIZE);
store_unsigned_integer (valbuf, push_size, byte_order,
- value_address (*args));
+ (*args)->address ());
val = &valbuf[0];
}
else
{
/* Aggregates of any size are passed by reference. */
store_unsigned_integer (struct_addr_buf, 4, byte_order,
- value_address (arg));
+ arg->address ());
arg_bits = struct_addr_buf;
arg_size = (code_model == MSP_LARGE_CODE_MODEL) ? 4 : 2;
}
if ((TYPE_CODE_STRUCT == typecode) || (TYPE_CODE_UNION == typecode)
|| (len > bpw * 2))
{
- CORE_ADDR valaddr = value_address (arg);
+ CORE_ADDR valaddr = arg->address ();
/* If the arg is fabricated (i.e. 3*i, instead of i) valaddr is
undefined. */
|| (len > bpw * 2))
{
store_unsigned_integer (valbuf, bpa, byte_order,
- value_address (arg));
+ arg->address ());
len = bpa;
val = valbuf;
}
break;
}
/* Array of unspecified length: treat like pointer to first elt. */
- addr = value_address (val);
+ addr = val->address ();
}
goto print_unpacked_pointer;
if (boffset < 0 || boffset >= type->length ())
{
- CORE_ADDR address= value_address (val);
+ CORE_ADDR address= val->address ();
gdb::byte_vector buf (baseclass->length ());
if (target_read_memory (address + boffset, buf.data (),
while (--i >= 0)
{
- if (value_address (val) == first_dont_print[i])
+ if (val->address () == first_dont_print[i])
{
fputs_styled (_("\
<same as static member of an already seen type>"),
}
}
- addr = value_address (val);
+ addr = val->address ();
obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
sizeof (CORE_ADDR));
if (num_accesses_left == 1 && num_accesses_right == 0
&& VALUE_LVAL (left_val) == lval_memory
- && value_address (left_val) == watch_addr)
+ && left_val->address () == watch_addr)
{
*data_value = value_as_long (right_val);
}
else if (num_accesses_left == 0 && num_accesses_right == 1
&& VALUE_LVAL (right_val) == lval_memory
- && value_address (right_val) == watch_addr)
+ && right_val->address () == watch_addr)
{
*data_value = value_as_long (left_val);
int len = type->length ();
if (VALUE_LVAL (val) == lval_memory)
- next_address = value_address (val) + len;
+ next_address = val->address () + len;
if (size)
{
{
struct type *elttype = val->type ();
- next_address = (value_address (val)
+ next_address = (val->address ()
+ val_print_string (elttype, NULL,
- value_address (val), -1,
+ val->address (), -1,
stream, options) * len);
}
return;
case 'i':
/* We often wrap here if there are long symbolic names. */
stream->wrap_here (4);
- next_address = (value_address (val)
+ next_address = (val->address ()
+ gdb_print_insn (type->arch (),
- value_address (val), stream,
+ val->address (), stream,
&branch_delay_insns));
return;
}
pointers to functions. This makes "x/i main" work. */
if (val->type ()->code () == TYPE_CODE_FUNC
&& VALUE_LVAL (val) == lval_memory)
- next_address = value_address (val);
+ next_address = val->address ();
else
next_address = value_as_address (val);
low_bound,
low_bound + length - 1);
}
- addr = value_address (value);
+ addr = value->address ();
break;
}
case TYPE_CODE_PTR:
break;
default:
/* Should flag an error here. PR 20769. */
- addr = value_address (value);
+ addr = value->address ();
break;
}
llen - 1);
struct value *array = allocate_value_lazy (array_type);
VALUE_LVAL (array) = lval_memory;
- set_value_address (array, value_as_address (base));
+ array->set_address (value_as_address (base));
value_fetch_lazy (array);
generic_value_print (array, stream, recurse, options,
&rust_decorations);
gdb::array_view<const gdb_byte> view
(value_contents_for_printing (val).data (),
val->type ()->length ());
- type = resolve_dynamic_type (type, view, value_address (val));
+ type = resolve_dynamic_type (type, view, val->address ());
if (rust_empty_enum_p (type))
{
if (rust_enum_p (type))
{
type = resolve_dynamic_type (type, value_contents (lhs),
- value_address (lhs));
+ lhs->address ());
if (rust_empty_enum_p (type))
error (_("Cannot access field %d of empty enum %s"),
if (type->code () == TYPE_CODE_STRUCT && rust_enum_p (type))
{
type = resolve_dynamic_type (type, value_contents (lhs),
- value_address (lhs));
+ lhs->address ());
if (rust_empty_enum_p (type))
error (_("Cannot access field %s of empty enum %s"),
else if (VALUE_LVAL (value) == lval_memory)
{
gdb_printf (" Previous frame's sp at ");
- gdb_puts (paddress (gdbarch, value_address (value)));
+ gdb_puts (paddress (gdbarch, value->address ()));
gdb_printf ("\n");
}
else if (VALUE_LVAL (value) == lval_register)
{
/* Safe because we know it's a simple expression. */
tempval = evaluate_expression (exp.get ());
- addr = value_address (tempval);
+ addr = tempval->address ();
expr::unop_memval_operation *memop
= (gdb::checked_static_cast<expr::unop_memval_operation *>
(exp->op.get ()));
&& (*args)->type ()->length () > E_MAX_RETTYPE_SIZE_IN_REGS)
{
store_unsigned_integer (valbuf, 4, byte_order,
- value_address (*args));
+ (*args)->address ());
len = 4;
val = valbuf;
}
struct value *val = allocate_value (elt_type);
mark_value_bytes_unavailable (val, 0, elt_size);
VALUE_LVAL (val) = lval_memory;
- set_value_address (val, value_address (array) + elt_size * index);
+ val->set_address (array->address () + elt_size * index);
return val;
}
{
CORE_ADDR address;
- address = value_address (array) + elt_offs;
+ address = array->address () + elt_offs;
elt_type = resolve_dynamic_type (elt_type, {}, address);
}
if (real_type)
{
v = value_full_object (v2, real_type, full, top, using_enc);
- v = value_at_lazy (real_type, value_address (v));
+ v = value_at_lazy (real_type, v->address ());
real_type = v->type ();
/* We might be trying to cast to the outermost enclosing
if (v)
{
/* Downcasting is possible (t1 is superclass of v2). */
- CORE_ADDR addr2 = value_address (v2) + v2->embedded_offset ();
+ CORE_ADDR addr2 = v2->address () + v2->embedded_offset ();
- addr2 -= value_address (v) + v->embedded_offset ();
+ addr2 -= v->address () + v->embedded_offset ();
return value_at (type, addr2);
}
}
return arg2;
}
else if (VALUE_LVAL (arg2) == lval_memory)
- return value_at_lazy (to_type, value_address (arg2));
+ return value_at_lazy (to_type, arg2->address ());
else
{
if (current_language->la_language == language_ada)
error (_("Couldn't determine value's most derived type for dynamic_cast"));
/* Compute the most derived object's address. */
- addr = value_address (arg);
+ addr = arg->address ();
if (full)
{
/* Done. */
if (dynamic_cast_check_1 (resolved_type->target_type (),
value_contents_for_printing (tem).data (),
tem->embedded_offset (),
- value_address (tem), tem,
+ tem->address (), tem,
rtti_type, addr,
arg_type,
&result) == 1)
&& dynamic_cast_check_2 (resolved_type->target_type (),
value_contents_for_printing (tem).data (),
tem->embedded_offset (),
- value_address (tem), tem,
+ tem->address (), tem,
rtti_type, &result) == 1)
return value_cast (type,
is_ref
{
struct value *parent = toval->parent ();
- changed_addr = value_address (parent) + toval->offset ();
+ changed_addr = parent->address () + toval->offset ();
changed_len = (toval->bitpos ()
+ toval->bitsize ()
+ HOST_CHAR_BIT - 1)
}
else
{
- changed_addr = value_address (toval);
+ changed_addr = toval->address ();
changed_len = type_length_units (type);
dest_buffer = value_contents (fromval).data ();
}
val = allocate_repeat_value (arg1->enclosing_type (), count);
VALUE_LVAL (val) = lval_memory;
- set_value_address (val, value_address (arg1));
+ val->set_address (arg1->address ());
- read_value_memory (val, 0, val->stack (), value_address (val),
+ read_value_memory (val, 0, val->stack (), val->address (),
value_contents_all_raw (val).data (),
type_length_units (val->enclosing_type ()));
if ((VALUE_LVAL (val) == lval_memory && val->lazy ())
|| type->code () == TYPE_CODE_FUNC)
{
- CORE_ADDR addr = value_address (val);
+ CORE_ADDR addr = val->address ();
return value_from_pointer (lookup_pointer_type (type), addr);
}
error (_("Attempt to take address of value not located in memory."));
return value_from_pointer (lookup_pointer_type (type->target_type ()),
- value_address (arg1));
+ arg1->address ());
}
/* Given a value which is a function, return a value which is a pointer
error (_("Attempt to take address of value not located in memory."));
retval = value_from_pointer (lookup_pointer_type (arg1->type ()),
- value_address (arg1));
+ arg1->address ());
return retval;
}
/* Get target memory address. */
arg2 = value_from_pointer (lookup_pointer_type (arg1->type ()),
- (value_address (arg1)
+ (arg1->address ()
+ arg1->embedded_offset ()));
/* This may be a pointer to a base subobject; so remember the
boffset = baseclass_offset (type, i,
value_contents_for_printing (arg1).data (),
arg1->embedded_offset () + offset,
- value_address (arg1),
+ arg1->address (),
arg1);
/* The virtual base class pointer might have been clobbered
{
CORE_ADDR base_addr;
- base_addr = value_address (arg1) + boffset;
+ base_addr = arg1->address () + boffset;
v2 = value_at_lazy (basetype, base_addr);
if (target_read_memory (base_addr,
value_contents_raw (v2).data (),
CORE_ADDR address;
gdb::byte_vector tmp (baseclass->length ());
- address = value_address (*arg1p);
+ address = (*arg1p)->address ();
if (target_read_memory (address + offset,
tmp.data (), baseclass->length ()) != 0)
}
base_offset = baseclass_offset (type, i, base_valaddr,
- this_offset, value_address (base_val),
+ this_offset, base_val->address (),
base_val);
}
else
base_offset = baseclass_offset (type, i,
value_contents_for_printing (*argp).data (),
(*argp)->offset () + offset,
- value_address (*argp), *argp);
+ (*argp)->address (), *argp);
}
else /* Non-virtual base, simply use bit position from debug
info. */
result = allocate_value (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
cplus_make_method_ptr (result->type (),
value_contents_writeable (result).data (),
- value_address (v), 0);
+ v->address (), 0);
}
}
return result;
/* Go back by the computed top_offset from the beginning of the
object, adjusting for the embedded offset of argp if that's what
value_rtti_type used for its computation. */
- new_val = value_at_lazy (real_type, value_address (argp) - top +
+ new_val = value_at_lazy (real_type, argp->address () - top +
(using_enc ? 0 : argp->embedded_offset ()));
new_val->deprecated_set_type (argp->type ());
new_val->set_embedded_offset ((using_enc
else
{
/* Array of unspecified length: treat like pointer to first elt. */
- print_unpacked_pointer (type, elttype, value_address (val),
+ print_unpacked_pointer (type, elttype, val->address (),
stream, options);
}
if (options->format)
value_print_scalar_formatted (val, options, 0, stream);
else
- generic_val_print_func (type, 0, value_address (val), stream,
+ generic_val_print_func (type, 0, val->address (), stream,
val, options);
break;
}
CORE_ADDR
-value_address (const struct value *value)
+value::address () const
{
- if (value->m_lval != lval_memory)
+ if (m_lval != lval_memory)
return 0;
- if (value->m_parent != NULL)
- return value_address (value->m_parent.get ()) + value->m_offset;
- if (NULL != TYPE_DATA_LOCATION (value->type ()))
+ if (m_parent != NULL)
+ return m_parent.get ()->address () + m_offset;
+ if (NULL != TYPE_DATA_LOCATION (type ()))
{
- gdb_assert (PROP_CONST == TYPE_DATA_LOCATION_KIND (value->type ()));
- return TYPE_DATA_LOCATION_ADDR (value->type ());
+ gdb_assert (PROP_CONST == TYPE_DATA_LOCATION_KIND (type ()));
+ return TYPE_DATA_LOCATION_ADDR (type ());
}
- return value->m_location.address + value->m_offset;
+ return m_location.address + m_offset;
}
CORE_ADDR
-value_raw_address (const struct value *value)
+value::raw_address () const
{
- if (value->m_lval != lval_memory)
+ if (m_lval != lval_memory)
return 0;
- return value->m_location.address;
+ return m_location.address;
}
void
-set_value_address (struct value *value, CORE_ADDR addr)
+value::set_address (CORE_ADDR addr)
{
- gdb_assert (value->m_lval == lval_memory);
- value->m_location.address = addr;
+ gdb_assert (m_lval == lval_memory);
+ m_location.address = addr;
}
struct internalvar **
type = whole->type ();
if (NULL != TYPE_DATA_LOCATION (type)
&& TYPE_DATA_LOCATION_KIND (type) == PROP_CONST)
- set_value_address (component, TYPE_DATA_LOCATION_ADDR (type));
+ component->set_address (TYPE_DATA_LOCATION_ADDR (type));
/* Similarly, if the COMPONENT value has a dynamically resolved location
property then update its address. */
}
else
gdb_assert (VALUE_LVAL (component) == lval_memory);
- set_value_address (component, TYPE_DATA_LOCATION_ADDR (type));
+ component->set_address (TYPE_DATA_LOCATION_ADDR (type));
}
}
Upon entry to this function, if VAL is a value of type `function'
(that is, TYPE_CODE (val->type ()) == TYPE_CODE_FUNC), then
- value_address (val) is the address of the function. This is what
+ val->address () is the address of the function. This is what
you'll get if you evaluate an expression like `main'. The call
to COERCE_ARRAY below actually does all the usual unary
conversions, which includes converting values of type `function'
function, just return its address directly. */
if (val->type ()->code () == TYPE_CODE_FUNC
|| val->type ()->code () == TYPE_CODE_METHOD)
- return value_address (val);
+ return val->address ();
val = coerce_array (val);
boffset = baseclass_offset (arg_type, fieldno,
value_contents (arg1).data (),
arg1->embedded_offset (),
- value_address (arg1),
+ arg1->address (),
arg1);
else
boffset = arg_type->field (fieldno).loc_bitpos () / 8;
VALUE_LVAL (v) = lval_memory;
if (sym)
{
- set_value_address (v, sym->value_block ()->entry_pc ());
+ v->set_address (sym->value_block ()->entry_pc ());
}
else
{
struct objfile *objfile = msym.objfile;
struct gdbarch *gdbarch = objfile->arch ();
- set_value_address (v,
- gdbarch_convert_from_func_ptr_addr
- (gdbarch, msym.value_address (),
- current_inferior ()->top_target ()));
+ v->set_address (gdbarch_convert_from_func_ptr_addr
+ (gdbarch, msym.value_address (),
+ current_inferior ()->top_target ()));
}
if (arg1p)
else
v = value_from_contents (type, valaddr);
VALUE_LVAL (v) = lval_memory;
- set_value_address (v, address);
+ v->set_address (address);
return v;
}
&& TYPE_DATA_LOCATION_KIND (resolved_type_no_typedef) == PROP_CONST)
address = TYPE_DATA_LOCATION_ADDR (resolved_type_no_typedef);
VALUE_LVAL (v) = lval_memory;
- set_value_address (v, address);
+ v->set_address (address);
return v;
}
{
gdb_assert (VALUE_LVAL (val) == lval_memory);
- CORE_ADDR addr = value_address (val);
+ CORE_ADDR addr = val->address ();
struct type *type = check_typedef (val->enclosing_type ());
/* Figure out how much we should copy from memory. Usually, this is just
else if (VALUE_LVAL (new_val) == lval_memory)
gdb_printf (&debug_file, " address=%s",
paddress (gdbarch,
- value_address (new_val)));
+ new_val->address ()));
else
gdb_printf (&debug_file, " computed");
void set_initialized (int value)
{ m_initialized = value; }
+ /* If lval == lval_memory, return the address in the inferior. If
+ lval == lval_register, return the byte offset into the registers
+ structure. Otherwise, return 0. The returned address
+ includes the offset, if any. */
+ CORE_ADDR address () const;
+
+ /* Like address, except the result does not include value's
+ offset. */
+ CORE_ADDR raw_address () const;
+
+ /* Set the address of a value. */
+ void set_address (CORE_ADDR);
+
/* Type of value; either not an lval, or one of the various
different possible kinds of lval. */
possible kinds of lval. */
#define VALUE_LVAL(val) (*((val)->deprecated_lval_hack ()))
-/* If lval == lval_memory, return the address in the inferior. If
- lval == lval_register, return the byte offset into the registers
- structure. Otherwise, return 0. The returned address
- includes the offset, if any. */
-extern CORE_ADDR value_address (const struct value *);
-
-/* Like value_address, except the result does not include value's
- offset. */
-extern CORE_ADDR value_raw_address (const struct value *);
-
-/* Set the address of a value. */
-extern void set_value_address (struct value *, CORE_ADDR);
-
/* Pointer to internal variable. */
extern struct internalvar **deprecated_value_internalvar_hack (struct value *);
#define VALUE_INTERNALVAR(val) (*deprecated_value_internalvar_hack (val))