gdb: change functions returning value contents to use gdb::array_view
The bug fixed by this [1] patch was caused by an out-of-bounds access to a value's content. The code gets the value's content (just a pointer) and then indexes it with a non-sensical index. This made me think of changing functions that return value contents to return array_views instead of a plain pointer. This has the advantage that when GDB is built with _GLIBCXX_DEBUG, accesses to the array_view are checked, making bugs more apparent / easier to find. This patch changes the return types of these functions, and updates callers to call .data() on the result, meaning it's not changing anything in practice. Additional work will be needed (which can be done little by little) to make callers propagate the use of array_view and reap the benefits. [1] https://sourceware.org/pipermail/gdb-patches/2021-September/182306.html Change-Id: I5151f888f169e1c36abe2cbc57620110673816f3
This commit is contained in:
parent
d9f82e9313
commit
50888e42dc
96 changed files with 453 additions and 417 deletions
|
@ -1621,7 +1621,7 @@ aarch64_linux_set_memtags (struct gdbarch *gdbarch, struct value *address,
|
||||||
|
|
||||||
/* Update the value's content with the tag. */
|
/* Update the value's content with the tag. */
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
gdb_byte *srcbuf = value_contents_raw (address);
|
gdb_byte *srcbuf = value_contents_raw (address).data ();
|
||||||
store_unsigned_integer (srcbuf, sizeof (addr), byte_order, addr);
|
store_unsigned_integer (srcbuf, sizeof (addr), byte_order, addr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1593,7 +1593,7 @@ pass_in_x (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
enum type_code typecode = type->code ();
|
enum type_code typecode = type->code ();
|
||||||
int regnum = AARCH64_X0_REGNUM + info->ngrn;
|
int regnum = AARCH64_X0_REGNUM + info->ngrn;
|
||||||
const bfd_byte *buf = value_contents (arg);
|
const bfd_byte *buf = value_contents (arg).data ();
|
||||||
|
|
||||||
info->argnum++;
|
info->argnum++;
|
||||||
|
|
||||||
|
@ -1663,7 +1663,7 @@ static void
|
||||||
pass_on_stack (struct aarch64_call_info *info, struct type *type,
|
pass_on_stack (struct aarch64_call_info *info, struct type *type,
|
||||||
struct value *arg)
|
struct value *arg)
|
||||||
{
|
{
|
||||||
const bfd_byte *buf = value_contents (arg);
|
const bfd_byte *buf = value_contents (arg).data ();
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
int align;
|
int align;
|
||||||
stack_item_t item;
|
stack_item_t item;
|
||||||
|
@ -1739,12 +1739,12 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||||
{
|
{
|
||||||
case TYPE_CODE_FLT:
|
case TYPE_CODE_FLT:
|
||||||
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
|
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_COMPLEX:
|
case TYPE_CODE_COMPLEX:
|
||||||
{
|
{
|
||||||
const bfd_byte *buf = value_contents (arg);
|
const bfd_byte *buf = value_contents (arg).data ();
|
||||||
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
|
struct type *target_type = check_typedef (TYPE_TARGET_TYPE (arg_type));
|
||||||
|
|
||||||
if (!pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (target_type),
|
if (!pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (target_type),
|
||||||
|
@ -1758,7 +1758,7 @@ pass_in_v_vfp_candidate (struct gdbarch *gdbarch, struct regcache *regcache,
|
||||||
case TYPE_CODE_ARRAY:
|
case TYPE_CODE_ARRAY:
|
||||||
if (arg_type->is_vector ())
|
if (arg_type->is_vector ())
|
||||||
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
|
return pass_in_v (gdbarch, regcache, info, TYPE_LENGTH (arg_type),
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
/* fall through. */
|
/* fall through. */
|
||||||
|
|
||||||
case TYPE_CODE_STRUCT:
|
case TYPE_CODE_STRUCT:
|
||||||
|
@ -1900,7 +1900,7 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
sp = align_down (sp - len, 16);
|
sp = align_down (sp - len, 16);
|
||||||
|
|
||||||
/* Write the real data into the stack. */
|
/* Write the real data into the stack. */
|
||||||
write_memory (sp, value_contents (arg), len);
|
write_memory (sp, value_contents (arg).data (), len);
|
||||||
|
|
||||||
/* Construct the indirection. */
|
/* Construct the indirection. */
|
||||||
arg_type = lookup_pointer_type (arg_type);
|
arg_type = lookup_pointer_type (arg_type);
|
||||||
|
@ -2682,7 +2682,7 @@ aarch64_pseudo_read_value_1 (struct gdbarch *gdbarch,
|
||||||
mark_value_bytes_unavailable (result_value, 0,
|
mark_value_bytes_unavailable (result_value, 0,
|
||||||
TYPE_LENGTH (value_type (result_value)));
|
TYPE_LENGTH (value_type (result_value)));
|
||||||
else
|
else
|
||||||
memcpy (value_contents_raw (result_value), reg_buf, regsize);
|
memcpy (value_contents_raw (result_value).data (), reg_buf, regsize);
|
||||||
|
|
||||||
return result_value;
|
return result_value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2181,7 +2181,7 @@ decode_constrained_packed_array (struct value *arr)
|
||||||
bounds may be variable and were not passed to that function. So,
|
bounds may be variable and were not passed to that function. So,
|
||||||
we further resolve the array bounds here and then update the
|
we further resolve the array bounds here and then update the
|
||||||
sizes. */
|
sizes. */
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (arr);
|
const gdb_byte *valaddr = value_contents_for_printing (arr).data ();
|
||||||
CORE_ADDR address = value_address (arr);
|
CORE_ADDR address = value_address (arr);
|
||||||
gdb::array_view<const gdb_byte> view
|
gdb::array_view<const gdb_byte> view
|
||||||
= gdb::make_array_view (valaddr, TYPE_LENGTH (type));
|
= gdb::make_array_view (valaddr, TYPE_LENGTH (type));
|
||||||
|
@ -2438,7 +2438,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
|
||||||
if (obj == NULL)
|
if (obj == NULL)
|
||||||
src = valaddr + offset;
|
src = valaddr + offset;
|
||||||
else
|
else
|
||||||
src = value_contents (obj) + offset;
|
src = value_contents (obj).data () + offset;
|
||||||
|
|
||||||
if (is_dynamic_type (type))
|
if (is_dynamic_type (type))
|
||||||
{
|
{
|
||||||
|
@ -2488,7 +2488,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
v = allocate_value (type);
|
v = allocate_value (type);
|
||||||
src = value_contents (obj) + offset;
|
src = value_contents (obj).data () + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (obj != NULL)
|
if (obj != NULL)
|
||||||
|
@ -2511,7 +2511,7 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
set_value_bitsize (v, bit_size);
|
set_value_bitsize (v, bit_size);
|
||||||
unpacked = value_contents_writeable (v);
|
unpacked = value_contents_writeable (v).data ();
|
||||||
|
|
||||||
if (bit_size == 0)
|
if (bit_size == 0)
|
||||||
{
|
{
|
||||||
|
@ -2581,12 +2581,13 @@ ada_value_assign (struct value *toval, struct value *fromval)
|
||||||
if (is_big_endian && is_scalar_type (value_type (fromval)))
|
if (is_big_endian && is_scalar_type (value_type (fromval)))
|
||||||
from_offset = from_size - bits;
|
from_offset = from_size - bits;
|
||||||
copy_bitwise (buffer, value_bitpos (toval),
|
copy_bitwise (buffer, value_bitpos (toval),
|
||||||
value_contents (fromval), from_offset,
|
value_contents (fromval).data (), from_offset,
|
||||||
bits, is_big_endian);
|
bits, is_big_endian);
|
||||||
write_memory_with_notification (to_addr, buffer, len);
|
write_memory_with_notification (to_addr, buffer, len);
|
||||||
|
|
||||||
val = value_copy (toval);
|
val = value_copy (toval);
|
||||||
memcpy (value_contents_raw (val), value_contents (fromval),
|
memcpy (value_contents_raw (val).data (),
|
||||||
|
value_contents (fromval).data (),
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
deprecated_set_value_type (val, type);
|
deprecated_set_value_type (val, type);
|
||||||
|
|
||||||
|
@ -2634,14 +2635,16 @@ value_assign_to_component (struct value *container, struct value *component,
|
||||||
= TYPE_LENGTH (value_type (component)) * TARGET_CHAR_BIT - bits;
|
= TYPE_LENGTH (value_type (component)) * TARGET_CHAR_BIT - bits;
|
||||||
else
|
else
|
||||||
src_offset = 0;
|
src_offset = 0;
|
||||||
copy_bitwise (value_contents_writeable (container) + offset_in_container,
|
copy_bitwise ((value_contents_writeable (container).data ()
|
||||||
|
+ offset_in_container),
|
||||||
value_bitpos (container) + bit_offset_in_container,
|
value_bitpos (container) + bit_offset_in_container,
|
||||||
value_contents (val), src_offset, bits, 1);
|
value_contents (val).data (), src_offset, bits, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
copy_bitwise (value_contents_writeable (container) + offset_in_container,
|
copy_bitwise ((value_contents_writeable (container).data ()
|
||||||
|
+ offset_in_container),
|
||||||
value_bitpos (container) + bit_offset_in_container,
|
value_bitpos (container) + bit_offset_in_container,
|
||||||
value_contents (val), 0, bits, 0);
|
value_contents (val).data (), 0, bits, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine if TYPE is an access to an unconstrained array. */
|
/* Determine if TYPE is an access to an unconstrained array. */
|
||||||
|
@ -4010,7 +4013,7 @@ ensure_lval (struct value *val)
|
||||||
|
|
||||||
VALUE_LVAL (val) = lval_memory;
|
VALUE_LVAL (val) = lval_memory;
|
||||||
set_value_address (val, addr);
|
set_value_address (val, addr);
|
||||||
write_memory (addr, value_contents (val), len);
|
write_memory (addr, value_contents (val).data (), len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
|
@ -4181,8 +4184,8 @@ ada_convert_actual (struct value *actual, struct type *formal_type0)
|
||||||
|
|
||||||
actual_type = ada_check_typedef (value_type (actual));
|
actual_type = ada_check_typedef (value_type (actual));
|
||||||
val = allocate_value (actual_type);
|
val = allocate_value (actual_type);
|
||||||
memcpy ((char *) value_contents_raw (val),
|
memcpy ((char *) value_contents_raw (val).data (),
|
||||||
(char *) value_contents (actual),
|
(char *) value_contents (actual).data (),
|
||||||
TYPE_LENGTH (actual_type));
|
TYPE_LENGTH (actual_type));
|
||||||
actual = ensure_lval (val);
|
actual = ensure_lval (val);
|
||||||
}
|
}
|
||||||
|
@ -4245,11 +4248,13 @@ make_array_descriptor (struct type *type, struct value *arr)
|
||||||
for (i = ada_array_arity (ada_check_typedef (value_type (arr)));
|
for (i = ada_array_arity (ada_check_typedef (value_type (arr)));
|
||||||
i > 0; i -= 1)
|
i > 0; i -= 1)
|
||||||
{
|
{
|
||||||
modify_field (value_type (bounds), value_contents_writeable (bounds),
|
modify_field (value_type (bounds),
|
||||||
|
value_contents_writeable (bounds).data (),
|
||||||
ada_array_bound (arr, i, 0),
|
ada_array_bound (arr, i, 0),
|
||||||
desc_bound_bitpos (bounds_type, i, 0),
|
desc_bound_bitpos (bounds_type, i, 0),
|
||||||
desc_bound_bitsize (bounds_type, i, 0));
|
desc_bound_bitsize (bounds_type, i, 0));
|
||||||
modify_field (value_type (bounds), value_contents_writeable (bounds),
|
modify_field (value_type (bounds),
|
||||||
|
value_contents_writeable (bounds).data (),
|
||||||
ada_array_bound (arr, i, 1),
|
ada_array_bound (arr, i, 1),
|
||||||
desc_bound_bitpos (bounds_type, i, 1),
|
desc_bound_bitpos (bounds_type, i, 1),
|
||||||
desc_bound_bitsize (bounds_type, i, 1));
|
desc_bound_bitsize (bounds_type, i, 1));
|
||||||
|
@ -4258,14 +4263,14 @@ make_array_descriptor (struct type *type, struct value *arr)
|
||||||
bounds = ensure_lval (bounds);
|
bounds = ensure_lval (bounds);
|
||||||
|
|
||||||
modify_field (value_type (descriptor),
|
modify_field (value_type (descriptor),
|
||||||
value_contents_writeable (descriptor),
|
value_contents_writeable (descriptor).data (),
|
||||||
value_pointer (ensure_lval (arr),
|
value_pointer (ensure_lval (arr),
|
||||||
desc_type->field (0).type ()),
|
desc_type->field (0).type ()),
|
||||||
fat_pntr_data_bitpos (desc_type),
|
fat_pntr_data_bitpos (desc_type),
|
||||||
fat_pntr_data_bitsize (desc_type));
|
fat_pntr_data_bitsize (desc_type));
|
||||||
|
|
||||||
modify_field (value_type (descriptor),
|
modify_field (value_type (descriptor),
|
||||||
value_contents_writeable (descriptor),
|
value_contents_writeable (descriptor).data (),
|
||||||
value_pointer (bounds,
|
value_pointer (bounds,
|
||||||
desc_type->field (1).type ()),
|
desc_type->field (1).type ()),
|
||||||
fat_pntr_bounds_bitpos (desc_type),
|
fat_pntr_bounds_bitpos (desc_type),
|
||||||
|
@ -6553,7 +6558,8 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno,
|
||||||
int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
|
int bit_pos = TYPE_FIELD_BITPOS (arg_type, fieldno);
|
||||||
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
|
int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno);
|
||||||
|
|
||||||
return ada_value_primitive_packed_val (arg1, value_contents (arg1),
|
return ada_value_primitive_packed_val (arg1,
|
||||||
|
value_contents (arg1).data (),
|
||||||
offset + bit_pos / 8,
|
offset + bit_pos / 8,
|
||||||
bit_pos % 8, bit_size, type);
|
bit_pos % 8, bit_size, type);
|
||||||
}
|
}
|
||||||
|
@ -8480,7 +8486,7 @@ ada_to_fixed_value_create (struct type *type0, CORE_ADDR address,
|
||||||
/* Our value does not live in memory; it could be a convenience
|
/* Our value does not live in memory; it could be a convenience
|
||||||
variable, for instance. Create a not_lval value using val0's
|
variable, for instance. Create a not_lval value using val0's
|
||||||
contents. */
|
contents. */
|
||||||
return value_from_contents (type, value_contents (val0));
|
return value_from_contents (type, value_contents (val0).data ());
|
||||||
}
|
}
|
||||||
|
|
||||||
return value_from_contents_and_address (type, 0, address);
|
return value_from_contents_and_address (type, 0, address);
|
||||||
|
@ -8916,8 +8922,9 @@ ada_promote_array_of_integrals (struct type *type, struct value *val)
|
||||||
{
|
{
|
||||||
struct value *elt = value_cast (elt_type, value_subscript (val, lo + i));
|
struct value *elt = value_cast (elt_type, value_subscript (val, lo + i));
|
||||||
|
|
||||||
memcpy (value_contents_writeable (res) + (i * TYPE_LENGTH (elt_type)),
|
memcpy ((value_contents_writeable (res).data ()
|
||||||
value_contents_all (elt), TYPE_LENGTH (elt_type));
|
+ (i * TYPE_LENGTH (elt_type))),
|
||||||
|
value_contents_all (elt).data (), TYPE_LENGTH (elt_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
@ -9033,7 +9040,7 @@ ada_value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||||
}
|
}
|
||||||
|
|
||||||
val = allocate_value (type1);
|
val = allocate_value (type1);
|
||||||
store_unsigned_integer (value_contents_raw (val),
|
store_unsigned_integer (value_contents_raw (val).data (),
|
||||||
TYPE_LENGTH (value_type (val)),
|
TYPE_LENGTH (value_type (val)),
|
||||||
type_byte_order (type1), v);
|
type_byte_order (type1), v);
|
||||||
return val;
|
return val;
|
||||||
|
@ -9065,7 +9072,8 @@ ada_value_equal (struct value *arg1, struct value *arg2)
|
||||||
representations use all bits (no padding or undefined bits)
|
representations use all bits (no padding or undefined bits)
|
||||||
and do not have user-defined equality. */
|
and do not have user-defined equality. */
|
||||||
return (TYPE_LENGTH (arg1_type) == TYPE_LENGTH (arg2_type)
|
return (TYPE_LENGTH (arg1_type) == TYPE_LENGTH (arg2_type)
|
||||||
&& memcmp (value_contents (arg1), value_contents (arg2),
|
&& memcmp (value_contents (arg1).data (),
|
||||||
|
value_contents (arg2).data (),
|
||||||
TYPE_LENGTH (arg1_type)) == 0);
|
TYPE_LENGTH (arg1_type)) == 0);
|
||||||
}
|
}
|
||||||
return value_equal (arg1, arg2);
|
return value_equal (arg1, arg2);
|
||||||
|
|
|
@ -401,7 +401,7 @@ iterate_over_live_ada_tasks (ada_task_list_iterator_ftype iterator)
|
||||||
static void
|
static void
|
||||||
value_as_string (char *dest, struct value *val, int length)
|
value_as_string (char *dest, struct value *val, int length)
|
||||||
{
|
{
|
||||||
memcpy (dest, value_contents (val), length);
|
memcpy (dest, value_contents (val).data (), length);
|
||||||
dest[length] = '\0';
|
dest[length] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -747,7 +747,7 @@ ada_value_print_num (struct value *val, struct ui_file *stream, int recurse,
|
||||||
const struct value_print_options *options)
|
const struct value_print_options *options)
|
||||||
{
|
{
|
||||||
struct type *type = ada_check_typedef (value_type (val));
|
struct type *type = ada_check_typedef (value_type (val));
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
if (type->code () == TYPE_CODE_RANGE
|
if (type->code () == TYPE_CODE_RANGE
|
||||||
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_ENUM
|
&& (TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_ENUM
|
||||||
|
@ -827,7 +827,7 @@ ada_val_print_enum (struct value *value, struct ui_file *stream, int recurse,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct type *type = ada_check_typedef (value_type (value));
|
struct type *type = ada_check_typedef (value_type (value));
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (value);
|
const gdb_byte *valaddr = value_contents_for_printing (value).data ();
|
||||||
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
|
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
|
||||||
|
|
||||||
len = type->num_fields ();
|
len = type->num_fields ();
|
||||||
|
@ -895,7 +895,7 @@ ada_value_print_array (struct value *val, struct ui_file *stream, int recurse,
|
||||||
if (ada_is_string_type (type)
|
if (ada_is_string_type (type)
|
||||||
&& (options->format == 0 || options->format == 's'))
|
&& (options->format == 0 || options->format == 's'))
|
||||||
{
|
{
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
|
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
|
||||||
|
|
||||||
ada_val_print_string (type, valaddr, offset_aligned, stream, recurse,
|
ada_val_print_string (type, valaddr, offset_aligned, stream, recurse,
|
||||||
|
@ -910,7 +910,7 @@ ada_value_print_array (struct value *val, struct ui_file *stream, int recurse,
|
||||||
val_print_optimized_out (val, stream);
|
val_print_optimized_out (val, stream);
|
||||||
else if (TYPE_FIELD_BITSIZE (type, 0) > 0)
|
else if (TYPE_FIELD_BITSIZE (type, 0) > 0)
|
||||||
{
|
{
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
|
int offset_aligned = ada_aligned_value_addr (type, valaddr) - valaddr;
|
||||||
val_print_packed_array_elements (type, valaddr, offset_aligned,
|
val_print_packed_array_elements (type, valaddr, offset_aligned,
|
||||||
stream, recurse, options);
|
stream, recurse, options);
|
||||||
|
@ -1009,7 +1009,7 @@ ada_value_print_1 (struct value *val, struct ui_file *stream, int recurse,
|
||||||
type = value_type (val);
|
type = value_type (val);
|
||||||
struct type *saved_type = type;
|
struct type *saved_type = type;
|
||||||
|
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
CORE_ADDR address = value_address (val);
|
CORE_ADDR address = value_address (val);
|
||||||
gdb::array_view<const gdb_byte> view
|
gdb::array_view<const gdb_byte> view
|
||||||
= gdb::make_array_view (valaddr, TYPE_LENGTH (type));
|
= gdb::make_array_view (valaddr, TYPE_LENGTH (type));
|
||||||
|
|
|
@ -258,7 +258,7 @@ alpha_register_to_value (struct frame_info *frame, int regnum,
|
||||||
/* Convert to VALTYPE. */
|
/* Convert to VALTYPE. */
|
||||||
|
|
||||||
gdb_assert (TYPE_LENGTH (valtype) == 4);
|
gdb_assert (TYPE_LENGTH (valtype) == 4);
|
||||||
alpha_sts (gdbarch, out, value_contents_all (value));
|
alpha_sts (gdbarch, out, value_contents_all (value).data ());
|
||||||
|
|
||||||
release_value (value);
|
release_value (value);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -365,7 +365,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
sp = (sp & -16) - 16;
|
sp = (sp & -16) - 16;
|
||||||
|
|
||||||
/* Write the real data into the stack. */
|
/* Write the real data into the stack. */
|
||||||
write_memory (sp, value_contents (arg), 16);
|
write_memory (sp, value_contents (arg).data (), 16);
|
||||||
|
|
||||||
/* Construct the indirection. */
|
/* Construct the indirection. */
|
||||||
arg_type = lookup_pointer_type (arg_type);
|
arg_type = lookup_pointer_type (arg_type);
|
||||||
|
@ -386,7 +386,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
sp = (sp & -16) - 16;
|
sp = (sp & -16) - 16;
|
||||||
|
|
||||||
/* Write the real data into the stack. */
|
/* Write the real data into the stack. */
|
||||||
write_memory (sp, value_contents (arg), 32);
|
write_memory (sp, value_contents (arg).data (), 32);
|
||||||
|
|
||||||
/* Construct the indirection. */
|
/* Construct the indirection. */
|
||||||
arg_type = lookup_pointer_type (arg_type);
|
arg_type = lookup_pointer_type (arg_type);
|
||||||
|
@ -400,7 +400,7 @@ alpha_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
m_arg->len = TYPE_LENGTH (arg_type);
|
m_arg->len = TYPE_LENGTH (arg_type);
|
||||||
m_arg->offset = accumulate_size;
|
m_arg->offset = accumulate_size;
|
||||||
accumulate_size = (accumulate_size + m_arg->len + 7) & ~7;
|
accumulate_size = (accumulate_size + m_arg->len + 7) & ~7;
|
||||||
m_arg->contents = value_contents (arg);
|
m_arg->contents = value_contents (arg).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine required argument register loads, loading an argument register
|
/* Determine required argument register loads, loading an argument register
|
||||||
|
|
|
@ -358,7 +358,7 @@ amd64_pseudo_register_read_value (struct gdbarch *gdbarch,
|
||||||
value *result_value = allocate_value (register_type (gdbarch, regnum));
|
value *result_value = allocate_value (register_type (gdbarch, regnum));
|
||||||
VALUE_LVAL (result_value) = lval_register;
|
VALUE_LVAL (result_value) = lval_register;
|
||||||
VALUE_REGNUM (result_value) = regnum;
|
VALUE_REGNUM (result_value) = regnum;
|
||||||
gdb_byte *buf = value_contents_raw (result_value);
|
gdb_byte *buf = value_contents_raw (result_value).data ();
|
||||||
|
|
||||||
if (i386_byte_regnum_p (gdbarch, regnum))
|
if (i386_byte_regnum_p (gdbarch, regnum))
|
||||||
{
|
{
|
||||||
|
@ -977,7 +977,7 @@ if (return_method == return_method_struct)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The argument will be passed in registers. */
|
/* The argument will be passed in registers. */
|
||||||
const gdb_byte *valbuf = value_contents (args[i]);
|
const gdb_byte *valbuf = value_contents (args[i]).data ();
|
||||||
gdb_byte buf[8];
|
gdb_byte buf[8];
|
||||||
|
|
||||||
gdb_assert (len <= 16);
|
gdb_assert (len <= 16);
|
||||||
|
@ -1029,7 +1029,7 @@ if (return_method == return_method_struct)
|
||||||
for (i = 0; i < num_stack_args; i++)
|
for (i = 0; i < num_stack_args; i++)
|
||||||
{
|
{
|
||||||
struct type *type = value_type (stack_args[i]);
|
struct type *type = value_type (stack_args[i]);
|
||||||
const gdb_byte *valbuf = value_contents (stack_args[i]);
|
const gdb_byte *valbuf = value_contents (stack_args[i]).data ();
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
|
|
||||||
write_memory (sp + element * 8, valbuf, len);
|
write_memory (sp + element * 8, valbuf, len);
|
||||||
|
|
|
@ -179,7 +179,7 @@ amd64_windows_adjust_args_passed_by_pointer (struct value **args,
|
||||||
if (amd64_windows_passed_by_pointer (value_type (args[i])))
|
if (amd64_windows_passed_by_pointer (value_type (args[i])))
|
||||||
{
|
{
|
||||||
struct type *type = value_type (args[i]);
|
struct type *type = value_type (args[i]);
|
||||||
const gdb_byte *valbuf = value_contents (args[i]);
|
const gdb_byte *valbuf = value_contents (args[i]).data ();
|
||||||
const int len = TYPE_LENGTH (type);
|
const int len = TYPE_LENGTH (type);
|
||||||
|
|
||||||
/* Store a copy of that argument on the stack, aligned to
|
/* Store a copy of that argument on the stack, aligned to
|
||||||
|
@ -205,7 +205,7 @@ amd64_windows_store_arg_in_reg (struct regcache *regcache,
|
||||||
struct value *arg, int regno)
|
struct value *arg, int regno)
|
||||||
{
|
{
|
||||||
struct type *type = value_type (arg);
|
struct type *type = value_type (arg);
|
||||||
const gdb_byte *valbuf = value_contents (arg);
|
const gdb_byte *valbuf = value_contents (arg).data ();
|
||||||
gdb_byte buf[8];
|
gdb_byte buf[8];
|
||||||
|
|
||||||
gdb_assert (TYPE_LENGTH (type) <= 8);
|
gdb_assert (TYPE_LENGTH (type) <= 8);
|
||||||
|
@ -295,7 +295,7 @@ amd64_windows_push_arguments (struct regcache *regcache, int nargs,
|
||||||
for (i = 0; i < num_stack_args; i++)
|
for (i = 0; i < num_stack_args; i++)
|
||||||
{
|
{
|
||||||
struct type *type = value_type (stack_args[i]);
|
struct type *type = value_type (stack_args[i]);
|
||||||
const gdb_byte *valbuf = value_contents (stack_args[i]);
|
const gdb_byte *valbuf = value_contents (stack_args[i]).data ();
|
||||||
|
|
||||||
write_memory (sp + element * 8, valbuf, TYPE_LENGTH (type));
|
write_memory (sp + element * 8, valbuf, TYPE_LENGTH (type));
|
||||||
element += ((TYPE_LENGTH (type) + 7) / 8);
|
element += ((TYPE_LENGTH (type) + 7) / 8);
|
||||||
|
|
|
@ -779,9 +779,10 @@ arc_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
unsigned int len = TYPE_LENGTH (value_type (args[i]));
|
unsigned int len = TYPE_LENGTH (value_type (args[i]));
|
||||||
unsigned int space = align_up (len, 4);
|
unsigned int space = align_up (len, 4);
|
||||||
|
|
||||||
memcpy (data, value_contents (args[i]), (size_t) len);
|
memcpy (data, value_contents (args[i]).data (), (size_t) len);
|
||||||
arc_debug_printf ("copying arg %d, val 0x%08x, len %d to mem",
|
arc_debug_printf ("copying arg %d, val 0x%08x, len %d to mem",
|
||||||
i, *((int *) value_contents (args[i])), len);
|
i, *((int *) value_contents (args[i]).data ()),
|
||||||
|
len);
|
||||||
|
|
||||||
data += space;
|
data += space;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3820,7 +3820,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
len = TYPE_LENGTH (arg_type);
|
len = TYPE_LENGTH (arg_type);
|
||||||
target_type = TYPE_TARGET_TYPE (arg_type);
|
target_type = TYPE_TARGET_TYPE (arg_type);
|
||||||
typecode = arg_type->code ();
|
typecode = arg_type->code ();
|
||||||
val = value_contents (args[argnum]);
|
val = value_contents (args[argnum]).data ();
|
||||||
|
|
||||||
align = type_align (arg_type);
|
align = type_align (arg_type);
|
||||||
/* Round alignment up to a whole number of words. */
|
/* Round alignment up to a whole number of words. */
|
||||||
|
|
|
@ -1296,7 +1296,7 @@ avr_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
int j;
|
int j;
|
||||||
struct value *arg = args[i];
|
struct value *arg = args[i];
|
||||||
struct type *type = check_typedef (value_type (arg));
|
struct type *type = check_typedef (value_type (arg));
|
||||||
const bfd_byte *contents = value_contents (arg);
|
const bfd_byte *contents = value_contents (arg).data ();
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
|
|
||||||
/* Calculate the potential last register needed.
|
/* Calculate the potential last register needed.
|
||||||
|
|
|
@ -530,7 +530,7 @@ bfin_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
int container_len = align_up (TYPE_LENGTH (arg_type), 4);
|
int container_len = align_up (TYPE_LENGTH (arg_type), 4);
|
||||||
|
|
||||||
sp -= container_len;
|
sp -= container_len;
|
||||||
write_memory (sp, value_contents (args[i]), container_len);
|
write_memory (sp, value_contents (args[i]).data (), container_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialize R0, R1, and R2 to the first 3 words of parameters. */
|
/* Initialize R0, R1, and R2 to the first 3 words of parameters. */
|
||||||
|
|
|
@ -1695,7 +1695,7 @@ extract_bitfield_from_watchpoint_value (struct watchpoint *w, struct value *val)
|
||||||
unpack_value_bitfield (bit_val,
|
unpack_value_bitfield (bit_val,
|
||||||
w->val_bitpos,
|
w->val_bitpos,
|
||||||
w->val_bitsize,
|
w->val_bitsize,
|
||||||
value_contents_for_printing (val),
|
value_contents_for_printing (val).data (),
|
||||||
value_offset (val),
|
value_offset (val),
|
||||||
val);
|
val);
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr<gdb_byte> *buffer,
|
||||||
&& (*length < 0 || *length <= fetchlimit))
|
&& (*length < 0 || *length <= fetchlimit))
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const gdb_byte *contents = value_contents (value);
|
const gdb_byte *contents = value_contents (value).data ();
|
||||||
|
|
||||||
/* If a length is specified, use that. */
|
/* If a length is specified, use that. */
|
||||||
if (*length >= 0)
|
if (*length >= 0)
|
||||||
|
@ -675,7 +675,7 @@ c_string_operation::evaluate (struct type *expect_type,
|
||||||
error (_("Too many array elements"));
|
error (_("Too many array elements"));
|
||||||
|
|
||||||
result = allocate_value (expect_type);
|
result = allocate_value (expect_type);
|
||||||
memcpy (value_contents_raw (result), obstack_base (&output),
|
memcpy (value_contents_raw (result).data (), obstack_base (&output),
|
||||||
obstack_object_size (&output));
|
obstack_object_size (&output));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -237,7 +237,7 @@ c_value_print_array (struct value *val,
|
||||||
{
|
{
|
||||||
struct type *type = check_typedef (value_type (val));
|
struct type *type = check_typedef (value_type (val));
|
||||||
CORE_ADDR address = value_address (val);
|
CORE_ADDR address = value_address (val);
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
struct type *unresolved_elttype = TYPE_TARGET_TYPE (type);
|
struct type *unresolved_elttype = TYPE_TARGET_TYPE (type);
|
||||||
struct type *elttype = check_typedef (unresolved_elttype);
|
struct type *elttype = check_typedef (unresolved_elttype);
|
||||||
|
|
||||||
|
@ -333,7 +333,7 @@ c_value_print_ptr (struct value *val, struct ui_file *stream, int recurse,
|
||||||
}
|
}
|
||||||
|
|
||||||
struct type *type = check_typedef (value_type (val));
|
struct type *type = check_typedef (value_type (val));
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
if (options->vtblprint && cp_is_vtbl_ptr_type (type))
|
if (options->vtblprint && cp_is_vtbl_ptr_type (type))
|
||||||
{
|
{
|
||||||
|
@ -374,7 +374,7 @@ c_value_print_struct (struct value *val, struct ui_file *stream, int recurse,
|
||||||
TYPE_CODE_PTR.) */
|
TYPE_CODE_PTR.) */
|
||||||
int offset = TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8;
|
int offset = TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8;
|
||||||
struct type *field_type = type->field (VTBL_FNADDR_OFFSET).type ();
|
struct type *field_type = type->field (VTBL_FNADDR_OFFSET).type ();
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
CORE_ADDR addr = extract_typed_address (valaddr + offset, field_type);
|
CORE_ADDR addr = extract_typed_address (valaddr + offset, field_type);
|
||||||
|
|
||||||
print_function_pointer_address (options, type->arch (), addr, stream);
|
print_function_pointer_address (options, type->arch (), addr, stream);
|
||||||
|
@ -405,7 +405,7 @@ c_value_print_int (struct value *val, struct ui_file *stream,
|
||||||
intended to be used as an integer or a character, print
|
intended to be used as an integer or a character, print
|
||||||
the character equivalent as well. */
|
the character equivalent as well. */
|
||||||
struct type *type = value_type (val);
|
struct type *type = value_type (val);
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
if (c_textual_element_type (type, options->format))
|
if (c_textual_element_type (type, options->format))
|
||||||
{
|
{
|
||||||
fputs_filtered (" ", stream);
|
fputs_filtered (" ", stream);
|
||||||
|
|
|
@ -2075,7 +2075,7 @@ setting_cmd (const char *fnname, struct cmd_list_element *showlist,
|
||||||
&& type0->code () != TYPE_CODE_STRING)
|
&& type0->code () != TYPE_CODE_STRING)
|
||||||
error (_("First argument of %s must be a string."), fnname);
|
error (_("First argument of %s must be a string."), fnname);
|
||||||
|
|
||||||
const char *a0 = (const char *) value_contents (argv[0]);
|
const char *a0 = (const char *) value_contents (argv[0]).data ();
|
||||||
cmd_list_element *cmd = lookup_cmd (&a0, showlist, "", NULL, -1, 0);
|
cmd_list_element *cmd = lookup_cmd (&a0, showlist, "", NULL, -1, 0);
|
||||||
|
|
||||||
if (cmd == nullptr || cmd->type != show_cmd)
|
if (cmd == nullptr || cmd->type != show_cmd)
|
||||||
|
|
|
@ -224,7 +224,7 @@ dump_value_to_file (const char *cmd, const char *mode, const char *file_format)
|
||||||
|
|
||||||
/* Have everything. Open/write the data. */
|
/* Have everything. Open/write the data. */
|
||||||
if (file_format == NULL || strcmp (file_format, "binary") == 0)
|
if (file_format == NULL || strcmp (file_format, "binary") == 0)
|
||||||
dump_binary_file (filename.get (), mode, value_contents (val),
|
dump_binary_file (filename.get (), mode, value_contents (val).data (),
|
||||||
TYPE_LENGTH (value_type (val)));
|
TYPE_LENGTH (value_type (val)));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -241,7 +241,7 @@ dump_value_to_file (const char *cmd, const char *mode, const char *file_format)
|
||||||
}
|
}
|
||||||
|
|
||||||
dump_bfd_file (filename.get (), mode, file_format, vaddr,
|
dump_bfd_file (filename.get (), mode, file_format, vaddr,
|
||||||
value_contents (val),
|
value_contents (val).data (),
|
||||||
TYPE_LENGTH (value_type (val)));
|
TYPE_LENGTH (value_type (val)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -585,7 +585,8 @@ store_regs (struct type *regs_type, CORE_ADDR regs_base)
|
||||||
error (_("Register \"%s\" is not available."), reg_name);
|
error (_("Register \"%s\" is not available."), reg_name);
|
||||||
|
|
||||||
inferior_addr = regs_base + reg_offset;
|
inferior_addr = regs_base + reg_offset;
|
||||||
if (0 != target_write_memory (inferior_addr, value_contents (regval),
|
if (0 != target_write_memory (inferior_addr,
|
||||||
|
value_contents (regval).data (),
|
||||||
reg_size))
|
reg_size))
|
||||||
error (_("Cannot write register \"%s\" to inferior memory at %s."),
|
error (_("Cannot write register \"%s\" to inferior memory at %s."),
|
||||||
reg_name, paddress (gdbarch, inferior_addr));
|
reg_name, paddress (gdbarch, inferior_addr));
|
||||||
|
|
|
@ -189,7 +189,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
|
||||||
vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype);
|
vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype);
|
||||||
for (i = n_baseclasses; i < len; i++)
|
for (i = n_baseclasses; i < len; i++)
|
||||||
{
|
{
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
/* If requested, skip printing of static fields. */
|
/* If requested, skip printing of static fields. */
|
||||||
if (!options->static_field_print
|
if (!options->static_field_print
|
||||||
|
@ -397,7 +397,7 @@ cp_print_value (struct value *val, struct ui_file *stream,
|
||||||
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
|
= (struct type **) obstack_next_free (&dont_print_vb_obstack);
|
||||||
struct obstack tmp_obstack = dont_print_vb_obstack;
|
struct obstack tmp_obstack = dont_print_vb_obstack;
|
||||||
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
|
int i, n_baseclasses = TYPE_N_BASECLASSES (type);
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
if (dont_print_vb == 0)
|
if (dont_print_vb == 0)
|
||||||
{
|
{
|
||||||
|
@ -761,7 +761,7 @@ test_print_fields (gdbarch *arch)
|
||||||
}
|
}
|
||||||
|
|
||||||
value *val = allocate_value (the_struct);
|
value *val = allocate_value (the_struct);
|
||||||
gdb_byte *contents = value_contents_writeable (val);
|
gdb_byte *contents = value_contents_writeable (val).data ();
|
||||||
store_unsigned_integer (contents, TYPE_LENGTH (value_enclosing_type (val)),
|
store_unsigned_integer (contents, TYPE_LENGTH (value_enclosing_type (val)),
|
||||||
gdbarch_byte_order (arch), 0xe9);
|
gdbarch_byte_order (arch), 0xe9);
|
||||||
|
|
||||||
|
|
|
@ -821,7 +821,7 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
len = TYPE_LENGTH (value_type (args[argnum]));
|
len = TYPE_LENGTH (value_type (args[argnum]));
|
||||||
val = value_contents (args[argnum]);
|
val = value_contents (args[argnum]).data ();
|
||||||
|
|
||||||
/* How may registers worth of storage do we need for this argument? */
|
/* How may registers worth of storage do we need for this argument? */
|
||||||
reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
|
reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0);
|
||||||
|
|
|
@ -362,7 +362,7 @@ csky_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
|
|
||||||
arg_type = check_typedef (value_type (args[argnum]));
|
arg_type = check_typedef (value_type (args[argnum]));
|
||||||
len = TYPE_LENGTH (arg_type);
|
len = TYPE_LENGTH (arg_type);
|
||||||
val = value_contents (args[argnum]);
|
val = value_contents (args[argnum]).data ();
|
||||||
|
|
||||||
/* Copy the argument to argument registers or the dummy stack.
|
/* Copy the argument to argument registers or the dummy stack.
|
||||||
Large arguments are split between registers and stack.
|
Large arguments are split between registers and stack.
|
||||||
|
|
|
@ -48,7 +48,7 @@ dynamic_array_type (struct type *type,
|
||||||
struct type *ptr_type;
|
struct type *ptr_type;
|
||||||
struct value *ival;
|
struct value *ival;
|
||||||
int length;
|
int length;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
length = unpack_field_as_long (type, valaddr + embedded_offset, 0);
|
length = unpack_field_as_long (type, valaddr + embedded_offset, 0);
|
||||||
|
|
||||||
|
|
|
@ -353,8 +353,8 @@ dummy_frame_prev_register (struct frame_info *this_frame,
|
||||||
/* Use the regcache_cooked_read() method so that it, on the fly,
|
/* Use the regcache_cooked_read() method so that it, on the fly,
|
||||||
constructs either a raw or pseudo register from the raw
|
constructs either a raw or pseudo register from the raw
|
||||||
register cache. */
|
register cache. */
|
||||||
cache->prev_regcache->cooked_read (regnum,
|
cache->prev_regcache->cooked_read
|
||||||
value_contents_writeable (reg_val));
|
(regnum, value_contents_writeable (reg_val).data ());
|
||||||
return reg_val;
|
return reg_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,7 +169,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
|
||||||
gdb_assert (!check_optimized || from == nullptr);
|
gdb_assert (!check_optimized || from == nullptr);
|
||||||
if (from != nullptr)
|
if (from != nullptr)
|
||||||
{
|
{
|
||||||
from_contents = value_contents (from);
|
from_contents = value_contents (from).data ();
|
||||||
v_contents = nullptr;
|
v_contents = nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -181,7 +181,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
|
||||||
if (check_optimized)
|
if (check_optimized)
|
||||||
v_contents = nullptr;
|
v_contents = nullptr;
|
||||||
else
|
else
|
||||||
v_contents = value_contents_raw (v);
|
v_contents = value_contents_raw (v).data ();
|
||||||
from_contents = nullptr;
|
from_contents = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,7 +394,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized)
|
||||||
bits_to_skip += p->offset;
|
bits_to_skip += p->offset;
|
||||||
|
|
||||||
copy_bitwise (v_contents, offset,
|
copy_bitwise (v_contents, offset,
|
||||||
value_contents_all (p->v.value),
|
value_contents_all (p->v.value).data (),
|
||||||
bits_to_skip,
|
bits_to_skip,
|
||||||
this_size_bits, bits_big_endian);
|
this_size_bits, bits_big_endian);
|
||||||
}
|
}
|
||||||
|
@ -577,7 +577,7 @@ indirect_pieced_value (value *value)
|
||||||
encode address spaces and other things in CORE_ADDR. */
|
encode address spaces and other things in CORE_ADDR. */
|
||||||
bfd_endian byte_order = gdbarch_byte_order (get_frame_arch (frame));
|
bfd_endian byte_order = gdbarch_byte_order (get_frame_arch (frame));
|
||||||
LONGEST byte_offset
|
LONGEST byte_offset
|
||||||
= extract_signed_integer (value_contents (value),
|
= extract_signed_integer (value_contents (value).data (),
|
||||||
TYPE_LENGTH (type), byte_order);
|
TYPE_LENGTH (type), byte_order);
|
||||||
byte_offset += piece->v.ptr.offset;
|
byte_offset += piece->v.ptr.offset;
|
||||||
|
|
||||||
|
@ -1037,8 +1037,8 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
|
||||||
if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG)
|
if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG)
|
||||||
subobj_offset += n - max;
|
subobj_offset += n - max;
|
||||||
|
|
||||||
memcpy (value_contents_raw (retval),
|
memcpy (value_contents_raw (retval).data (),
|
||||||
value_contents_all (val) + subobj_offset, len);
|
value_contents_all (val).data () + subobj_offset, len);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1050,7 +1050,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type,
|
||||||
invalid_synthetic_pointer ();
|
invalid_synthetic_pointer ();
|
||||||
|
|
||||||
retval = allocate_value (subobj_type);
|
retval = allocate_value (subobj_type);
|
||||||
bfd_byte *contents = value_contents_raw (retval);
|
bfd_byte *contents = value_contents_raw (retval).data ();
|
||||||
memcpy (contents, this->m_data + subobj_offset, n);
|
memcpy (contents, this->m_data + subobj_offset, n);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1157,7 +1157,7 @@ dwarf_expr_context::fetch_address (int n)
|
||||||
ULONGEST result;
|
ULONGEST result;
|
||||||
|
|
||||||
dwarf_require_integral (value_type (result_val));
|
dwarf_require_integral (value_type (result_val));
|
||||||
result = extract_unsigned_integer (value_contents (result_val),
|
result = extract_unsigned_integer (value_contents (result_val).data (),
|
||||||
TYPE_LENGTH (value_type (result_val)),
|
TYPE_LENGTH (value_type (result_val)),
|
||||||
byte_order);
|
byte_order);
|
||||||
|
|
||||||
|
@ -2366,7 +2366,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr,
|
||||||
else
|
else
|
||||||
result_val
|
result_val
|
||||||
= value_from_contents (type,
|
= value_from_contents (type,
|
||||||
value_contents_all (result_val));
|
value_contents_all (result_val).data ());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1338,7 +1338,8 @@ value_of_dwarf_reg_entry (struct type *type, struct frame_info *frame,
|
||||||
release_value (target_val).release ());
|
release_value (target_val).release ());
|
||||||
|
|
||||||
/* Copy the referencing pointer to the new computed value. */
|
/* Copy the referencing pointer to the new computed value. */
|
||||||
memcpy (value_contents_raw (val), value_contents_raw (outer_val),
|
memcpy (value_contents_raw (val).data (),
|
||||||
|
value_contents_raw (outer_val).data (),
|
||||||
TYPE_LENGTH (checked_type));
|
TYPE_LENGTH (checked_type));
|
||||||
set_value_lazy (val, 0);
|
set_value_lazy (val, 0);
|
||||||
|
|
||||||
|
|
|
@ -10045,7 +10045,7 @@ dwarf2_compute_name (const char *name,
|
||||||
else if (bytes != NULL)
|
else if (bytes != NULL)
|
||||||
{
|
{
|
||||||
v = allocate_value (type);
|
v = allocate_value (type);
|
||||||
memcpy (value_contents_writeable (v), bytes,
|
memcpy (value_contents_writeable (v).data (), bytes,
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1020,7 +1020,7 @@ elf_gnu_ifunc_resolver_return_stop (struct breakpoint *b)
|
||||||
|
|
||||||
value = allocate_value (value_type);
|
value = allocate_value (value_type);
|
||||||
gdbarch_return_value (gdbarch, func_func, value_type, regcache,
|
gdbarch_return_value (gdbarch, func_func, value_type, regcache,
|
||||||
value_contents_raw (value), NULL);
|
value_contents_raw (value).data (), NULL);
|
||||||
resolved_address = value_as_address (value);
|
resolved_address = value_as_address (value);
|
||||||
resolved_pc = gdbarch_convert_from_func_ptr_addr
|
resolved_pc = gdbarch_convert_from_func_ptr_addr
|
||||||
(gdbarch, resolved_address, current_inferior ()->top_target ());
|
(gdbarch, resolved_address, current_inferior ()->top_target ());
|
||||||
|
|
14
gdb/eval.c
14
gdb/eval.c
|
@ -2322,12 +2322,12 @@ array_operation::evaluate_struct_tuple (struct value *struct_val,
|
||||||
|
|
||||||
bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
|
bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
|
||||||
bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno);
|
bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno);
|
||||||
addr = value_contents_writeable (struct_val) + bitpos / 8;
|
addr = value_contents_writeable (struct_val).data () + bitpos / 8;
|
||||||
if (bitsize)
|
if (bitsize)
|
||||||
modify_field (struct_type, addr,
|
modify_field (struct_type, addr,
|
||||||
value_as_long (val), bitpos % 8, bitsize);
|
value_as_long (val), bitpos % 8, bitsize);
|
||||||
else
|
else
|
||||||
memcpy (addr, value_contents (val),
|
memcpy (addr, value_contents (val).data (),
|
||||||
TYPE_LENGTH (value_type (val)));
|
TYPE_LENGTH (value_type (val)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2351,7 +2351,7 @@ array_operation::evaluate (struct type *expect_type,
|
||||||
{
|
{
|
||||||
struct value *rec = allocate_value (expect_type);
|
struct value *rec = allocate_value (expect_type);
|
||||||
|
|
||||||
memset (value_contents_raw (rec), '\0', TYPE_LENGTH (type));
|
memset (value_contents_raw (rec).data (), '\0', TYPE_LENGTH (type));
|
||||||
return evaluate_struct_tuple (rec, exp, noside, nargs);
|
return evaluate_struct_tuple (rec, exp, noside, nargs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2370,7 +2370,7 @@ array_operation::evaluate (struct type *expect_type,
|
||||||
high_bound = (TYPE_LENGTH (type) / element_size) - 1;
|
high_bound = (TYPE_LENGTH (type) / element_size) - 1;
|
||||||
}
|
}
|
||||||
index = low_bound;
|
index = low_bound;
|
||||||
memset (value_contents_raw (array), 0, TYPE_LENGTH (expect_type));
|
memset (value_contents_raw (array).data (), 0, TYPE_LENGTH (expect_type));
|
||||||
for (tem = nargs; --nargs >= 0;)
|
for (tem = nargs; --nargs >= 0;)
|
||||||
{
|
{
|
||||||
struct value *element;
|
struct value *element;
|
||||||
|
@ -2382,9 +2382,9 @@ array_operation::evaluate (struct type *expect_type,
|
||||||
if (index > high_bound)
|
if (index > high_bound)
|
||||||
/* To avoid memory corruption. */
|
/* To avoid memory corruption. */
|
||||||
error (_("Too many array elements"));
|
error (_("Too many array elements"));
|
||||||
memcpy (value_contents_raw (array)
|
memcpy (value_contents_raw (array).data ()
|
||||||
+ (index - low_bound) * element_size,
|
+ (index - low_bound) * element_size,
|
||||||
value_contents (element),
|
value_contents (element).data (),
|
||||||
element_size);
|
element_size);
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
@ -2395,7 +2395,7 @@ array_operation::evaluate (struct type *expect_type,
|
||||||
&& type->code () == TYPE_CODE_SET)
|
&& type->code () == TYPE_CODE_SET)
|
||||||
{
|
{
|
||||||
struct value *set = allocate_value (expect_type);
|
struct value *set = allocate_value (expect_type);
|
||||||
gdb_byte *valaddr = value_contents_raw (set);
|
gdb_byte *valaddr = value_contents_raw (set).data ();
|
||||||
struct type *element_type = type->index_type ();
|
struct type *element_type = type->index_type ();
|
||||||
struct type *check_type = element_type;
|
struct type *check_type = element_type;
|
||||||
LONGEST low_bound, high_bound;
|
LONGEST low_bound, high_bound;
|
||||||
|
|
31
gdb/f-lang.c
31
gdb/f-lang.c
|
@ -770,7 +770,7 @@ eval_op_f_abs (struct type *expect_type, struct expression *exp,
|
||||||
case TYPE_CODE_FLT:
|
case TYPE_CODE_FLT:
|
||||||
{
|
{
|
||||||
double d
|
double d
|
||||||
= fabs (target_float_to_host_double (value_contents (arg1),
|
= fabs (target_float_to_host_double (value_contents (arg1).data (),
|
||||||
value_type (arg1)));
|
value_type (arg1)));
|
||||||
return value_from_host_double (type, d);
|
return value_from_host_double (type, d);
|
||||||
}
|
}
|
||||||
|
@ -800,10 +800,10 @@ eval_op_f_mod (struct type *expect_type, struct expression *exp,
|
||||||
case TYPE_CODE_FLT:
|
case TYPE_CODE_FLT:
|
||||||
{
|
{
|
||||||
double d1
|
double d1
|
||||||
= target_float_to_host_double (value_contents (arg1),
|
= target_float_to_host_double (value_contents (arg1).data (),
|
||||||
value_type (arg1));
|
value_type (arg1));
|
||||||
double d2
|
double d2
|
||||||
= target_float_to_host_double (value_contents (arg2),
|
= target_float_to_host_double (value_contents (arg2).data (),
|
||||||
value_type (arg2));
|
value_type (arg2));
|
||||||
double d3 = fmod (d1, d2);
|
double d3 = fmod (d1, d2);
|
||||||
return value_from_host_double (type, d3);
|
return value_from_host_double (type, d3);
|
||||||
|
@ -833,7 +833,7 @@ eval_op_f_ceil (struct type *expect_type, struct expression *exp,
|
||||||
if (type->code () != TYPE_CODE_FLT)
|
if (type->code () != TYPE_CODE_FLT)
|
||||||
error (_("argument to CEILING must be of type float"));
|
error (_("argument to CEILING must be of type float"));
|
||||||
double val
|
double val
|
||||||
= target_float_to_host_double (value_contents (arg1),
|
= target_float_to_host_double (value_contents (arg1).data (),
|
||||||
value_type (arg1));
|
value_type (arg1));
|
||||||
val = ceil (val);
|
val = ceil (val);
|
||||||
return value_from_host_double (type, val);
|
return value_from_host_double (type, val);
|
||||||
|
@ -851,7 +851,7 @@ eval_op_f_floor (struct type *expect_type, struct expression *exp,
|
||||||
if (type->code () != TYPE_CODE_FLT)
|
if (type->code () != TYPE_CODE_FLT)
|
||||||
error (_("argument to FLOOR must be of type float"));
|
error (_("argument to FLOOR must be of type float"));
|
||||||
double val
|
double val
|
||||||
= target_float_to_host_double (value_contents (arg1),
|
= target_float_to_host_double (value_contents (arg1).data (),
|
||||||
value_type (arg1));
|
value_type (arg1));
|
||||||
val = floor (val);
|
val = floor (val);
|
||||||
return value_from_host_double (type, val);
|
return value_from_host_double (type, val);
|
||||||
|
@ -883,10 +883,10 @@ eval_op_f_modulo (struct type *expect_type, struct expression *exp,
|
||||||
case TYPE_CODE_FLT:
|
case TYPE_CODE_FLT:
|
||||||
{
|
{
|
||||||
double a
|
double a
|
||||||
= target_float_to_host_double (value_contents (arg1),
|
= target_float_to_host_double (value_contents (arg1).data (),
|
||||||
value_type (arg1));
|
value_type (arg1));
|
||||||
double p
|
double p
|
||||||
= target_float_to_host_double (value_contents (arg2),
|
= target_float_to_host_double (value_contents (arg2).data (),
|
||||||
value_type (arg2));
|
value_type (arg2));
|
||||||
double result = fmod (a, p);
|
double result = fmod (a, p);
|
||||||
if (result != 0 && (a < 0.0) != (p < 0.0))
|
if (result != 0 && (a < 0.0) != (p < 0.0))
|
||||||
|
@ -1384,11 +1384,9 @@ fortran_undetermined::value_subarray (value *array,
|
||||||
array = value_at_lazy (array_slice_type,
|
array = value_at_lazy (array_slice_type,
|
||||||
value_address (array) + total_offset);
|
value_address (array) + total_offset);
|
||||||
else
|
else
|
||||||
array = value_from_contents_and_address (array_slice_type,
|
array = value_from_contents_and_address
|
||||||
(value_contents (array)
|
(array_slice_type, value_contents (array).data () + total_offset,
|
||||||
+ total_offset),
|
value_address (array) + total_offset);
|
||||||
(value_address (array)
|
|
||||||
+ total_offset));
|
|
||||||
}
|
}
|
||||||
else if (!value_lazy (array))
|
else if (!value_lazy (array))
|
||||||
array = value_from_component (array, array_slice_type, total_offset);
|
array = value_from_component (array, array_slice_type, total_offset);
|
||||||
|
@ -1518,7 +1516,7 @@ fortran_structop_operation::evaluate (struct type *expect_type,
|
||||||
struct type *elt_type = value_type (elt);
|
struct type *elt_type = value_type (elt);
|
||||||
if (is_dynamic_type (elt_type))
|
if (is_dynamic_type (elt_type))
|
||||||
{
|
{
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (elt);
|
const gdb_byte *valaddr = value_contents_for_printing (elt).data ();
|
||||||
CORE_ADDR address = value_address (elt);
|
CORE_ADDR address = value_address (elt);
|
||||||
gdb::array_view<const gdb_byte> view
|
gdb::array_view<const gdb_byte> view
|
||||||
= gdb::make_array_view (valaddr, TYPE_LENGTH (elt_type));
|
= gdb::make_array_view (valaddr, TYPE_LENGTH (elt_type));
|
||||||
|
@ -1746,10 +1744,9 @@ fortran_argument_convert (struct value *value, bool is_artificial)
|
||||||
const int length = TYPE_LENGTH (type);
|
const int length = TYPE_LENGTH (type);
|
||||||
const CORE_ADDR addr
|
const CORE_ADDR addr
|
||||||
= value_as_long (value_allocate_space_in_inferior (length));
|
= value_as_long (value_allocate_space_in_inferior (length));
|
||||||
write_memory (addr, value_contents (value), length);
|
write_memory (addr, value_contents (value).data (), length);
|
||||||
struct value *val
|
struct value *val = value_from_contents_and_address
|
||||||
= value_from_contents_and_address (type, value_contents (value),
|
(type, value_contents (value).data (), addr);
|
||||||
addr);
|
|
||||||
return value_addr (val);
|
return value_addr (val);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -223,7 +223,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream,
|
||||||
struct type *elttype;
|
struct type *elttype;
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
int index;
|
int index;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
const CORE_ADDR address = value_address (val);
|
const CORE_ADDR address = value_address (val);
|
||||||
|
|
||||||
switch (type->code ())
|
switch (type->code ())
|
||||||
|
|
|
@ -185,7 +185,7 @@ parse_find_args (const char *args, ULONGEST *max_countp,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const gdb_byte *contents = value_contents (v);
|
const gdb_byte *contents = value_contents (v).data ();
|
||||||
pattern_buf.insert (pattern_buf.end (), contents,
|
pattern_buf.insert (pattern_buf.end (), contents,
|
||||||
contents + TYPE_LENGTH (t));
|
contents + TYPE_LENGTH (t));
|
||||||
}
|
}
|
||||||
|
|
|
@ -627,7 +627,7 @@ language_defn::read_var_value (struct symbol *var,
|
||||||
}
|
}
|
||||||
/* Put the constant back in target format. */
|
/* Put the constant back in target format. */
|
||||||
v = allocate_value (type);
|
v = allocate_value (type);
|
||||||
store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type),
|
store_signed_integer (value_contents_raw (v).data (), TYPE_LENGTH (type),
|
||||||
type_byte_order (type),
|
type_byte_order (type),
|
||||||
(LONGEST) SYMBOL_VALUE (var));
|
(LONGEST) SYMBOL_VALUE (var));
|
||||||
VALUE_LVAL (v) = not_lval;
|
VALUE_LVAL (v) = not_lval;
|
||||||
|
@ -641,10 +641,10 @@ language_defn::read_var_value (struct symbol *var,
|
||||||
struct objfile *var_objfile = symbol_objfile (var);
|
struct objfile *var_objfile = symbol_objfile (var);
|
||||||
addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
|
addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
|
||||||
var->obj_section (var_objfile));
|
var->obj_section (var_objfile));
|
||||||
store_typed_address (value_contents_raw (v), type, addr);
|
store_typed_address (value_contents_raw (v).data (), type, addr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
store_typed_address (value_contents_raw (v), type,
|
store_typed_address (value_contents_raw (v).data (), type,
|
||||||
SYMBOL_VALUE_ADDRESS (var));
|
SYMBOL_VALUE_ADDRESS (var));
|
||||||
VALUE_LVAL (v) = not_lval;
|
VALUE_LVAL (v) = not_lval;
|
||||||
return v;
|
return v;
|
||||||
|
@ -656,7 +656,7 @@ language_defn::read_var_value (struct symbol *var,
|
||||||
type = resolve_dynamic_type (type, {}, /* Unused address. */ 0);
|
type = resolve_dynamic_type (type, {}, /* Unused address. */ 0);
|
||||||
}
|
}
|
||||||
v = allocate_value (type);
|
v = allocate_value (type);
|
||||||
memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var),
|
memcpy (value_contents_raw (v).data (), SYMBOL_VALUE_BYTES (var),
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
VALUE_LVAL (v) = not_lval;
|
VALUE_LVAL (v) = not_lval;
|
||||||
return v;
|
return v;
|
||||||
|
@ -926,7 +926,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
|
||||||
VALUE_NEXT_FRAME_ID (v) = get_frame_id (get_next_frame_sentinel_okay (frame));
|
VALUE_NEXT_FRAME_ID (v) = get_frame_id (get_next_frame_sentinel_okay (frame));
|
||||||
VALUE_REGNUM (v) = regnum;
|
VALUE_REGNUM (v) = regnum;
|
||||||
ok = gdbarch_register_to_value (gdbarch, frame, regnum, type1,
|
ok = gdbarch_register_to_value (gdbarch, frame, regnum, type1,
|
||||||
value_contents_raw (v), &optim,
|
value_contents_raw (v).data (), &optim,
|
||||||
&unavail);
|
&unavail);
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
|
|
|
@ -300,7 +300,7 @@ frame_unwind_got_constant (struct frame_info *frame, int regnum,
|
||||||
struct value *reg_val;
|
struct value *reg_val;
|
||||||
|
|
||||||
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
|
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
|
||||||
store_unsigned_integer (value_contents_writeable (reg_val),
|
store_unsigned_integer (value_contents_writeable (reg_val).data (),
|
||||||
register_size (gdbarch, regnum), byte_order, val);
|
register_size (gdbarch, regnum), byte_order, val);
|
||||||
return reg_val;
|
return reg_val;
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,8 @@ frame_unwind_got_bytes (struct frame_info *frame, int regnum, const gdb_byte *bu
|
||||||
struct value *reg_val;
|
struct value *reg_val;
|
||||||
|
|
||||||
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
|
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
|
||||||
memcpy (value_contents_raw (reg_val), buf, register_size (gdbarch, regnum));
|
memcpy (value_contents_raw (reg_val).data (), buf,
|
||||||
|
register_size (gdbarch, regnum));
|
||||||
return reg_val;
|
return reg_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -328,7 +329,7 @@ frame_unwind_got_address (struct frame_info *frame, int regnum,
|
||||||
struct value *reg_val;
|
struct value *reg_val;
|
||||||
|
|
||||||
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
|
reg_val = value_zero (register_type (gdbarch, regnum), not_lval);
|
||||||
pack_long (value_contents_writeable (reg_val),
|
pack_long (value_contents_writeable (reg_val).data (),
|
||||||
register_type (gdbarch, regnum), addr);
|
register_type (gdbarch, regnum), addr);
|
||||||
return reg_val;
|
return reg_val;
|
||||||
}
|
}
|
||||||
|
|
23
gdb/frame.c
23
gdb/frame.c
|
@ -1156,7 +1156,7 @@ frame_register_unwind (frame_info *next_frame, int regnum,
|
||||||
if (bufferp)
|
if (bufferp)
|
||||||
{
|
{
|
||||||
if (!*optimizedp && !*unavailablep)
|
if (!*optimizedp && !*unavailablep)
|
||||||
memcpy (bufferp, value_contents_all (value),
|
memcpy (bufferp, value_contents_all (value).data (),
|
||||||
TYPE_LENGTH (value_type (value)));
|
TYPE_LENGTH (value_type (value)));
|
||||||
else
|
else
|
||||||
memset (bufferp, 0, TYPE_LENGTH (value_type (value)));
|
memset (bufferp, 0, TYPE_LENGTH (value_type (value)));
|
||||||
|
@ -1261,7 +1261,7 @@ frame_unwind_register_value (frame_info *next_frame, int regnum)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const gdb_byte *buf = value_contents (value);
|
const gdb_byte *buf = value_contents (value).data ();
|
||||||
|
|
||||||
fprintf_unfiltered (&debug_file, " bytes=");
|
fprintf_unfiltered (&debug_file, " bytes=");
|
||||||
fprintf_unfiltered (&debug_file, "[");
|
fprintf_unfiltered (&debug_file, "[");
|
||||||
|
@ -1304,7 +1304,7 @@ frame_unwind_register_signed (frame_info *next_frame, int regnum)
|
||||||
_("Register %d is not available"), regnum);
|
_("Register %d is not available"), regnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
LONGEST r = extract_signed_integer (value_contents_all (value), size,
|
LONGEST r = extract_signed_integer (value_contents_all (value).data (), size,
|
||||||
byte_order);
|
byte_order);
|
||||||
|
|
||||||
release_value (value);
|
release_value (value);
|
||||||
|
@ -1338,8 +1338,8 @@ frame_unwind_register_unsigned (frame_info *next_frame, int regnum)
|
||||||
_("Register %d is not available"), regnum);
|
_("Register %d is not available"), regnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONGEST r = extract_unsigned_integer (value_contents_all (value), size,
|
ULONGEST r = extract_unsigned_integer (value_contents_all (value).data (),
|
||||||
byte_order);
|
size, byte_order);
|
||||||
|
|
||||||
release_value (value);
|
release_value (value);
|
||||||
return r;
|
return r;
|
||||||
|
@ -1364,7 +1364,8 @@ read_frame_register_unsigned (frame_info *frame, int regnum,
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
int size = register_size (gdbarch, VALUE_REGNUM (regval));
|
int size = register_size (gdbarch, VALUE_REGNUM (regval));
|
||||||
|
|
||||||
*val = extract_unsigned_integer (value_contents (regval), size, byte_order);
|
*val = extract_unsigned_integer (value_contents (regval).data (), size,
|
||||||
|
byte_order);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1496,7 +1497,8 @@ get_frame_register_bytes (frame_info *frame, int regnum,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy (myaddr, value_contents_all (value) + offset, curr_len);
|
memcpy (myaddr, value_contents_all (value).data () + offset,
|
||||||
|
curr_len);
|
||||||
release_value (value);
|
release_value (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1546,9 +1548,10 @@ put_frame_register_bytes (struct frame_info *frame, int regnum,
|
||||||
regnum);
|
regnum);
|
||||||
gdb_assert (value != NULL);
|
gdb_assert (value != NULL);
|
||||||
|
|
||||||
memcpy ((char *) value_contents_writeable (value) + offset, myaddr,
|
memcpy ((char *) value_contents_writeable (value).data () + offset,
|
||||||
curr_len);
|
myaddr, curr_len);
|
||||||
put_frame_register (frame, regnum, value_contents_raw (value));
|
put_frame_register (frame, regnum,
|
||||||
|
value_contents_raw (value).data ());
|
||||||
release_value (value);
|
release_value (value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1259,7 +1259,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
/* The FDPIC ABI requires function descriptors to be passed instead
|
/* The FDPIC ABI requires function descriptors to be passed instead
|
||||||
of entry points. */
|
of entry points. */
|
||||||
CORE_ADDR addr = extract_unsigned_integer
|
CORE_ADDR addr = extract_unsigned_integer
|
||||||
(value_contents (arg), 4, byte_order);
|
(value_contents (arg).data (), 4, byte_order);
|
||||||
addr = find_func_descr (gdbarch, addr);
|
addr = find_func_descr (gdbarch, addr);
|
||||||
store_unsigned_integer (valbuf, 4, byte_order, addr);
|
store_unsigned_integer (valbuf, 4, byte_order, addr);
|
||||||
typecode = TYPE_CODE_PTR;
|
typecode = TYPE_CODE_PTR;
|
||||||
|
@ -1268,7 +1268,7 @@ frv_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
|
|
|
@ -3878,7 +3878,7 @@ is_unique_ancestor (struct type *base, struct value *val)
|
||||||
int offset = -1;
|
int offset = -1;
|
||||||
|
|
||||||
return is_unique_ancestor_worker (base, value_type (val), &offset,
|
return is_unique_ancestor_worker (base, value_type (val), &offset,
|
||||||
value_contents_for_printing (val),
|
value_contents_for_printing (val).data (),
|
||||||
value_embedded_offset (val),
|
value_embedded_offset (val),
|
||||||
value_address (val), val) == 1;
|
value_address (val), val) == 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -729,7 +729,7 @@ static struct value *
|
||||||
gnuv3_method_ptr_to_value (struct value **this_p, struct value *method_ptr)
|
gnuv3_method_ptr_to_value (struct value **this_p, struct value *method_ptr)
|
||||||
{
|
{
|
||||||
struct gdbarch *gdbarch;
|
struct gdbarch *gdbarch;
|
||||||
const gdb_byte *contents = value_contents (method_ptr);
|
const gdb_byte *contents = value_contents (method_ptr).data ();
|
||||||
CORE_ADDR ptr_value;
|
CORE_ADDR ptr_value;
|
||||||
struct type *self_type, *final_type, *method_type;
|
struct type *self_type, *final_type, *method_type;
|
||||||
LONGEST adjustment;
|
LONGEST adjustment;
|
||||||
|
|
|
@ -52,7 +52,7 @@ print_go_string (struct type *type,
|
||||||
unpack_value_field_as_pointer. Do this until we can get
|
unpack_value_field_as_pointer. Do this until we can get
|
||||||
unpack_value_field_as_pointer. */
|
unpack_value_field_as_pointer. */
|
||||||
LONGEST addr;
|
LONGEST addr;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
|
|
||||||
if (! unpack_value_field_as_long (type, valaddr, embedded_offset, 0,
|
if (! unpack_value_field_as_long (type, valaddr, embedded_offset, 0,
|
||||||
|
|
|
@ -828,7 +828,7 @@ gdbscm_value_to_bytevector (SCM self)
|
||||||
{
|
{
|
||||||
type = check_typedef (type);
|
type = check_typedef (type);
|
||||||
length = TYPE_LENGTH (type);
|
length = TYPE_LENGTH (type);
|
||||||
contents = value_contents (value);
|
contents = value_contents (value).data ();
|
||||||
}
|
}
|
||||||
catch (const gdb_exception &except)
|
catch (const gdb_exception &except)
|
||||||
{
|
{
|
||||||
|
@ -978,7 +978,8 @@ gdbscm_value_to_real (SCM self)
|
||||||
{
|
{
|
||||||
if (is_floating_value (value))
|
if (is_floating_value (value))
|
||||||
{
|
{
|
||||||
d = target_float_to_host_double (value_contents (value), type);
|
d = target_float_to_host_double (value_contents (value).data (),
|
||||||
|
type);
|
||||||
check = value_from_host_double (type, d);
|
check = value_from_host_double (type, d);
|
||||||
}
|
}
|
||||||
else if (type->is_unsigned ())
|
else if (type->is_unsigned ())
|
||||||
|
|
|
@ -648,7 +648,7 @@ h8300_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
{
|
{
|
||||||
struct type *type = value_type (args[argument]);
|
struct type *type = value_type (args[argument]);
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
char *contents = (char *) value_contents (args[argument]);
|
char *contents = (char *) value_contents (args[argument]).data ();
|
||||||
|
|
||||||
/* Pad the argument appropriately. */
|
/* Pad the argument appropriately. */
|
||||||
int padded_len = align_up (len, wordsize);
|
int padded_len = align_up (len, wordsize);
|
||||||
|
|
|
@ -758,8 +758,8 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
param_len = 4;
|
param_len = 4;
|
||||||
struct_ptr += align_up (TYPE_LENGTH (type), 8);
|
struct_ptr += align_up (TYPE_LENGTH (type), 8);
|
||||||
if (write_pass)
|
if (write_pass)
|
||||||
write_memory (struct_end - struct_ptr, value_contents (arg),
|
write_memory (struct_end - struct_ptr,
|
||||||
TYPE_LENGTH (type));
|
value_contents (arg).data (), TYPE_LENGTH (type));
|
||||||
store_unsigned_integer (param_val, 4, byte_order,
|
store_unsigned_integer (param_val, 4, byte_order,
|
||||||
struct_end - struct_ptr);
|
struct_end - struct_ptr);
|
||||||
}
|
}
|
||||||
|
@ -769,15 +769,15 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
/* Integer value store, right aligned. "unpack_long"
|
/* Integer value store, right aligned. "unpack_long"
|
||||||
takes care of any sign-extension problems. */
|
takes care of any sign-extension problems. */
|
||||||
param_len = align_up (TYPE_LENGTH (type), 4);
|
param_len = align_up (TYPE_LENGTH (type), 4);
|
||||||
store_unsigned_integer (param_val, param_len, byte_order,
|
store_unsigned_integer
|
||||||
unpack_long (type,
|
(param_val, param_len, byte_order,
|
||||||
value_contents (arg)));
|
unpack_long (type, value_contents (arg).data ()));
|
||||||
}
|
}
|
||||||
else if (type->code () == TYPE_CODE_FLT)
|
else if (type->code () == TYPE_CODE_FLT)
|
||||||
{
|
{
|
||||||
/* Floating point value store, right aligned. */
|
/* Floating point value store, right aligned. */
|
||||||
param_len = align_up (TYPE_LENGTH (type), 4);
|
param_len = align_up (TYPE_LENGTH (type), 4);
|
||||||
memcpy (param_val, value_contents (arg), param_len);
|
memcpy (param_val, value_contents (arg).data (), param_len);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -785,7 +785,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
|
|
||||||
/* Small struct value are stored right-aligned. */
|
/* Small struct value are stored right-aligned. */
|
||||||
memcpy (param_val + param_len - TYPE_LENGTH (type),
|
memcpy (param_val + param_len - TYPE_LENGTH (type),
|
||||||
value_contents (arg), TYPE_LENGTH (type));
|
value_contents (arg).data (), TYPE_LENGTH (type));
|
||||||
|
|
||||||
/* Structures of size 5, 6 and 7 bytes are special in that
|
/* Structures of size 5, 6 and 7 bytes are special in that
|
||||||
the higher-ordered word is stored in the lower-ordered
|
the higher-ordered word is stored in the lower-ordered
|
||||||
|
@ -1041,7 +1041,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
the right halves of the floating point registers;
|
the right halves of the floating point registers;
|
||||||
the left halves are unused." */
|
the left halves are unused." */
|
||||||
regcache->cooked_write_part (regnum, offset % 8, len,
|
regcache->cooked_write_part (regnum, offset % 8, len,
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1065,7 +1065,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
{
|
{
|
||||||
ULONGEST codeptr, fptr;
|
ULONGEST codeptr, fptr;
|
||||||
|
|
||||||
codeptr = unpack_long (type, value_contents (arg));
|
codeptr = unpack_long (type, value_contents (arg).data ());
|
||||||
fptr = hppa64_convert_code_addr_to_fptr (gdbarch, codeptr);
|
fptr = hppa64_convert_code_addr_to_fptr (gdbarch, codeptr);
|
||||||
store_unsigned_integer (fptrbuf, TYPE_LENGTH (type), byte_order,
|
store_unsigned_integer (fptrbuf, TYPE_LENGTH (type), byte_order,
|
||||||
fptr);
|
fptr);
|
||||||
|
@ -1073,7 +1073,7 @@ hppa64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
valbuf = value_contents (arg);
|
valbuf = value_contents (arg).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Always store the argument in memory. */
|
/* Always store the argument in memory. */
|
||||||
|
@ -2769,7 +2769,7 @@ hppa_frame_prev_register_helper (struct frame_info *this_frame,
|
||||||
trad_frame_get_prev_register (this_frame, saved_regs,
|
trad_frame_get_prev_register (this_frame, saved_regs,
|
||||||
HPPA_PCOQ_HEAD_REGNUM);
|
HPPA_PCOQ_HEAD_REGNUM);
|
||||||
|
|
||||||
pc = extract_unsigned_integer (value_contents_all (pcoq_val),
|
pc = extract_unsigned_integer (value_contents_all (pcoq_val).data (),
|
||||||
size, byte_order);
|
size, byte_order);
|
||||||
return frame_unwind_got_constant (this_frame, regnum, pc + 4);
|
return frame_unwind_got_constant (this_frame, regnum, pc + 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,7 +189,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
{
|
{
|
||||||
if (write_pass)
|
if (write_pass)
|
||||||
{
|
{
|
||||||
const gdb_byte *val = value_contents_all (args[i]);
|
const gdb_byte *val = value_contents_all (args[i]).data ();
|
||||||
regcache->raw_write (I387_MM0_REGNUM(tdep) + num_m128, val);
|
regcache->raw_write (I387_MM0_REGNUM(tdep) + num_m128, val);
|
||||||
}
|
}
|
||||||
num_m128++;
|
num_m128++;
|
||||||
|
@ -200,7 +200,7 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
i386_darwin_arg_type_alignment (arg_type));
|
i386_darwin_arg_type_alignment (arg_type));
|
||||||
if (write_pass)
|
if (write_pass)
|
||||||
write_memory (sp + args_space,
|
write_memory (sp + args_space,
|
||||||
value_contents_all (args[i]),
|
value_contents_all (args[i]).data (),
|
||||||
TYPE_LENGTH (arg_type));
|
TYPE_LENGTH (arg_type));
|
||||||
|
|
||||||
/* The System V ABI says that:
|
/* The System V ABI says that:
|
||||||
|
|
|
@ -2729,7 +2729,7 @@ i386_thiscall_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
args_space_used = align_up (args_space_used, 16);
|
args_space_used = align_up (args_space_used, 16);
|
||||||
|
|
||||||
write_memory (sp + args_space_used,
|
write_memory (sp + args_space_used,
|
||||||
value_contents_all (args[i]), len);
|
value_contents_all (args[i]).data (), len);
|
||||||
/* The System V ABI says that:
|
/* The System V ABI says that:
|
||||||
|
|
||||||
"An argument's size is increased, if necessary, to make it a
|
"An argument's size is increased, if necessary, to make it a
|
||||||
|
@ -2773,7 +2773,8 @@ i386_thiscall_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
|
|
||||||
/* The 'this' pointer needs to be in ECX. */
|
/* The 'this' pointer needs to be in ECX. */
|
||||||
if (thiscall)
|
if (thiscall)
|
||||||
regcache->cooked_write (I386_ECX_REGNUM, value_contents_all (args[0]));
|
regcache->cooked_write (I386_ECX_REGNUM,
|
||||||
|
value_contents_all (args[0]).data ());
|
||||||
|
|
||||||
/* MarkK wrote: This "+ 8" is all over the place:
|
/* MarkK wrote: This "+ 8" is all over the place:
|
||||||
(i386_frame_this_id, i386_sigtramp_frame_this_id,
|
(i386_frame_this_id, i386_sigtramp_frame_this_id,
|
||||||
|
@ -3324,7 +3325,7 @@ i386_pseudo_register_read_into_value (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
gdb_byte raw_buf[I386_MAX_REGISTER_SIZE];
|
gdb_byte raw_buf[I386_MAX_REGISTER_SIZE];
|
||||||
enum register_status status;
|
enum register_status status;
|
||||||
gdb_byte *buf = value_contents_raw (result_value);
|
gdb_byte *buf = value_contents_raw (result_value).data ();
|
||||||
|
|
||||||
if (i386_mmx_regnum_p (gdbarch, regnum))
|
if (i386_mmx_regnum_p (gdbarch, regnum))
|
||||||
{
|
{
|
||||||
|
|
|
@ -284,7 +284,7 @@ i387_print_float_info (struct gdbarch *gdbarch, struct ui_file *file,
|
||||||
|
|
||||||
if (value_entirely_available (regval))
|
if (value_entirely_available (regval))
|
||||||
{
|
{
|
||||||
const gdb_byte *raw = value_contents (regval);
|
const gdb_byte *raw = value_contents (regval).data ();
|
||||||
|
|
||||||
fputs_filtered ("0x", file);
|
fputs_filtered ("0x", file);
|
||||||
for (i = 9; i >= 0; i--)
|
for (i = 9; i >= 0; i--)
|
||||||
|
|
|
@ -1935,7 +1935,7 @@ ia64_frame_prev_register (struct frame_info *this_frame, void **this_cache,
|
||||||
that frame by adding the size of output:
|
that frame by adding the size of output:
|
||||||
(sof (size of frame) - sol (size of locals)). */
|
(sof (size of frame) - sol (size of locals)). */
|
||||||
val = ia64_frame_prev_register (this_frame, this_cache, IA64_CFM_REGNUM);
|
val = ia64_frame_prev_register (this_frame, this_cache, IA64_CFM_REGNUM);
|
||||||
prev_cfm = extract_unsigned_integer (value_contents_all (val),
|
prev_cfm = extract_unsigned_integer (value_contents_all (val).data (),
|
||||||
8, byte_order);
|
8, byte_order);
|
||||||
bsp = rse_address_add (cache->bsp, -(cache->sof));
|
bsp = rse_address_add (cache->bsp, -(cache->sof));
|
||||||
prev_bsp =
|
prev_bsp =
|
||||||
|
@ -1985,7 +1985,7 @@ ia64_frame_prev_register (struct frame_info *this_frame, void **this_cache,
|
||||||
/* Adjust the register number to account for register rotation. */
|
/* Adjust the register number to account for register rotation. */
|
||||||
regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
|
regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
|
||||||
}
|
}
|
||||||
prN = extract_bit_field (value_contents_all (pr_val),
|
prN = extract_bit_field (value_contents_all (pr_val).data (),
|
||||||
regnum - VP0_REGNUM, 1);
|
regnum - VP0_REGNUM, 1);
|
||||||
return frame_unwind_got_constant (this_frame, regnum, prN);
|
return frame_unwind_got_constant (this_frame, regnum, prN);
|
||||||
}
|
}
|
||||||
|
@ -1996,7 +1996,7 @@ ia64_frame_prev_register (struct frame_info *this_frame, void **this_cache,
|
||||||
ULONGEST unatN;
|
ULONGEST unatN;
|
||||||
unat_val = ia64_frame_prev_register (this_frame, this_cache,
|
unat_val = ia64_frame_prev_register (this_frame, this_cache,
|
||||||
IA64_UNAT_REGNUM);
|
IA64_UNAT_REGNUM);
|
||||||
unatN = extract_bit_field (value_contents_all (unat_val),
|
unatN = extract_bit_field (value_contents_all (unat_val).data (),
|
||||||
regnum - IA64_NAT0_REGNUM, 1);
|
regnum - IA64_NAT0_REGNUM, 1);
|
||||||
return frame_unwind_got_constant (this_frame, regnum, unatN);
|
return frame_unwind_got_constant (this_frame, regnum, unatN);
|
||||||
}
|
}
|
||||||
|
@ -2118,12 +2118,12 @@ ia64_frame_prev_register (struct frame_info *this_frame, void **this_cache,
|
||||||
regnum = IA64_GR32_REGNUM + (regnum - V32_REGNUM);
|
regnum = IA64_GR32_REGNUM + (regnum - V32_REGNUM);
|
||||||
reg_val = ia64_frame_prev_register (this_frame, this_cache,
|
reg_val = ia64_frame_prev_register (this_frame, this_cache,
|
||||||
IA64_CFM_REGNUM);
|
IA64_CFM_REGNUM);
|
||||||
prev_cfm = extract_unsigned_integer (value_contents_all (reg_val),
|
prev_cfm = extract_unsigned_integer
|
||||||
8, byte_order);
|
(value_contents_all (reg_val).data (), 8, byte_order);
|
||||||
reg_val = ia64_frame_prev_register (this_frame, this_cache,
|
reg_val = ia64_frame_prev_register (this_frame, this_cache,
|
||||||
IA64_BSP_REGNUM);
|
IA64_BSP_REGNUM);
|
||||||
prev_bsp = extract_unsigned_integer (value_contents_all (reg_val),
|
prev_bsp = extract_unsigned_integer
|
||||||
8, byte_order);
|
(value_contents_all (reg_val).data (), 8, byte_order);
|
||||||
prev_bof = rse_address_add (prev_bsp, -(prev_cfm & 0x7f));
|
prev_bof = rse_address_add (prev_bsp, -(prev_cfm & 0x7f));
|
||||||
|
|
||||||
addr = rse_address_add (prev_bof, (regnum - IA64_GR32_REGNUM));
|
addr = rse_address_add (prev_bof, (regnum - IA64_GR32_REGNUM));
|
||||||
|
@ -2956,7 +2956,7 @@ ia64_libunwind_frame_prev_register (struct frame_info *this_frame,
|
||||||
/* Adjust the register number to account for register rotation. */
|
/* Adjust the register number to account for register rotation. */
|
||||||
regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
|
regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48;
|
||||||
}
|
}
|
||||||
prN_val = extract_bit_field (value_contents_all (val),
|
prN_val = extract_bit_field (value_contents_all (val).data (),
|
||||||
regnum - VP0_REGNUM, 1);
|
regnum - VP0_REGNUM, 1);
|
||||||
return frame_unwind_got_constant (this_frame, regnum, prN_val);
|
return frame_unwind_got_constant (this_frame, regnum, prN_val);
|
||||||
}
|
}
|
||||||
|
@ -2965,7 +2965,7 @@ ia64_libunwind_frame_prev_register (struct frame_info *this_frame,
|
||||||
{
|
{
|
||||||
ULONGEST unatN_val;
|
ULONGEST unatN_val;
|
||||||
|
|
||||||
unatN_val = extract_bit_field (value_contents_all (val),
|
unatN_val = extract_bit_field (value_contents_all (val).data (),
|
||||||
regnum - IA64_NAT0_REGNUM, 1);
|
regnum - IA64_NAT0_REGNUM, 1);
|
||||||
return frame_unwind_got_constant (this_frame, regnum, unatN_val);
|
return frame_unwind_got_constant (this_frame, regnum, unatN_val);
|
||||||
}
|
}
|
||||||
|
@ -2980,11 +2980,11 @@ ia64_libunwind_frame_prev_register (struct frame_info *this_frame,
|
||||||
register will be if we pop the frame back which is why we might
|
register will be if we pop the frame back which is why we might
|
||||||
have been called. We know that libunwind will pass us back the
|
have been called. We know that libunwind will pass us back the
|
||||||
beginning of the current frame so we should just add sof to it. */
|
beginning of the current frame so we should just add sof to it. */
|
||||||
prev_bsp = extract_unsigned_integer (value_contents_all (val),
|
prev_bsp = extract_unsigned_integer (value_contents_all (val).data (),
|
||||||
8, byte_order);
|
8, byte_order);
|
||||||
cfm_val = libunwind_frame_prev_register (this_frame, this_cache,
|
cfm_val = libunwind_frame_prev_register (this_frame, this_cache,
|
||||||
IA64_CFM_REGNUM);
|
IA64_CFM_REGNUM);
|
||||||
prev_cfm = extract_unsigned_integer (value_contents_all (cfm_val),
|
prev_cfm = extract_unsigned_integer (value_contents_all (cfm_val).data (),
|
||||||
8, byte_order);
|
8, byte_order);
|
||||||
prev_bsp = rse_address_add (prev_bsp, (prev_cfm & 0x7f));
|
prev_bsp = rse_address_add (prev_bsp, (prev_cfm & 0x7f));
|
||||||
|
|
||||||
|
@ -3067,7 +3067,7 @@ ia64_libunwind_sigtramp_frame_prev_register (struct frame_info *this_frame,
|
||||||
method of getting previous registers. */
|
method of getting previous registers. */
|
||||||
prev_ip_val = libunwind_frame_prev_register (this_frame, this_cache,
|
prev_ip_val = libunwind_frame_prev_register (this_frame, this_cache,
|
||||||
IA64_IP_REGNUM);
|
IA64_IP_REGNUM);
|
||||||
prev_ip = extract_unsigned_integer (value_contents_all (prev_ip_val),
|
prev_ip = extract_unsigned_integer (value_contents_all (prev_ip_val).data (),
|
||||||
8, byte_order);
|
8, byte_order);
|
||||||
|
|
||||||
if (prev_ip == 0)
|
if (prev_ip == 0)
|
||||||
|
@ -3747,8 +3747,8 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC)
|
&& TYPE_TARGET_TYPE (type)->code () == TYPE_CODE_FUNC)
|
||||||
{
|
{
|
||||||
gdb_byte val_buf[8];
|
gdb_byte val_buf[8];
|
||||||
ULONGEST faddr = extract_unsigned_integer (value_contents (arg),
|
ULONGEST faddr = extract_unsigned_integer
|
||||||
8, byte_order);
|
(value_contents (arg).data (), 8, byte_order);
|
||||||
store_unsigned_integer (val_buf, 8, byte_order,
|
store_unsigned_integer (val_buf, 8, byte_order,
|
||||||
find_func_descr (regcache, faddr,
|
find_func_descr (regcache, faddr,
|
||||||
&funcdescaddr));
|
&funcdescaddr));
|
||||||
|
@ -3780,7 +3780,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
This is why we use store_unsigned_integer. */
|
This is why we use store_unsigned_integer. */
|
||||||
store_unsigned_integer
|
store_unsigned_integer
|
||||||
(val_buf, 8, byte_order,
|
(val_buf, 8, byte_order,
|
||||||
extract_unsigned_integer (value_contents (arg), len,
|
extract_unsigned_integer (value_contents (arg).data (), len,
|
||||||
byte_order));
|
byte_order));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3794,7 +3794,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
In this case, the data is Byte0-aligned. Happy news,
|
In this case, the data is Byte0-aligned. Happy news,
|
||||||
this means that we don't need to differentiate the
|
this means that we don't need to differentiate the
|
||||||
handling of 8byte blocks and less-than-8bytes blocks. */
|
handling of 8byte blocks and less-than-8bytes blocks. */
|
||||||
memcpy (val_buf, value_contents (arg) + argoffset,
|
memcpy (val_buf, value_contents (arg).data () + argoffset,
|
||||||
(len > 8) ? 8 : len);
|
(len > 8) ? 8 : len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3818,7 +3818,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
while (len > 0 && floatreg < IA64_FR16_REGNUM)
|
while (len > 0 && floatreg < IA64_FR16_REGNUM)
|
||||||
{
|
{
|
||||||
gdb_byte to[IA64_FP_REGISTER_SIZE];
|
gdb_byte to[IA64_FP_REGISTER_SIZE];
|
||||||
target_float_convert (value_contents (arg) + argoffset,
|
target_float_convert (value_contents (arg).data () + argoffset,
|
||||||
float_elt_type, to,
|
float_elt_type, to,
|
||||||
ia64_ext_type (gdbarch));
|
ia64_ext_type (gdbarch));
|
||||||
regcache->cooked_write (floatreg, to);
|
regcache->cooked_write (floatreg, to);
|
||||||
|
|
|
@ -451,7 +451,7 @@ get_call_return_value (struct call_return_meta_info *ri)
|
||||||
{
|
{
|
||||||
retval = allocate_value (ri->value_type);
|
retval = allocate_value (ri->value_type);
|
||||||
read_value_memory (retval, 0, 1, ri->struct_addr,
|
read_value_memory (retval, 0, 1, ri->struct_addr,
|
||||||
value_contents_raw (retval),
|
value_contents_raw (retval).data (),
|
||||||
TYPE_LENGTH (ri->value_type));
|
TYPE_LENGTH (ri->value_type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -460,7 +460,7 @@ get_call_return_value (struct call_return_meta_info *ri)
|
||||||
retval = allocate_value (ri->value_type);
|
retval = allocate_value (ri->value_type);
|
||||||
gdbarch_return_value (ri->gdbarch, ri->function, ri->value_type,
|
gdbarch_return_value (ri->gdbarch, ri->function, ri->value_type,
|
||||||
get_current_regcache (),
|
get_current_regcache (),
|
||||||
value_contents_raw (retval), NULL);
|
value_contents_raw (retval).data (), NULL);
|
||||||
if (stack_temporaries && class_or_union_p (ri->value_type))
|
if (stack_temporaries && class_or_union_p (ri->value_type))
|
||||||
{
|
{
|
||||||
/* Values of class type returned in registers are copied onto
|
/* Values of class type returned in registers are copied onto
|
||||||
|
@ -1083,7 +1083,7 @@ call_function_by_hand_dummy (struct value *function,
|
||||||
if (info.trivially_copy_constructible)
|
if (info.trivially_copy_constructible)
|
||||||
{
|
{
|
||||||
int length = TYPE_LENGTH (param_type);
|
int length = TYPE_LENGTH (param_type);
|
||||||
write_memory (addr, value_contents (args[i]), length);
|
write_memory (addr, value_contents (args[i]).data (), length);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1430,7 +1430,7 @@ get_return_value (struct value *function, struct type *value_type)
|
||||||
case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
|
case RETURN_VALUE_ABI_PRESERVES_ADDRESS:
|
||||||
value = allocate_value (value_type);
|
value = allocate_value (value_type);
|
||||||
gdbarch_return_value (gdbarch, function, value_type, stop_regs,
|
gdbarch_return_value (gdbarch, function, value_type, stop_regs,
|
||||||
value_contents_raw (value), NULL);
|
value_contents_raw (value).data (), NULL);
|
||||||
break;
|
break;
|
||||||
case RETURN_VALUE_STRUCT_CONVENTION:
|
case RETURN_VALUE_STRUCT_CONVENTION:
|
||||||
value = NULL;
|
value = NULL;
|
||||||
|
@ -2076,7 +2076,7 @@ default_print_one_register_info (struct ui_file *file,
|
||||||
|| regtype->code () == TYPE_CODE_DECFLOAT)
|
|| regtype->code () == TYPE_CODE_DECFLOAT)
|
||||||
{
|
{
|
||||||
struct value_print_options opts;
|
struct value_print_options opts;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
enum bfd_endian byte_order = type_byte_order (regtype);
|
enum bfd_endian byte_order = type_byte_order (regtype);
|
||||||
|
|
||||||
get_user_print_options (&opts);
|
get_user_print_options (&opts);
|
||||||
|
|
|
@ -8998,7 +8998,7 @@ siginfo_value_read (struct value *v)
|
||||||
target_read (current_inferior ()->top_target (),
|
target_read (current_inferior ()->top_target (),
|
||||||
TARGET_OBJECT_SIGNAL_INFO,
|
TARGET_OBJECT_SIGNAL_INFO,
|
||||||
NULL,
|
NULL,
|
||||||
value_contents_all_raw (v),
|
value_contents_all_raw (v).data (),
|
||||||
value_offset (v),
|
value_offset (v),
|
||||||
TYPE_LENGTH (value_type (v)));
|
TYPE_LENGTH (value_type (v)));
|
||||||
|
|
||||||
|
@ -9021,7 +9021,7 @@ siginfo_value_write (struct value *v, struct value *fromval)
|
||||||
transferred = target_write (current_inferior ()->top_target (),
|
transferred = target_write (current_inferior ()->top_target (),
|
||||||
TARGET_OBJECT_SIGNAL_INFO,
|
TARGET_OBJECT_SIGNAL_INFO,
|
||||||
NULL,
|
NULL,
|
||||||
value_contents_all_raw (fromval),
|
value_contents_all_raw (fromval).data (),
|
||||||
value_offset (v),
|
value_offset (v),
|
||||||
TYPE_LENGTH (value_type (fromval)));
|
TYPE_LENGTH (value_type (fromval)));
|
||||||
|
|
||||||
|
|
|
@ -712,7 +712,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
{
|
{
|
||||||
type = value_type (args[i]);
|
type = value_type (args[i]);
|
||||||
typelen = TYPE_LENGTH (type);
|
typelen = TYPE_LENGTH (type);
|
||||||
val = value_contents (args[i]);
|
val = value_contents (args[i]).data ();
|
||||||
if (typelen <= 4)
|
if (typelen <= 4)
|
||||||
{
|
{
|
||||||
/* Char, short, int, float, pointer, and structs <= four bytes. */
|
/* Char, short, int, float, pointer, and structs <= four bytes. */
|
||||||
|
|
|
@ -271,7 +271,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
|
|
||||||
/* FIXME: Handle structures. */
|
/* FIXME: Handle structures. */
|
||||||
|
|
||||||
contents = (gdb_byte *) value_contents (arg);
|
contents = (gdb_byte *) value_contents (arg).data ();
|
||||||
val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type),
|
val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type),
|
||||||
byte_order);
|
byte_order);
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ m2_print_unbounded_array (struct value *value,
|
||||||
struct value *val;
|
struct value *val;
|
||||||
|
|
||||||
struct type *type = check_typedef (value_type (value));
|
struct type *type = check_typedef (value_type (value));
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (value);
|
const gdb_byte *valaddr = value_contents_for_printing (value).data ();
|
||||||
|
|
||||||
addr = unpack_pointer (type->field (0).type (),
|
addr = unpack_pointer (type->field (0).type (),
|
||||||
(TYPE_FIELD_BITPOS (type, 0) / 8) +
|
(TYPE_FIELD_BITPOS (type, 0) / 8) +
|
||||||
|
@ -305,7 +305,7 @@ m2_language::value_print_inner (struct value *val, struct ui_file *stream,
|
||||||
unsigned len;
|
unsigned len;
|
||||||
struct type *elttype;
|
struct type *elttype;
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
const CORE_ADDR address = value_address (val);
|
const CORE_ADDR address = value_address (val);
|
||||||
|
|
||||||
struct type *type = check_typedef (value_type (val));
|
struct type *type = check_typedef (value_type (val));
|
||||||
|
|
|
@ -2043,7 +2043,7 @@ m32c_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
for (i = nargs - 1; i >= 0; i--)
|
for (i = nargs - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
struct value *arg = args[i];
|
struct value *arg = args[i];
|
||||||
const gdb_byte *arg_bits = value_contents (arg);
|
const gdb_byte *arg_bits = value_contents (arg).data ();
|
||||||
struct type *arg_type = value_type (arg);
|
struct type *arg_type = value_type (arg);
|
||||||
ULONGEST arg_size = TYPE_LENGTH (arg_type);
|
ULONGEST arg_size = TYPE_LENGTH (arg_type);
|
||||||
|
|
||||||
|
|
|
@ -710,11 +710,11 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
{
|
{
|
||||||
/* Value gets right-justified in the register or stack word. */
|
/* Value gets right-justified in the register or stack word. */
|
||||||
memcpy (valbuf + (register_size (gdbarch, argreg) - len),
|
memcpy (valbuf + (register_size (gdbarch, argreg) - len),
|
||||||
(gdb_byte *) value_contents (args[argnum]), len);
|
(gdb_byte *) value_contents (args[argnum]).data (), len);
|
||||||
val = valbuf;
|
val = valbuf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
val = (gdb_byte *) value_contents (args[argnum]);
|
val = (gdb_byte *) value_contents (args[argnum]).data ();
|
||||||
|
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1159,7 +1159,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
{
|
{
|
||||||
ULONGEST v;
|
ULONGEST v;
|
||||||
|
|
||||||
v = extract_unsigned_integer (value_contents (args[0]),
|
v = extract_unsigned_integer (value_contents (args[0]).data (),
|
||||||
TYPE_LENGTH (type), byte_order);
|
TYPE_LENGTH (type), byte_order);
|
||||||
first_stack_argnum = 1;
|
first_stack_argnum = 1;
|
||||||
|
|
||||||
|
@ -1183,7 +1183,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
sp--;
|
sp--;
|
||||||
write_memory (sp, &zero, 1);
|
write_memory (sp, &zero, 1);
|
||||||
}
|
}
|
||||||
val = value_contents (args[argnum]);
|
val = value_contents (args[argnum]).data ();
|
||||||
sp -= TYPE_LENGTH (type);
|
sp -= TYPE_LENGTH (type);
|
||||||
write_memory (sp, val, TYPE_LENGTH (type));
|
write_memory (sp, val, TYPE_LENGTH (type));
|
||||||
}
|
}
|
||||||
|
|
|
@ -560,7 +560,7 @@ m68k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
else
|
else
|
||||||
offset = container_len - len;
|
offset = container_len - len;
|
||||||
sp -= container_len;
|
sp -= container_len;
|
||||||
write_memory (sp + offset, value_contents_all (args[i]), len);
|
write_memory (sp + offset, value_contents_all (args[i]).data (), len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store struct value address. */
|
/* Store struct value address. */
|
||||||
|
|
|
@ -2229,7 +2229,7 @@ push_large_arguments (CORE_ADDR sp, int argc, struct value **argv,
|
||||||
/* Reserve space for the copy, and then round the SP down, to
|
/* Reserve space for the copy, and then round the SP down, to
|
||||||
make sure it's all aligned properly. */
|
make sure it's all aligned properly. */
|
||||||
sp = (sp - arg_len) & -4;
|
sp = (sp - arg_len) & -4;
|
||||||
write_memory (sp, value_contents (argv[i]), arg_len);
|
write_memory (sp, value_contents (argv[i]).data (), arg_len);
|
||||||
copy[i] = sp;
|
copy[i] = sp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2283,7 +2283,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
|
|
||||||
/* Arguments that fit in a GPR get expanded to fill the GPR. */
|
/* Arguments that fit in a GPR get expanded to fill the GPR. */
|
||||||
if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE)
|
if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE)
|
||||||
value = extract_unsigned_integer (value_contents (argv[i]),
|
value = extract_unsigned_integer (value_contents (argv[i]).data (),
|
||||||
TYPE_LENGTH (value_type (argv[i])),
|
TYPE_LENGTH (value_type (argv[i])),
|
||||||
byte_order);
|
byte_order);
|
||||||
|
|
||||||
|
|
|
@ -4585,7 +4585,7 @@ mips_eabi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
fprintf_unfiltered (gdb_stdlog, " push");
|
fprintf_unfiltered (gdb_stdlog, " push");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
|
|
||||||
/* 32-bit ABIs always start floating point arguments in an
|
/* 32-bit ABIs always start floating point arguments in an
|
||||||
even-numbered floating point register. Round the FP register
|
even-numbered floating point register. Round the FP register
|
||||||
|
@ -4960,7 +4960,7 @@ mips_n32n64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
"mips_n32n64_push_dummy_call: %d len=%d type=%d",
|
"mips_n32n64_push_dummy_call: %d len=%d type=%d",
|
||||||
argnum + 1, len, (int) typecode);
|
argnum + 1, len, (int) typecode);
|
||||||
|
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
|
|
||||||
/* A 128-bit long double value requires an even-odd pair of
|
/* A 128-bit long double value requires an even-odd pair of
|
||||||
floating-point registers. */
|
floating-point registers. */
|
||||||
|
@ -5427,7 +5427,7 @@ mips_o32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
"mips_o32_push_dummy_call: %d len=%d type=%d",
|
"mips_o32_push_dummy_call: %d len=%d type=%d",
|
||||||
argnum + 1, len, (int) typecode);
|
argnum + 1, len, (int) typecode);
|
||||||
|
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
|
|
||||||
/* 32-bit ABIs always start floating point arguments in an
|
/* 32-bit ABIs always start floating point arguments in an
|
||||||
even-numbered floating point register. Round the FP register
|
even-numbered floating point register. Round the FP register
|
||||||
|
@ -5949,7 +5949,7 @@ mips_o64_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
"mips_o64_push_dummy_call: %d len=%d type=%d",
|
"mips_o64_push_dummy_call: %d len=%d type=%d",
|
||||||
argnum + 1, len, (int) typecode);
|
argnum + 1, len, (int) typecode);
|
||||||
|
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
|
|
||||||
/* Floating point arguments passed in registers have to be
|
/* Floating point arguments passed in registers have to be
|
||||||
treated specially. On 32-bit architectures, doubles are
|
treated specially. On 32-bit architectures, doubles are
|
||||||
|
@ -6556,7 +6556,7 @@ print_gp_register_row (struct ui_file *file, struct frame_info *frame,
|
||||||
col++;
|
col++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
raw_buffer = value_contents_all (value);
|
raw_buffer = value_contents_all (value).data ();
|
||||||
/* pad small registers */
|
/* pad small registers */
|
||||||
for (byte = 0;
|
for (byte = 0;
|
||||||
byte < (mips_abi_regsize (gdbarch)
|
byte < (mips_abi_regsize (gdbarch)
|
||||||
|
|
|
@ -1222,7 +1222,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
arg_len = TYPE_LENGTH (value_type (*args));
|
arg_len = TYPE_LENGTH (value_type (*args));
|
||||||
val = value_contents (*args);
|
val = value_contents (*args).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
while (regs_used < 2 && arg_len > 0)
|
while (regs_used < 2 && arg_len > 0)
|
||||||
|
|
|
@ -683,7 +683,7 @@ msp430_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
for (i = 0; i < nargs; i++)
|
for (i = 0; i < nargs; i++)
|
||||||
{
|
{
|
||||||
struct value *arg = args[i];
|
struct value *arg = args[i];
|
||||||
const gdb_byte *arg_bits = value_contents_all (arg);
|
const gdb_byte *arg_bits = value_contents_all (arg).data ();
|
||||||
struct type *arg_type = check_typedef (value_type (arg));
|
struct type *arg_type = check_typedef (value_type (arg));
|
||||||
ULONGEST arg_size = TYPE_LENGTH (arg_type);
|
ULONGEST arg_size = TYPE_LENGTH (arg_type);
|
||||||
int offset;
|
int offset;
|
||||||
|
|
|
@ -1481,7 +1481,7 @@ nds32_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
calling_use_fpr = nds32_check_calling_use_fpr (type);
|
calling_use_fpr = nds32_check_calling_use_fpr (type);
|
||||||
len = TYPE_LENGTH (type);
|
len = TYPE_LENGTH (type);
|
||||||
align = type_align (type);
|
align = type_align (type);
|
||||||
val = value_contents (args[i]);
|
val = value_contents (args[i]).data ();
|
||||||
|
|
||||||
/* The size of a composite type larger than 4 bytes will be rounded
|
/* The size of a composite type larger than 4 bytes will be rounded
|
||||||
up to the nearest multiple of 4. */
|
up to the nearest multiple of 4. */
|
||||||
|
|
|
@ -1839,7 +1839,7 @@ nios2_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
struct type *arg_type = check_typedef (value_type (arg));
|
struct type *arg_type = check_typedef (value_type (arg));
|
||||||
int len = TYPE_LENGTH (arg_type);
|
int len = TYPE_LENGTH (arg_type);
|
||||||
|
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
|
|
||||||
/* Copy the argument to general registers or the stack in
|
/* Copy the argument to general registers or the stack in
|
||||||
register-sized pieces. Large arguments are split between
|
register-sized pieces. Large arguments are split between
|
||||||
|
|
|
@ -139,8 +139,8 @@ lval_func_read (struct value *v)
|
||||||
gdb_assert (n <= c->n);
|
gdb_assert (n <= c->n);
|
||||||
|
|
||||||
for (i = offset; i < n; i++)
|
for (i = offset; i < n; i++)
|
||||||
memcpy (value_contents_raw (v) + j++ * elsize,
|
memcpy (value_contents_raw (v).data () + j++ * elsize,
|
||||||
value_contents (c->val) + c->indices[i] * elsize,
|
value_contents (c->val).data () + c->indices[i] * elsize,
|
||||||
elsize);
|
elsize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,8 +179,8 @@ lval_func_write (struct value *v, struct value *fromval)
|
||||||
struct value *from_elm_val = allocate_value (eltype);
|
struct value *from_elm_val = allocate_value (eltype);
|
||||||
struct value *to_elm_val = value_subscript (c->val, c->indices[i]);
|
struct value *to_elm_val = value_subscript (c->val, c->indices[i]);
|
||||||
|
|
||||||
memcpy (value_contents_writeable (from_elm_val),
|
memcpy (value_contents_writeable (from_elm_val).data (),
|
||||||
value_contents (fromval) + j++ * elsize,
|
value_contents (fromval).data () + j++ * elsize,
|
||||||
elsize);
|
elsize);
|
||||||
value_assign (to_elm_val, from_elm_val);
|
value_assign (to_elm_val, from_elm_val);
|
||||||
}
|
}
|
||||||
|
@ -315,9 +315,9 @@ create_value (struct gdbarch *gdbarch, struct value *val, enum noside noside,
|
||||||
|
|
||||||
/* Copy src val contents into the destination value. */
|
/* Copy src val contents into the destination value. */
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
memcpy (value_contents_writeable (ret)
|
memcpy (value_contents_writeable (ret).data ()
|
||||||
+ (i * TYPE_LENGTH (elm_type)),
|
+ (i * TYPE_LENGTH (elm_type)),
|
||||||
value_contents (val)
|
value_contents (val).data ()
|
||||||
+ (indices[i] * TYPE_LENGTH (elm_type)),
|
+ (indices[i] * TYPE_LENGTH (elm_type)),
|
||||||
TYPE_LENGTH (elm_type));
|
TYPE_LENGTH (elm_type));
|
||||||
}
|
}
|
||||||
|
@ -473,7 +473,8 @@ opencl_logical_not (struct type *expect_type, struct expression *exp,
|
||||||
value of its operand compares unequal to 0, and -1 (i.e. all bits
|
value of its operand compares unequal to 0, and -1 (i.e. all bits
|
||||||
set) if the value of its operand compares equal to 0. */
|
set) if the value of its operand compares equal to 0. */
|
||||||
int tmp = value_logical_not (value_subscript (arg, i)) ? -1 : 0;
|
int tmp = value_logical_not (value_subscript (arg, i)) ? -1 : 0;
|
||||||
memset (value_contents_writeable (ret) + i * TYPE_LENGTH (eltype),
|
memset ((value_contents_writeable (ret).data ()
|
||||||
|
+ i * TYPE_LENGTH (eltype)),
|
||||||
tmp, TYPE_LENGTH (eltype));
|
tmp, TYPE_LENGTH (eltype));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -573,7 +574,8 @@ vector_relop (struct expression *exp, struct value *val1, struct value *val2,
|
||||||
if the specified relation is true. */
|
if the specified relation is true. */
|
||||||
int tmp = scalar_relop (value_subscript (val1, i),
|
int tmp = scalar_relop (value_subscript (val1, i),
|
||||||
value_subscript (val2, i), op) ? -1 : 0;
|
value_subscript (val2, i), op) ? -1 : 0;
|
||||||
memset (value_contents_writeable (ret) + i * TYPE_LENGTH (eltype1),
|
memset ((value_contents_writeable (ret).data ()
|
||||||
|
+ i * TYPE_LENGTH (eltype1)),
|
||||||
tmp, TYPE_LENGTH (eltype1));
|
tmp, TYPE_LENGTH (eltype1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -836,8 +838,8 @@ Cannot perform conditional operation on vectors with different sizes"));
|
||||||
{
|
{
|
||||||
tmp = value_logical_not (value_subscript (arg1, i)) ?
|
tmp = value_logical_not (value_subscript (arg1, i)) ?
|
||||||
value_subscript (arg3, i) : value_subscript (arg2, i);
|
value_subscript (arg3, i) : value_subscript (arg2, i);
|
||||||
memcpy (value_contents_writeable (ret) +
|
memcpy (value_contents_writeable (ret).data () +
|
||||||
i * TYPE_LENGTH (eltype2), value_contents_all (tmp),
|
i * TYPE_LENGTH (eltype2), value_contents_all (tmp).data (),
|
||||||
TYPE_LENGTH (eltype2));
|
TYPE_LENGTH (eltype2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -655,7 +655,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
heap_offset += align_up (len, bpw);
|
heap_offset += align_up (len, bpw);
|
||||||
valaddr = heap_sp + heap_offset;
|
valaddr = heap_sp + heap_offset;
|
||||||
|
|
||||||
write_memory (valaddr, value_contents (arg), len);
|
write_memory (valaddr, value_contents (arg).data (), len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The ABI passes all structures by reference, so get its
|
/* The ABI passes all structures by reference, so get its
|
||||||
|
@ -667,7 +667,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Everything else, we just get the value. */
|
/* Everything else, we just get the value. */
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stick the value in a register. */
|
/* Stick the value in a register. */
|
||||||
|
@ -767,7 +767,7 @@ or1k_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
val = valbuf;
|
val = valbuf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
|
|
||||||
while (len > 0)
|
while (len > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,7 +80,7 @@ pascal_language::value_print_inner (struct value *val,
|
||||||
struct type *char_type;
|
struct type *char_type;
|
||||||
CORE_ADDR addr;
|
CORE_ADDR addr;
|
||||||
int want_space = 0;
|
int want_space = 0;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
switch (type->code ())
|
switch (type->code ())
|
||||||
{
|
{
|
||||||
|
@ -536,7 +536,7 @@ pascal_object_print_value_fields (struct value *val, struct ui_file *stream,
|
||||||
{
|
{
|
||||||
struct obstack tmp_obstack = dont_print_statmem_obstack;
|
struct obstack tmp_obstack = dont_print_statmem_obstack;
|
||||||
int fields_seen = 0;
|
int fields_seen = 0;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
if (dont_print_statmem == 0)
|
if (dont_print_statmem == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -122,7 +122,7 @@ ppc_sysv_abi_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
struct value *arg = args[argno];
|
struct value *arg = args[argno];
|
||||||
struct type *type = check_typedef (value_type (arg));
|
struct type *type = check_typedef (value_type (arg));
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
const bfd_byte *val = value_contents (arg);
|
const bfd_byte *val = value_contents (arg).data ();
|
||||||
|
|
||||||
if (type->code () == TYPE_CODE_FLT && len <= 8
|
if (type->code () == TYPE_CODE_FLT && len <= 8
|
||||||
&& !tdep->soft_float)
|
&& !tdep->soft_float)
|
||||||
|
@ -1633,7 +1633,7 @@ ppc64_sysv_abi_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct value *arg = args[argno];
|
struct value *arg = args[argno];
|
||||||
struct type *type = check_typedef (value_type (arg));
|
struct type *type = check_typedef (value_type (arg));
|
||||||
const bfd_byte *val = value_contents (arg);
|
const bfd_byte *val = value_contents (arg).data ();
|
||||||
|
|
||||||
if (type->code () == TYPE_CODE_COMPLEX)
|
if (type->code () == TYPE_CODE_COMPLEX)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2447,7 +2447,7 @@ printf_c_string (struct ui_file *stream, const char *format,
|
||||||
null terminated) to be printed without problems. */
|
null terminated) to be printed without problems. */
|
||||||
gdb_byte *tem_str = (gdb_byte *) alloca (len + 1);
|
gdb_byte *tem_str = (gdb_byte *) alloca (len + 1);
|
||||||
|
|
||||||
memcpy (tem_str, value_contents (value), len);
|
memcpy (tem_str, value_contents (value).data (), len);
|
||||||
tem_str [len] = 0;
|
tem_str [len] = 0;
|
||||||
str = tem_str;
|
str = tem_str;
|
||||||
}
|
}
|
||||||
|
@ -2511,7 +2511,7 @@ printf_wide_c_string (struct ui_file *stream, const char *format,
|
||||||
if (VALUE_LVAL (value) == lval_internalvar
|
if (VALUE_LVAL (value) == lval_internalvar
|
||||||
&& c_is_string_type_p (value_type (value)))
|
&& c_is_string_type_p (value_type (value)))
|
||||||
{
|
{
|
||||||
str = value_contents (value);
|
str = value_contents (value).data ();
|
||||||
len = TYPE_LENGTH (value_type (value));
|
len = TYPE_LENGTH (value_type (value));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2620,14 +2620,15 @@ printf_floating (struct ui_file *stream, const char *format,
|
||||||
{
|
{
|
||||||
param_type = float_type_from_length (param_type);
|
param_type = float_type_from_length (param_type);
|
||||||
if (param_type != value_type (value))
|
if (param_type != value_type (value))
|
||||||
value = value_from_contents (param_type, value_contents (value));
|
value = value_from_contents (param_type,
|
||||||
|
value_contents (value).data ());
|
||||||
}
|
}
|
||||||
|
|
||||||
value = value_cast (fmt_type, value);
|
value = value_cast (fmt_type, value);
|
||||||
|
|
||||||
/* Convert the value to a string and print it. */
|
/* Convert the value to a string and print it. */
|
||||||
std::string str
|
std::string str
|
||||||
= target_float_to_string (value_contents (value), fmt_type, format);
|
= target_float_to_string (value_contents (value).data (), fmt_type, format);
|
||||||
fputs_filtered (str.c_str (), stream);
|
fputs_filtered (str.c_str (), stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2788,7 +2789,7 @@ ui_printf (const char *arg, struct ui_file *stream)
|
||||||
|| valtype->code () != TYPE_CODE_INT)
|
|| valtype->code () != TYPE_CODE_INT)
|
||||||
error (_("expected wchar_t argument for %%lc"));
|
error (_("expected wchar_t argument for %%lc"));
|
||||||
|
|
||||||
bytes = value_contents (val_args[i]);
|
bytes = value_contents (val_args[i]).data ();
|
||||||
|
|
||||||
auto_obstack output;
|
auto_obstack output;
|
||||||
|
|
||||||
|
|
|
@ -689,7 +689,7 @@ infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
|
||||||
else if (gdbpy_is_value_object (handle_obj))
|
else if (gdbpy_is_value_object (handle_obj))
|
||||||
{
|
{
|
||||||
struct value *val = value_object_to_value (handle_obj);
|
struct value *val = value_object_to_value (handle_obj);
|
||||||
bytes = value_contents_all (val);
|
bytes = value_contents_all (val).data ();
|
||||||
bytes_len = TYPE_LENGTH (value_type (val));
|
bytes_len = TYPE_LENGTH (value_type (val));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -133,7 +133,7 @@ pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
|
||||||
if ((value = value_object_to_value (pyo_value)) != NULL)
|
if ((value = value_object_to_value (pyo_value)) != NULL)
|
||||||
{
|
{
|
||||||
*addr = unpack_pointer (value_type (value),
|
*addr = unpack_pointer (value_type (value),
|
||||||
value_contents (value));
|
value_contents (value).data ());
|
||||||
rc = 1;
|
rc = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -631,7 +631,8 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame,
|
||||||
gdb_assert (data_size == TYPE_LENGTH (value_type (value)));
|
gdb_assert (data_size == TYPE_LENGTH (value_type (value)));
|
||||||
|
|
||||||
cached_frame->reg[i].data = (gdb_byte *) xmalloc (data_size);
|
cached_frame->reg[i].data = (gdb_byte *) xmalloc (data_size);
|
||||||
memcpy (cached_frame->reg[i].data, value_contents (value), data_size);
|
memcpy (cached_frame->reg[i].data,
|
||||||
|
value_contents (value).data (), data_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1500,8 +1500,8 @@ valpy_nonzero (PyObject *self)
|
||||||
if (is_integral_type (type) || type->code () == TYPE_CODE_PTR)
|
if (is_integral_type (type) || type->code () == TYPE_CODE_PTR)
|
||||||
nonzero = !!value_as_long (self_value->value);
|
nonzero = !!value_as_long (self_value->value);
|
||||||
else if (is_floating_value (self_value->value))
|
else if (is_floating_value (self_value->value))
|
||||||
nonzero = !target_float_is_zero (value_contents (self_value->value),
|
nonzero = !target_float_is_zero
|
||||||
type);
|
(value_contents (self_value->value).data (), type);
|
||||||
else
|
else
|
||||||
/* All other values are True. */
|
/* All other values are True. */
|
||||||
nonzero = 1;
|
nonzero = 1;
|
||||||
|
@ -1754,7 +1754,7 @@ valpy_float (PyObject *self)
|
||||||
type = check_typedef (type);
|
type = check_typedef (type);
|
||||||
|
|
||||||
if (type->code () == TYPE_CODE_FLT && is_floating_value (value))
|
if (type->code () == TYPE_CODE_FLT && is_floating_value (value))
|
||||||
d = target_float_to_host_double (value_contents (value), type);
|
d = target_float_to_host_double (value_contents (value).data (), type);
|
||||||
else if (type->code () == TYPE_CODE_INT)
|
else if (type->code () == TYPE_CODE_INT)
|
||||||
{
|
{
|
||||||
/* Note that valpy_long accepts TYPE_CODE_PTR and some
|
/* Note that valpy_long accepts TYPE_CODE_PTR and some
|
||||||
|
|
|
@ -712,7 +712,7 @@ readable_regcache::cooked_read (int regnum, gdb_byte *buf)
|
||||||
computed = gdbarch_pseudo_register_read_value (m_descr->gdbarch,
|
computed = gdbarch_pseudo_register_read_value (m_descr->gdbarch,
|
||||||
this, regnum);
|
this, regnum);
|
||||||
if (value_entirely_available (computed))
|
if (value_entirely_available (computed))
|
||||||
memcpy (buf, value_contents_raw (computed),
|
memcpy (buf, value_contents_raw (computed).data (),
|
||||||
m_descr->sizeof_register[regnum]);
|
m_descr->sizeof_register[regnum]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -749,7 +749,7 @@ readable_regcache::cooked_read_value (int regnum)
|
||||||
direction than in the other one, even though the value-based
|
direction than in the other one, even though the value-based
|
||||||
API is preferred. */
|
API is preferred. */
|
||||||
if (cooked_read (regnum,
|
if (cooked_read (regnum,
|
||||||
value_contents_raw (result)) == REG_UNAVAILABLE)
|
value_contents_raw (result).data ()) == REG_UNAVAILABLE)
|
||||||
mark_value_bytes_unavailable (result, 0,
|
mark_value_bytes_unavailable (result, 0,
|
||||||
TYPE_LENGTH (value_type (result)));
|
TYPE_LENGTH (value_type (result)));
|
||||||
|
|
||||||
|
|
|
@ -1059,7 +1059,7 @@ riscv_print_one_register_info (struct gdbarch *gdbarch,
|
||||||
&& regtype->field (2).type ()->code () == TYPE_CODE_FLT))
|
&& regtype->field (2).type ()->code () == TYPE_CODE_FLT))
|
||||||
{
|
{
|
||||||
struct value_print_options opts;
|
struct value_print_options opts;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
enum bfd_endian byte_order = type_byte_order (regtype);
|
enum bfd_endian byte_order = type_byte_order (regtype);
|
||||||
|
|
||||||
get_user_print_options (&opts);
|
get_user_print_options (&opts);
|
||||||
|
@ -2942,7 +2942,7 @@ riscv_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
|
|
||||||
if (info->type != arg_type)
|
if (info->type != arg_type)
|
||||||
arg_value = value_cast (info->type, arg_value);
|
arg_value = value_cast (info->type, arg_value);
|
||||||
info->contents = value_contents (arg_value);
|
info->contents = value_contents (arg_value).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Adjust the stack pointer and align it. */
|
/* Adjust the stack pointer and align it. */
|
||||||
|
@ -3137,13 +3137,13 @@ riscv_return_value (struct gdbarch *gdbarch,
|
||||||
{
|
{
|
||||||
struct value *arg_val = value_from_contents (arg_type, writebuf);
|
struct value *arg_val = value_from_contents (arg_type, writebuf);
|
||||||
abi_val = value_cast (info.type, arg_val);
|
abi_val = value_cast (info.type, arg_val);
|
||||||
writebuf = value_contents_raw (abi_val);
|
writebuf = value_contents_raw (abi_val).data ();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
abi_val = allocate_value (info.type);
|
abi_val = allocate_value (info.type);
|
||||||
old_readbuf = readbuf;
|
old_readbuf = readbuf;
|
||||||
readbuf = value_contents_raw (abi_val);
|
readbuf = value_contents_raw (abi_val).data ();
|
||||||
}
|
}
|
||||||
arg_len = TYPE_LENGTH (info.type);
|
arg_len = TYPE_LENGTH (info.type);
|
||||||
|
|
||||||
|
@ -3241,7 +3241,7 @@ riscv_return_value (struct gdbarch *gdbarch,
|
||||||
if (readbuf != nullptr)
|
if (readbuf != nullptr)
|
||||||
{
|
{
|
||||||
struct value *arg_val = value_cast (arg_type, abi_val);
|
struct value *arg_val = value_cast (arg_type, abi_val);
|
||||||
memcpy (old_readbuf, value_contents_raw (arg_val),
|
memcpy (old_readbuf, value_contents_raw (arg_val).data (),
|
||||||
TYPE_LENGTH (arg_type));
|
TYPE_LENGTH (arg_type));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1345,7 +1345,7 @@ rl78_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
|
|
||||||
sp -= container_len;
|
sp -= container_len;
|
||||||
write_memory (rl78_make_data_address (sp),
|
write_memory (rl78_make_data_address (sp),
|
||||||
value_contents_all (args[i]), len);
|
value_contents_all (args[i]).data (), len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store struct value address. */
|
/* Store struct value address. */
|
||||||
|
|
|
@ -364,7 +364,8 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
|
|
||||||
gdb_assert (len <= 8);
|
gdb_assert (len <= 8);
|
||||||
|
|
||||||
target_float_convert (value_contents (arg), type, reg_val, reg_type);
|
target_float_convert (value_contents (arg).data (), type, reg_val,
|
||||||
|
reg_type);
|
||||||
regcache->cooked_write (fp_regnum, reg_val);
|
regcache->cooked_write (fp_regnum, reg_val);
|
||||||
++f_argno;
|
++f_argno;
|
||||||
}
|
}
|
||||||
|
@ -378,7 +379,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
||||||
memset (word, 0, reg_size);
|
memset (word, 0, reg_size);
|
||||||
memcpy (word,
|
memcpy (word,
|
||||||
((char *) value_contents (arg)) + argbytes,
|
((char *) value_contents (arg).data ()) + argbytes,
|
||||||
(len - argbytes) > reg_size
|
(len - argbytes) > reg_size
|
||||||
? reg_size : len - argbytes);
|
? reg_size : len - argbytes);
|
||||||
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
|
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
|
||||||
|
@ -396,7 +397,7 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
memset (word, 0, reg_size);
|
memset (word, 0, reg_size);
|
||||||
memcpy (word, value_contents (arg), len);
|
memcpy (word, value_contents (arg).data (), len);
|
||||||
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
|
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
|
||||||
}
|
}
|
||||||
++argno;
|
++argno;
|
||||||
|
@ -457,7 +458,7 @@ ran_out_of_registers_for_arguments:
|
||||||
if (argbytes)
|
if (argbytes)
|
||||||
{
|
{
|
||||||
write_memory (sp + 24 + (ii * 4),
|
write_memory (sp + 24 + (ii * 4),
|
||||||
value_contents (arg) + argbytes,
|
value_contents (arg).data () + argbytes,
|
||||||
len - argbytes);
|
len - argbytes);
|
||||||
++argno;
|
++argno;
|
||||||
ii += ((len - argbytes + 3) & -4) / 4;
|
ii += ((len - argbytes + 3) & -4) / 4;
|
||||||
|
@ -480,11 +481,11 @@ ran_out_of_registers_for_arguments:
|
||||||
gdb_assert (len <= 8);
|
gdb_assert (len <= 8);
|
||||||
|
|
||||||
regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
|
regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
++f_argno;
|
++f_argno;
|
||||||
}
|
}
|
||||||
|
|
||||||
write_memory (sp + 24 + (ii * 4), value_contents (arg), len);
|
write_memory (sp + 24 + (ii * 4), value_contents (arg).data (), len);
|
||||||
ii += ((len + 3) & -4) / 4;
|
ii += ((len + 3) & -4) / 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,8 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
|
|
||||||
gdb_assert (len <= 8);
|
gdb_assert (len <= 8);
|
||||||
|
|
||||||
target_float_convert (value_contents (arg), type, reg_val, reg_type);
|
target_float_convert (value_contents (arg).data (), type, reg_val,
|
||||||
|
reg_type);
|
||||||
regcache->cooked_write (fp_regnum, reg_val);
|
regcache->cooked_write (fp_regnum, reg_val);
|
||||||
++f_argno;
|
++f_argno;
|
||||||
}
|
}
|
||||||
|
@ -125,7 +126,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
||||||
memset (word, 0, reg_size);
|
memset (word, 0, reg_size);
|
||||||
memcpy (word,
|
memcpy (word,
|
||||||
((char *) value_contents (arg)) + argbytes,
|
((char *) value_contents (arg).data ()) + argbytes,
|
||||||
(len - argbytes) > reg_size
|
(len - argbytes) > reg_size
|
||||||
? reg_size : len - argbytes);
|
? reg_size : len - argbytes);
|
||||||
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
|
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 + ii, word);
|
||||||
|
@ -143,7 +144,7 @@ rs6000_lynx178_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
gdb_byte word[PPC_MAX_REGISTER_SIZE];
|
||||||
|
|
||||||
memset (word, 0, reg_size);
|
memset (word, 0, reg_size);
|
||||||
memcpy (word, value_contents (arg), len);
|
memcpy (word, value_contents (arg).data (), len);
|
||||||
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
|
regcache->cooked_write (tdep->ppc_gp0_regnum + 3 +ii, word);
|
||||||
}
|
}
|
||||||
++argno;
|
++argno;
|
||||||
|
@ -205,7 +206,7 @@ ran_out_of_registers_for_arguments:
|
||||||
if (argbytes)
|
if (argbytes)
|
||||||
{
|
{
|
||||||
write_memory (sp + 24 + (ii * 4),
|
write_memory (sp + 24 + (ii * 4),
|
||||||
value_contents (arg) + argbytes,
|
value_contents (arg).data () + argbytes,
|
||||||
len - argbytes);
|
len - argbytes);
|
||||||
++argno;
|
++argno;
|
||||||
ii += align_up (len - argbytes, 4) / 4;
|
ii += align_up (len - argbytes, 4) / 4;
|
||||||
|
@ -228,11 +229,11 @@ ran_out_of_registers_for_arguments:
|
||||||
gdb_assert (len <= 8);
|
gdb_assert (len <= 8);
|
||||||
|
|
||||||
regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
|
regcache->cooked_write (tdep->ppc_fp0_regnum + 1 + f_argno,
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
++f_argno;
|
++f_argno;
|
||||||
}
|
}
|
||||||
|
|
||||||
write_memory (sp + 24 + (ii * 4), value_contents (arg), len);
|
write_memory (sp + 24 + (ii * 4), value_contents (arg).data (), len);
|
||||||
ii += align_up (len, 4) / 4;
|
ii += align_up (len, 4) / 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -415,7 +415,8 @@ rust_language::print_enum (struct value *val, struct ui_file *stream,
|
||||||
opts.deref_ref = 0;
|
opts.deref_ref = 0;
|
||||||
|
|
||||||
gdb_assert (rust_enum_p (type));
|
gdb_assert (rust_enum_p (type));
|
||||||
gdb::array_view<const gdb_byte> view (value_contents_for_printing (val),
|
gdb::array_view<const gdb_byte> view
|
||||||
|
(value_contents_for_printing (val).data (),
|
||||||
TYPE_LENGTH (value_type (val)));
|
TYPE_LENGTH (value_type (val)));
|
||||||
type = resolve_dynamic_type (type, view, value_address (val));
|
type = resolve_dynamic_type (type, view, value_address (val));
|
||||||
|
|
||||||
|
@ -558,7 +559,7 @@ rust_language::value_print_inner
|
||||||
encoding. */
|
encoding. */
|
||||||
fputs_filtered ("b", stream);
|
fputs_filtered ("b", stream);
|
||||||
printstr (stream, TYPE_TARGET_TYPE (type),
|
printstr (stream, TYPE_TARGET_TYPE (type),
|
||||||
value_contents_for_printing (val),
|
value_contents_for_printing (val).data (),
|
||||||
high_bound - low_bound + 1, "ASCII", 0, &opts);
|
high_bound - low_bound + 1, "ASCII", 0, &opts);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -1316,7 +1317,7 @@ eval_op_rust_struct_anon (struct type *expect_type, struct expression *exp,
|
||||||
|
|
||||||
if (rust_enum_p (type))
|
if (rust_enum_p (type))
|
||||||
{
|
{
|
||||||
gdb::array_view<const gdb_byte> view (value_contents (lhs),
|
gdb::array_view<const gdb_byte> view (value_contents (lhs).data (),
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
type = resolve_dynamic_type (type, view, value_address (lhs));
|
type = resolve_dynamic_type (type, view, value_address (lhs));
|
||||||
|
|
||||||
|
@ -1379,7 +1380,7 @@ eval_op_rust_structop (struct type *expect_type, struct expression *exp,
|
||||||
struct type *type = value_type (lhs);
|
struct type *type = value_type (lhs);
|
||||||
if (type->code () == TYPE_CODE_STRUCT && rust_enum_p (type))
|
if (type->code () == TYPE_CODE_STRUCT && rust_enum_p (type))
|
||||||
{
|
{
|
||||||
gdb::array_view<const gdb_byte> view (value_contents (lhs),
|
gdb::array_view<const gdb_byte> view (value_contents (lhs).data (),
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
type = resolve_dynamic_type (type, view, value_address (lhs));
|
type = resolve_dynamic_type (type, view, value_address (lhs));
|
||||||
|
|
||||||
|
|
|
@ -518,9 +518,9 @@ rx_frame_prev_register (struct frame_info *this_frame, void **this_cache,
|
||||||
|
|
||||||
psw_val = rx_frame_prev_register (this_frame, this_cache,
|
psw_val = rx_frame_prev_register (this_frame, this_cache,
|
||||||
RX_PSW_REGNUM);
|
RX_PSW_REGNUM);
|
||||||
psw = extract_unsigned_integer (value_contents_all (psw_val), 4,
|
psw = extract_unsigned_integer
|
||||||
gdbarch_byte_order (
|
(value_contents_all (psw_val).data (), 4,
|
||||||
get_frame_arch (this_frame)));
|
gdbarch_byte_order (get_frame_arch (this_frame)));
|
||||||
|
|
||||||
if ((psw & 0x20000 /* U bit */) != 0)
|
if ((psw & 0x20000 /* U bit */) != 0)
|
||||||
return rx_frame_prev_register (this_frame, this_cache,
|
return rx_frame_prev_register (this_frame, this_cache,
|
||||||
|
@ -724,7 +724,7 @@ rx_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
for (i = 0; i < nargs; i++)
|
for (i = 0; i < nargs; i++)
|
||||||
{
|
{
|
||||||
struct value *arg = args[i];
|
struct value *arg = args[i];
|
||||||
const gdb_byte *arg_bits = value_contents_all (arg);
|
const gdb_byte *arg_bits = value_contents_all (arg).data ();
|
||||||
struct type *arg_type = check_typedef (value_type (arg));
|
struct type *arg_type = check_typedef (value_type (arg));
|
||||||
ULONGEST arg_size = TYPE_LENGTH (arg_type);
|
ULONGEST arg_size = TYPE_LENGTH (arg_type);
|
||||||
|
|
||||||
|
|
|
@ -1764,7 +1764,7 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
|
||||||
it occupies the leftmost bits. */
|
it occupies the leftmost bits. */
|
||||||
if (write_mode)
|
if (write_mode)
|
||||||
as->regcache->cooked_write_part (S390_F0_REGNUM + as->fr, 0, length,
|
as->regcache->cooked_write_part (S390_F0_REGNUM + as->fr, 0, length,
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
as->fr += 2;
|
as->fr += 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1773,7 +1773,7 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
|
||||||
it occupies the rightmost bits. */
|
it occupies the rightmost bits. */
|
||||||
as->argp = align_up (as->argp + length, word_size);
|
as->argp = align_up (as->argp + length, word_size);
|
||||||
if (write_mode)
|
if (write_mode)
|
||||||
write_memory (as->argp - length, value_contents (arg),
|
write_memory (as->argp - length, value_contents (arg).data (),
|
||||||
length);
|
length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1788,13 +1788,13 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
|
||||||
|
|
||||||
if (write_mode)
|
if (write_mode)
|
||||||
as->regcache->cooked_write_part (regnum, 0, length,
|
as->regcache->cooked_write_part (regnum, 0, length,
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
as->vr++;
|
as->vr++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (write_mode)
|
if (write_mode)
|
||||||
write_memory (as->argp, value_contents (arg), length);
|
write_memory (as->argp, value_contents (arg).data (), length);
|
||||||
as->argp = align_up (as->argp + length, word_size);
|
as->argp = align_up (as->argp + length, word_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1809,9 +1809,9 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
|
||||||
memory word and sign- or zero-extend to full word size.
|
memory word and sign- or zero-extend to full word size.
|
||||||
This also applies to a struct or union. */
|
This also applies to a struct or union. */
|
||||||
val = type->is_unsigned ()
|
val = type->is_unsigned ()
|
||||||
? extract_unsigned_integer (value_contents (arg),
|
? extract_unsigned_integer (value_contents (arg).data (),
|
||||||
length, byte_order)
|
length, byte_order)
|
||||||
: extract_signed_integer (value_contents (arg),
|
: extract_signed_integer (value_contents (arg).data (),
|
||||||
length, byte_order);
|
length, byte_order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1838,9 +1838,10 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
|
||||||
if (write_mode)
|
if (write_mode)
|
||||||
{
|
{
|
||||||
as->regcache->cooked_write (S390_R0_REGNUM + as->gr,
|
as->regcache->cooked_write (S390_R0_REGNUM + as->gr,
|
||||||
value_contents (arg));
|
value_contents (arg).data ());
|
||||||
as->regcache->cooked_write (S390_R0_REGNUM + as->gr + 1,
|
as->regcache->cooked_write
|
||||||
value_contents (arg) + word_size);
|
(S390_R0_REGNUM + as->gr + 1,
|
||||||
|
value_contents (arg).data () + word_size);
|
||||||
}
|
}
|
||||||
as->gr += 2;
|
as->gr += 2;
|
||||||
}
|
}
|
||||||
|
@ -1851,7 +1852,7 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
|
||||||
as->gr = 7;
|
as->gr = 7;
|
||||||
|
|
||||||
if (write_mode)
|
if (write_mode)
|
||||||
write_memory (as->argp, value_contents (arg), length);
|
write_memory (as->argp, value_contents (arg).data (), length);
|
||||||
as->argp += length;
|
as->argp += length;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1862,7 +1863,7 @@ s390_handle_arg (struct s390_arg_state *as, struct value *arg,
|
||||||
alignment as a conservative assumption. */
|
alignment as a conservative assumption. */
|
||||||
as->copy = align_down (as->copy - length, 8);
|
as->copy = align_down (as->copy - length, 8);
|
||||||
if (write_mode)
|
if (write_mode)
|
||||||
write_memory (as->copy, value_contents (arg), length);
|
write_memory (as->copy, value_contents (arg).data (), length);
|
||||||
|
|
||||||
if (as->gr <= 6)
|
if (as->gr <= 6)
|
||||||
{
|
{
|
||||||
|
|
|
@ -530,7 +530,7 @@ score_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
struct value *arg = args[argnum];
|
struct value *arg = args[argnum];
|
||||||
struct type *arg_type = check_typedef (value_type (arg));
|
struct type *arg_type = check_typedef (value_type (arg));
|
||||||
enum type_code typecode = arg_type->code ();
|
enum type_code typecode = arg_type->code ();
|
||||||
const gdb_byte *val = value_contents (arg);
|
const gdb_byte *val = value_contents (arg).data ();
|
||||||
int downward_offset = 0;
|
int downward_offset = 0;
|
||||||
int arg_last_part_p = 0;
|
int arg_last_part_p = 0;
|
||||||
|
|
||||||
|
|
|
@ -923,12 +923,12 @@ sh_justify_value_in_reg (struct gdbarch *gdbarch, struct value *val, int len)
|
||||||
{
|
{
|
||||||
/* value gets right-justified in the register or stack word. */
|
/* value gets right-justified in the register or stack word. */
|
||||||
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG)
|
||||||
memcpy (valbuf + (4 - len), value_contents (val), len);
|
memcpy (valbuf + (4 - len), value_contents (val).data (), len);
|
||||||
else
|
else
|
||||||
memcpy (valbuf, value_contents (val), len);
|
memcpy (valbuf, value_contents (val).data (), len);
|
||||||
return valbuf;
|
return valbuf;
|
||||||
}
|
}
|
||||||
return value_contents (val);
|
return value_contents (val).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Helper function to eval number of bytes to allocate on stack. */
|
/* Helper function to eval number of bytes to allocate on stack. */
|
||||||
|
|
|
@ -642,7 +642,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs,
|
||||||
correct, and wasting a few bytes shouldn't be a problem. */
|
correct, and wasting a few bytes shouldn't be a problem. */
|
||||||
sp &= ~0x7;
|
sp &= ~0x7;
|
||||||
|
|
||||||
write_memory (sp, value_contents (args[i]), len);
|
write_memory (sp, value_contents (args[i]).data (), len);
|
||||||
args[i] = value_from_pointer (lookup_pointer_type (type), sp);
|
args[i] = value_from_pointer (lookup_pointer_type (type), sp);
|
||||||
num_elements++;
|
num_elements++;
|
||||||
}
|
}
|
||||||
|
@ -673,7 +673,7 @@ sparc32_store_arguments (struct regcache *regcache, int nargs,
|
||||||
|
|
||||||
for (i = 0; i < nargs; i++)
|
for (i = 0; i < nargs; i++)
|
||||||
{
|
{
|
||||||
const bfd_byte *valbuf = value_contents (args[i]);
|
const bfd_byte *valbuf = value_contents (args[i]).data ();
|
||||||
struct type *type = value_type (args[i]);
|
struct type *type = value_type (args[i]);
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
gdb_byte buf[4];
|
gdb_byte buf[4];
|
||||||
|
|
|
@ -1418,7 +1418,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
|
||||||
a problem. */
|
a problem. */
|
||||||
sp &= ~0xf;
|
sp &= ~0xf;
|
||||||
|
|
||||||
write_memory (sp, value_contents (args[i]), len);
|
write_memory (sp, value_contents (args[i]).data (), len);
|
||||||
args[i] = value_from_pointer (lookup_pointer_type (type), sp);
|
args[i] = value_from_pointer (lookup_pointer_type (type), sp);
|
||||||
num_elements++;
|
num_elements++;
|
||||||
}
|
}
|
||||||
|
@ -1487,7 +1487,7 @@ sparc64_store_arguments (struct regcache *regcache, int nargs,
|
||||||
|
|
||||||
for (i = 0; i < nargs; i++)
|
for (i = 0; i < nargs; i++)
|
||||||
{
|
{
|
||||||
const gdb_byte *valbuf = value_contents (args[i]);
|
const gdb_byte *valbuf = value_contents (args[i]).data ();
|
||||||
struct type *type = value_type (args[i]);
|
struct type *type = value_type (args[i]);
|
||||||
int len = TYPE_LENGTH (type);
|
int len = TYPE_LENGTH (type);
|
||||||
int regnum = -1;
|
int regnum = -1;
|
||||||
|
|
|
@ -1716,8 +1716,8 @@ info_frame_command_core (struct frame_info *fi, bool selected_frame_p)
|
||||||
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
|
||||||
int sp_size = register_size (gdbarch, sp_regnum);
|
int sp_size = register_size (gdbarch, sp_regnum);
|
||||||
|
|
||||||
sp = extract_unsigned_integer (value_contents_all (value),
|
sp = extract_unsigned_integer
|
||||||
sp_size, byte_order);
|
(value_contents_all (value).data (), sp_size, byte_order);
|
||||||
|
|
||||||
printf_filtered (" Previous frame's sp is ");
|
printf_filtered (" Previous frame's sp is ");
|
||||||
fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
|
fputs_filtered (paddress (gdbarch, sp), gdb_stdout);
|
||||||
|
@ -2842,7 +2842,7 @@ return_command (const char *retval_exp, int from_tty)
|
||||||
&& rv_conv != RETURN_VALUE_ABI_RETURNS_ADDRESS);
|
&& rv_conv != RETURN_VALUE_ABI_RETURNS_ADDRESS);
|
||||||
gdbarch_return_value (cache_arch, function, return_type,
|
gdbarch_return_value (cache_arch, function, return_type,
|
||||||
get_current_regcache (), NULL /*read*/,
|
get_current_regcache (), NULL /*read*/,
|
||||||
value_contents (return_value) /*write*/);
|
value_contents (return_value).data () /*write*/);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we are at the end of a call dummy now, pop the dummy frame
|
/* If we are at the end of a call dummy now, pop the dummy frame
|
||||||
|
|
|
@ -44,7 +44,7 @@ value_of_builtin_frame_fp_reg (struct frame_info *frame, const void *baton)
|
||||||
{
|
{
|
||||||
struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
|
struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
|
||||||
struct value *val = allocate_value (data_ptr_type);
|
struct value *val = allocate_value (data_ptr_type);
|
||||||
gdb_byte *buf = value_contents_raw (val);
|
gdb_byte *buf = value_contents_raw (val).data ();
|
||||||
|
|
||||||
gdbarch_address_to_pointer (gdbarch, data_ptr_type,
|
gdbarch_address_to_pointer (gdbarch, data_ptr_type,
|
||||||
buf, get_frame_base_address (frame));
|
buf, get_frame_base_address (frame));
|
||||||
|
@ -63,7 +63,7 @@ value_of_builtin_frame_pc_reg (struct frame_info *frame, const void *baton)
|
||||||
{
|
{
|
||||||
struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
|
struct type *func_ptr_type = builtin_type (gdbarch)->builtin_func_ptr;
|
||||||
struct value *val = allocate_value (func_ptr_type);
|
struct value *val = allocate_value (func_ptr_type);
|
||||||
gdb_byte *buf = value_contents_raw (val);
|
gdb_byte *buf = value_contents_raw (val).data ();
|
||||||
|
|
||||||
gdbarch_address_to_pointer (gdbarch, func_ptr_type,
|
gdbarch_address_to_pointer (gdbarch, func_ptr_type,
|
||||||
buf, get_frame_pc (frame));
|
buf, get_frame_pc (frame));
|
||||||
|
|
|
@ -919,7 +919,7 @@ tic6x_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
|
||||||
int len = TYPE_LENGTH (arg_type);
|
int len = TYPE_LENGTH (arg_type);
|
||||||
enum type_code typecode = arg_type->code ();
|
enum type_code typecode = arg_type->code ();
|
||||||
|
|
||||||
val = value_contents (arg);
|
val = value_contents (arg).data ();
|
||||||
|
|
||||||
/* Copy the argument to general registers or the stack in
|
/* Copy the argument to general registers or the stack in
|
||||||
register-sized pieces. */
|
register-sized pieces. */
|
||||||
|
|
|
@ -308,7 +308,7 @@ tilegx_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Put argument into registers wordwise. */
|
/* Put argument into registers wordwise. */
|
||||||
val = value_contents (args[i]);
|
val = value_contents (args[i]).data ();
|
||||||
for (j = 0; j < typelen; j += tilegx_reg_size)
|
for (j = 0; j < typelen; j += tilegx_reg_size)
|
||||||
{
|
{
|
||||||
/* ISSUE: Why special handling for "typelen = 4x + 1"?
|
/* ISSUE: Why special handling for "typelen = 4x + 1"?
|
||||||
|
@ -327,7 +327,7 @@ tilegx_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
the stack, word aligned. */
|
the stack, word aligned. */
|
||||||
for (j = nargs - 1; j >= i; j--)
|
for (j = nargs - 1; j >= i; j--)
|
||||||
{
|
{
|
||||||
const gdb_byte *contents = value_contents (args[j]);
|
const gdb_byte *contents = value_contents (args[j]).data ();
|
||||||
|
|
||||||
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
|
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
|
||||||
slacklen = align_up (typelen, 8) - typelen;
|
slacklen = align_up (typelen, 8) - typelen;
|
||||||
|
|
|
@ -3820,7 +3820,7 @@ sdata_make_value (struct gdbarch *gdbarch, struct internalvar *var,
|
||||||
type = init_vector_type (builtin_type (gdbarch)->builtin_true_char,
|
type = init_vector_type (builtin_type (gdbarch)->builtin_true_char,
|
||||||
buf->size ());
|
buf->size ());
|
||||||
v = allocate_value (type);
|
v = allocate_value (type);
|
||||||
memcpy (value_contents_raw (v), buf->data (), buf->size ());
|
memcpy (value_contents_raw (v).data (), buf->data (), buf->size ());
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -1065,7 +1065,7 @@ v850_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
len = TYPE_LENGTH (value_type (*args));
|
len = TYPE_LENGTH (value_type (*args));
|
||||||
val = (gdb_byte *) value_contents (*args);
|
val = (gdb_byte *) value_contents (*args).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gdbarch_tdep (gdbarch)->eight_byte_align
|
if (gdbarch_tdep (gdbarch)->eight_byte_align
|
||||||
|
|
|
@ -716,7 +716,7 @@ value_concat (struct value *arg1, struct value *arg2)
|
||||||
char_type = type2;
|
char_type = type2;
|
||||||
|
|
||||||
inchar = (char) unpack_long (type2,
|
inchar = (char) unpack_long (type2,
|
||||||
value_contents (inval2));
|
value_contents (inval2).data ());
|
||||||
for (idx = 0; idx < count; idx++)
|
for (idx = 0; idx < count; idx++)
|
||||||
{
|
{
|
||||||
ptr[idx] = inchar;
|
ptr[idx] = inchar;
|
||||||
|
@ -727,11 +727,9 @@ value_concat (struct value *arg1, struct value *arg2)
|
||||||
char_type = TYPE_TARGET_TYPE (type2);
|
char_type = TYPE_TARGET_TYPE (type2);
|
||||||
|
|
||||||
for (idx = 0; idx < count; idx++)
|
for (idx = 0; idx < count; idx++)
|
||||||
{
|
memcpy (&ptr[idx * inval2len], value_contents (inval2).data (),
|
||||||
memcpy (&ptr[idx * inval2len], value_contents (inval2),
|
|
||||||
inval2len);
|
inval2len);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
outval = value_string (ptr.data (), count * inval2len, char_type);
|
outval = value_string (ptr.data (), count * inval2len, char_type);
|
||||||
}
|
}
|
||||||
else if (type2->code () == TYPE_CODE_BOOL)
|
else if (type2->code () == TYPE_CODE_BOOL)
|
||||||
|
@ -759,22 +757,22 @@ value_concat (struct value *arg1, struct value *arg2)
|
||||||
{
|
{
|
||||||
char_type = type1;
|
char_type = type1;
|
||||||
|
|
||||||
ptr[0] = (char) unpack_long (type1, value_contents (inval1));
|
ptr[0] = (char) unpack_long (type1, value_contents (inval1).data ());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char_type = TYPE_TARGET_TYPE (type1);
|
char_type = TYPE_TARGET_TYPE (type1);
|
||||||
|
|
||||||
memcpy (ptr.data (), value_contents (inval1), inval1len);
|
memcpy (ptr.data (), value_contents (inval1).data (), inval1len);
|
||||||
}
|
}
|
||||||
if (type2->code () == TYPE_CODE_CHAR)
|
if (type2->code () == TYPE_CODE_CHAR)
|
||||||
{
|
{
|
||||||
ptr[inval1len] =
|
ptr[inval1len] =
|
||||||
(char) unpack_long (type2, value_contents (inval2));
|
(char) unpack_long (type2, value_contents (inval2).data ());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
memcpy (&ptr[inval1len], value_contents (inval2), inval2len);
|
memcpy (&ptr[inval1len], value_contents (inval2).data (), inval2len);
|
||||||
}
|
}
|
||||||
outval = value_string (ptr.data (), inval1len + inval2len, char_type);
|
outval = value_string (ptr.data (), inval1len + inval2len, char_type);
|
||||||
}
|
}
|
||||||
|
@ -855,7 +853,7 @@ value_args_as_target_float (struct value *arg1, struct value *arg2,
|
||||||
if (is_floating_type (type1))
|
if (is_floating_type (type1))
|
||||||
{
|
{
|
||||||
*eff_type_x = type1;
|
*eff_type_x = type1;
|
||||||
memcpy (x, value_contents (arg1), TYPE_LENGTH (type1));
|
memcpy (x, value_contents (arg1).data (), TYPE_LENGTH (type1));
|
||||||
}
|
}
|
||||||
else if (is_integral_type (type1))
|
else if (is_integral_type (type1))
|
||||||
{
|
{
|
||||||
|
@ -874,7 +872,7 @@ value_args_as_target_float (struct value *arg1, struct value *arg2,
|
||||||
if (is_floating_type (type2))
|
if (is_floating_type (type2))
|
||||||
{
|
{
|
||||||
*eff_type_y = type2;
|
*eff_type_y = type2;
|
||||||
memcpy (y, value_contents (arg2), TYPE_LENGTH (type2));
|
memcpy (y, value_contents (arg2).data (), TYPE_LENGTH (type2));
|
||||||
}
|
}
|
||||||
else if (is_integral_type (type2))
|
else if (is_integral_type (type2))
|
||||||
{
|
{
|
||||||
|
@ -929,11 +927,11 @@ fixed_point_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||||
type2 = type1;
|
type2 = type1;
|
||||||
}
|
}
|
||||||
|
|
||||||
v1.read_fixed_point (gdb::make_array_view (value_contents (arg1),
|
v1.read_fixed_point (gdb::make_array_view (value_contents (arg1).data (),
|
||||||
TYPE_LENGTH (type1)),
|
TYPE_LENGTH (type1)),
|
||||||
type_byte_order (type1), type1->is_unsigned (),
|
type_byte_order (type1), type1->is_unsigned (),
|
||||||
type1->fixed_point_scaling_factor ());
|
type1->fixed_point_scaling_factor ());
|
||||||
v2.read_fixed_point (gdb::make_array_view (value_contents (arg2),
|
v2.read_fixed_point (gdb::make_array_view (value_contents (arg2).data (),
|
||||||
TYPE_LENGTH (type2)),
|
TYPE_LENGTH (type2)),
|
||||||
type_byte_order (type2), type2->is_unsigned (),
|
type_byte_order (type2), type2->is_unsigned (),
|
||||||
type2->fixed_point_scaling_factor ());
|
type2->fixed_point_scaling_factor ());
|
||||||
|
@ -944,7 +942,7 @@ fixed_point_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||||
value *fp_val = allocate_value (type1);
|
value *fp_val = allocate_value (type1);
|
||||||
|
|
||||||
fp.write_fixed_point
|
fp.write_fixed_point
|
||||||
(gdb::make_array_view (value_contents_raw (fp_val),
|
(gdb::make_array_view (value_contents_raw (fp_val).data (),
|
||||||
TYPE_LENGTH (type1)),
|
TYPE_LENGTH (type1)),
|
||||||
type_byte_order (type1),
|
type_byte_order (type1),
|
||||||
type1->is_unsigned (),
|
type1->is_unsigned (),
|
||||||
|
@ -1204,7 +1202,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||||
v2.data (), &eff_type_v2);
|
v2.data (), &eff_type_v2);
|
||||||
target_float_binop (op, v1.data (), eff_type_v1,
|
target_float_binop (op, v1.data (), eff_type_v1,
|
||||||
v2.data (), eff_type_v2,
|
v2.data (), eff_type_v2,
|
||||||
value_contents_raw (val), result_type);
|
value_contents_raw (val).data (), result_type);
|
||||||
}
|
}
|
||||||
else if (type1->code () == TYPE_CODE_BOOL
|
else if (type1->code () == TYPE_CODE_BOOL
|
||||||
|| type2->code () == TYPE_CODE_BOOL)
|
|| type2->code () == TYPE_CODE_BOOL)
|
||||||
|
@ -1243,7 +1241,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||||
result_type = type1;
|
result_type = type1;
|
||||||
|
|
||||||
val = allocate_value (result_type);
|
val = allocate_value (result_type);
|
||||||
store_signed_integer (value_contents_raw (val),
|
store_signed_integer (value_contents_raw (val).data (),
|
||||||
TYPE_LENGTH (result_type),
|
TYPE_LENGTH (result_type),
|
||||||
type_byte_order (result_type),
|
type_byte_order (result_type),
|
||||||
v);
|
v);
|
||||||
|
@ -1383,7 +1381,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||||
}
|
}
|
||||||
|
|
||||||
val = allocate_value (result_type);
|
val = allocate_value (result_type);
|
||||||
store_unsigned_integer (value_contents_raw (val),
|
store_unsigned_integer (value_contents_raw (val).data (),
|
||||||
TYPE_LENGTH (value_type (val)),
|
TYPE_LENGTH (value_type (val)),
|
||||||
type_byte_order (result_type),
|
type_byte_order (result_type),
|
||||||
v);
|
v);
|
||||||
|
@ -1512,7 +1510,7 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
|
||||||
}
|
}
|
||||||
|
|
||||||
val = allocate_value (result_type);
|
val = allocate_value (result_type);
|
||||||
store_signed_integer (value_contents_raw (val),
|
store_signed_integer (value_contents_raw (val).data (),
|
||||||
TYPE_LENGTH (value_type (val)),
|
TYPE_LENGTH (value_type (val)),
|
||||||
type_byte_order (result_type),
|
type_byte_order (result_type),
|
||||||
v);
|
v);
|
||||||
|
@ -1559,8 +1557,8 @@ value_vector_widen (struct value *scalar_value, struct type *vector_type)
|
||||||
val = allocate_value (vector_type);
|
val = allocate_value (vector_type);
|
||||||
for (i = 0; i < high_bound - low_bound + 1; i++)
|
for (i = 0; i < high_bound - low_bound + 1; i++)
|
||||||
/* Duplicate the contents of elval into the destination vector. */
|
/* Duplicate the contents of elval into the destination vector. */
|
||||||
memcpy (value_contents_writeable (val) + (i * TYPE_LENGTH (eltype)),
|
memcpy (value_contents_writeable (val).data () + (i * TYPE_LENGTH (eltype)),
|
||||||
value_contents_all (elval), TYPE_LENGTH (eltype));
|
value_contents_all (elval).data (), TYPE_LENGTH (eltype));
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -1607,8 +1605,8 @@ vector_binop (struct value *val1, struct value *val2, enum exp_opcode op)
|
||||||
{
|
{
|
||||||
tmp = value_binop (value_subscript (val1, i),
|
tmp = value_binop (value_subscript (val1, i),
|
||||||
value_subscript (val2, i), op);
|
value_subscript (val2, i), op);
|
||||||
memcpy (value_contents_writeable (val) + i * elsize,
|
memcpy (value_contents_writeable (val).data () + i * elsize,
|
||||||
value_contents_all (tmp),
|
value_contents_all (tmp).data (),
|
||||||
elsize);
|
elsize);
|
||||||
}
|
}
|
||||||
value_free_to_mark (mark);
|
value_free_to_mark (mark);
|
||||||
|
@ -1666,10 +1664,10 @@ value_logical_not (struct value *arg1)
|
||||||
type1 = check_typedef (value_type (arg1));
|
type1 = check_typedef (value_type (arg1));
|
||||||
|
|
||||||
if (is_floating_value (arg1))
|
if (is_floating_value (arg1))
|
||||||
return target_float_is_zero (value_contents (arg1), type1);
|
return target_float_is_zero (value_contents (arg1).data (), type1);
|
||||||
|
|
||||||
len = TYPE_LENGTH (type1);
|
len = TYPE_LENGTH (type1);
|
||||||
p = value_contents (arg1);
|
p = value_contents (arg1).data ();
|
||||||
|
|
||||||
while (--len >= 0)
|
while (--len >= 0)
|
||||||
{
|
{
|
||||||
|
@ -1688,8 +1686,8 @@ value_strcmp (struct value *arg1, struct value *arg2)
|
||||||
{
|
{
|
||||||
int len1 = TYPE_LENGTH (value_type (arg1));
|
int len1 = TYPE_LENGTH (value_type (arg1));
|
||||||
int len2 = TYPE_LENGTH (value_type (arg2));
|
int len2 = TYPE_LENGTH (value_type (arg2));
|
||||||
const gdb_byte *s1 = value_contents (arg1);
|
const gdb_byte *s1 = value_contents (arg1).data ();
|
||||||
const gdb_byte *s2 = value_contents (arg2);
|
const gdb_byte *s2 = value_contents (arg2).data ();
|
||||||
int i, len = len1 < len2 ? len1 : len2;
|
int i, len = len1 < len2 ? len1 : len2;
|
||||||
|
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
|
@ -1764,8 +1762,8 @@ value_equal (struct value *arg1, struct value *arg2)
|
||||||
&& ((len = (int) TYPE_LENGTH (type1))
|
&& ((len = (int) TYPE_LENGTH (type1))
|
||||||
== (int) TYPE_LENGTH (type2)))
|
== (int) TYPE_LENGTH (type2)))
|
||||||
{
|
{
|
||||||
p1 = value_contents (arg1);
|
p1 = value_contents (arg1).data ();
|
||||||
p2 = value_contents (arg2);
|
p2 = value_contents (arg2).data ();
|
||||||
while (--len >= 0)
|
while (--len >= 0)
|
||||||
{
|
{
|
||||||
if (*p1++ != *p2++)
|
if (*p1++ != *p2++)
|
||||||
|
@ -1795,7 +1793,8 @@ value_equal_contents (struct value *arg1, struct value *arg2)
|
||||||
|
|
||||||
return (type1->code () == type2->code ()
|
return (type1->code () == type2->code ()
|
||||||
&& TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
|
&& TYPE_LENGTH (type1) == TYPE_LENGTH (type2)
|
||||||
&& memcmp (value_contents (arg1), value_contents (arg2),
|
&& memcmp (value_contents (arg1).data (),
|
||||||
|
value_contents (arg2).data (),
|
||||||
TYPE_LENGTH (type1)) == 0);
|
TYPE_LENGTH (type1)) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1870,7 +1869,7 @@ value_pos (struct value *arg1)
|
||||||
if (is_integral_type (type) || is_floating_value (arg1)
|
if (is_integral_type (type) || is_floating_value (arg1)
|
||||||
|| (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
|
|| (type->code () == TYPE_CODE_ARRAY && type->is_vector ())
|
||||||
|| type->code () == TYPE_CODE_COMPLEX)
|
|| type->code () == TYPE_CODE_COMPLEX)
|
||||||
return value_from_contents (type, value_contents (arg1));
|
return value_from_contents (type, value_contents (arg1).data ());
|
||||||
else
|
else
|
||||||
error (_("Argument to positive operation not a number."));
|
error (_("Argument to positive operation not a number."));
|
||||||
}
|
}
|
||||||
|
@ -1900,8 +1899,9 @@ value_neg (struct value *arg1)
|
||||||
for (i = 0; i < high_bound - low_bound + 1; i++)
|
for (i = 0; i < high_bound - low_bound + 1; i++)
|
||||||
{
|
{
|
||||||
tmp = value_neg (value_subscript (arg1, i));
|
tmp = value_neg (value_subscript (arg1, i));
|
||||||
memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
|
memcpy ((value_contents_writeable (val).data ()
|
||||||
value_contents_all (tmp), TYPE_LENGTH (eltype));
|
+ i * TYPE_LENGTH (eltype)),
|
||||||
|
value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
|
||||||
}
|
}
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -1943,8 +1943,9 @@ value_complement (struct value *arg1)
|
||||||
for (i = 0; i < high_bound - low_bound + 1; i++)
|
for (i = 0; i < high_bound - low_bound + 1; i++)
|
||||||
{
|
{
|
||||||
tmp = value_complement (value_subscript (arg1, i));
|
tmp = value_complement (value_subscript (arg1, i));
|
||||||
memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
|
memcpy ((value_contents_writeable (val).data ()
|
||||||
value_contents_all (tmp), TYPE_LENGTH (eltype));
|
+ i * TYPE_LENGTH (eltype)),
|
||||||
|
value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (type->code () == TYPE_CODE_COMPLEX)
|
else if (type->code () == TYPE_CODE_COMPLEX)
|
||||||
|
@ -2005,7 +2006,7 @@ value_in (struct value *element, struct value *set)
|
||||||
&& eltype->code () != TYPE_CODE_ENUM
|
&& eltype->code () != TYPE_CODE_ENUM
|
||||||
&& eltype->code () != TYPE_CODE_BOOL)
|
&& eltype->code () != TYPE_CODE_BOOL)
|
||||||
error (_("First argument of 'IN' has wrong type"));
|
error (_("First argument of 'IN' has wrong type"));
|
||||||
member = value_bit_index (settype, value_contents (set),
|
member = value_bit_index (settype, value_contents (set).data (),
|
||||||
value_as_long (element));
|
value_as_long (element));
|
||||||
if (member < 0)
|
if (member < 0)
|
||||||
error (_("First argument of 'IN' not in range"));
|
error (_("First argument of 'IN' not in range"));
|
||||||
|
|
79
gdb/valops.c
79
gdb/valops.c
|
@ -341,7 +341,7 @@ value_to_gdb_mpq (struct value *value)
|
||||||
gdb_mpq result;
|
gdb_mpq result;
|
||||||
if (is_floating_type (type))
|
if (is_floating_type (type))
|
||||||
{
|
{
|
||||||
double d = target_float_to_host_double (value_contents (value),
|
double d = target_float_to_host_double (value_contents (value).data (),
|
||||||
type);
|
type);
|
||||||
mpq_set_d (result.val, d);
|
mpq_set_d (result.val, d);
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@ value_to_gdb_mpq (struct value *value)
|
||||||
|| is_fixed_point_type (type));
|
|| is_fixed_point_type (type));
|
||||||
|
|
||||||
gdb_mpz vz;
|
gdb_mpz vz;
|
||||||
vz.read (gdb::make_array_view (value_contents (value),
|
vz.read (gdb::make_array_view (value_contents (value).data (),
|
||||||
TYPE_LENGTH (type)),
|
TYPE_LENGTH (type)),
|
||||||
type_byte_order (type), type->is_unsigned ());
|
type_byte_order (type), type->is_unsigned ());
|
||||||
mpq_set_z (result.val, vz.val);
|
mpq_set_z (result.val, vz.val);
|
||||||
|
@ -392,7 +392,7 @@ value_cast_to_fixed_point (struct type *to_type, struct value *from_val)
|
||||||
/* Finally, create the result value, and pack the unscaled value
|
/* Finally, create the result value, and pack the unscaled value
|
||||||
in it. */
|
in it. */
|
||||||
struct value *result = allocate_value (to_type);
|
struct value *result = allocate_value (to_type);
|
||||||
unscaled.write (gdb::make_array_view (value_contents_raw (result),
|
unscaled.write (gdb::make_array_view (value_contents_raw (result).data (),
|
||||||
TYPE_LENGTH (to_type)),
|
TYPE_LENGTH (to_type)),
|
||||||
type_byte_order (to_type),
|
type_byte_order (to_type),
|
||||||
to_type->is_unsigned ());
|
to_type->is_unsigned ());
|
||||||
|
@ -546,8 +546,8 @@ value_cast (struct type *type, struct value *arg2)
|
||||||
if (is_floating_value (arg2))
|
if (is_floating_value (arg2))
|
||||||
{
|
{
|
||||||
struct value *v = allocate_value (to_type);
|
struct value *v = allocate_value (to_type);
|
||||||
target_float_convert (value_contents (arg2), type2,
|
target_float_convert (value_contents (arg2).data (), type2,
|
||||||
value_contents_raw (v), type);
|
value_contents_raw (v).data (), type);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
else if (is_fixed_point_type (type2))
|
else if (is_fixed_point_type (type2))
|
||||||
|
@ -555,12 +555,13 @@ value_cast (struct type *type, struct value *arg2)
|
||||||
gdb_mpq fp_val;
|
gdb_mpq fp_val;
|
||||||
|
|
||||||
fp_val.read_fixed_point
|
fp_val.read_fixed_point
|
||||||
(gdb::make_array_view (value_contents (arg2), TYPE_LENGTH (type2)),
|
(gdb::make_array_view (value_contents (arg2).data (),
|
||||||
|
TYPE_LENGTH (type2)),
|
||||||
type_byte_order (type2), type2->is_unsigned (),
|
type_byte_order (type2), type2->is_unsigned (),
|
||||||
type2->fixed_point_scaling_factor ());
|
type2->fixed_point_scaling_factor ());
|
||||||
|
|
||||||
struct value *v = allocate_value (to_type);
|
struct value *v = allocate_value (to_type);
|
||||||
target_float_from_host_double (value_contents_raw (v),
|
target_float_from_host_double (value_contents_raw (v).data (),
|
||||||
to_type, mpq_get_d (fp_val.val));
|
to_type, mpq_get_d (fp_val.val));
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
@ -586,7 +587,7 @@ value_cast (struct type *type, struct value *arg2)
|
||||||
bits. */
|
bits. */
|
||||||
if (code2 == TYPE_CODE_PTR)
|
if (code2 == TYPE_CODE_PTR)
|
||||||
longest = extract_unsigned_integer
|
longest = extract_unsigned_integer
|
||||||
(value_contents (arg2), TYPE_LENGTH (type2),
|
(value_contents (arg2).data (), TYPE_LENGTH (type2),
|
||||||
type_byte_order (type2));
|
type_byte_order (type2));
|
||||||
else
|
else
|
||||||
longest = value_as_long (arg2);
|
longest = value_as_long (arg2);
|
||||||
|
@ -623,7 +624,8 @@ value_cast (struct type *type, struct value *arg2)
|
||||||
{
|
{
|
||||||
struct value *result = allocate_value (to_type);
|
struct value *result = allocate_value (to_type);
|
||||||
|
|
||||||
cplus_make_method_ptr (to_type, value_contents_writeable (result), 0, 0);
|
cplus_make_method_ptr (to_type,
|
||||||
|
value_contents_writeable (result).data (), 0, 0);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
else if (code1 == TYPE_CODE_MEMBERPTR && code2 == TYPE_CODE_INT
|
else if (code1 == TYPE_CODE_MEMBERPTR && code2 == TYPE_CODE_INT
|
||||||
|
@ -904,7 +906,7 @@ value_dynamic_cast (struct type *type, struct value *arg)
|
||||||
return tem;
|
return tem;
|
||||||
result = NULL;
|
result = NULL;
|
||||||
if (dynamic_cast_check_1 (TYPE_TARGET_TYPE (resolved_type),
|
if (dynamic_cast_check_1 (TYPE_TARGET_TYPE (resolved_type),
|
||||||
value_contents_for_printing (tem),
|
value_contents_for_printing (tem).data (),
|
||||||
value_embedded_offset (tem),
|
value_embedded_offset (tem),
|
||||||
value_address (tem), tem,
|
value_address (tem), tem,
|
||||||
rtti_type, addr,
|
rtti_type, addr,
|
||||||
|
@ -920,7 +922,7 @@ value_dynamic_cast (struct type *type, struct value *arg)
|
||||||
result = NULL;
|
result = NULL;
|
||||||
if (is_public_ancestor (arg_type, rtti_type)
|
if (is_public_ancestor (arg_type, rtti_type)
|
||||||
&& dynamic_cast_check_2 (TYPE_TARGET_TYPE (resolved_type),
|
&& dynamic_cast_check_2 (TYPE_TARGET_TYPE (resolved_type),
|
||||||
value_contents_for_printing (tem),
|
value_contents_for_printing (tem).data (),
|
||||||
value_embedded_offset (tem),
|
value_embedded_offset (tem),
|
||||||
value_address (tem), tem,
|
value_address (tem), tem,
|
||||||
rtti_type, &result) == 1)
|
rtti_type, &result) == 1)
|
||||||
|
@ -961,8 +963,9 @@ value_one (struct type *type)
|
||||||
for (i = 0; i < high_bound - low_bound + 1; i++)
|
for (i = 0; i < high_bound - low_bound + 1; i++)
|
||||||
{
|
{
|
||||||
tmp = value_one (eltype);
|
tmp = value_one (eltype);
|
||||||
memcpy (value_contents_writeable (val) + i * TYPE_LENGTH (eltype),
|
memcpy ((value_contents_writeable (val).data ()
|
||||||
value_contents_all (tmp), TYPE_LENGTH (eltype));
|
+ i * TYPE_LENGTH (eltype)),
|
||||||
|
value_contents_all (tmp).data (), TYPE_LENGTH (eltype));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1173,7 +1176,7 @@ value_assign (struct value *toval, struct value *fromval)
|
||||||
{
|
{
|
||||||
changed_addr = value_address (toval);
|
changed_addr = value_address (toval);
|
||||||
changed_len = type_length_units (type);
|
changed_len = type_length_units (type);
|
||||||
dest_buffer = value_contents (fromval);
|
dest_buffer = value_contents (fromval).data ();
|
||||||
}
|
}
|
||||||
|
|
||||||
write_memory_with_notification (changed_addr, dest_buffer, changed_len);
|
write_memory_with_notification (changed_addr, dest_buffer, changed_len);
|
||||||
|
@ -1249,12 +1252,12 @@ value_assign (struct value *toval, struct value *fromval)
|
||||||
format. */
|
format. */
|
||||||
gdbarch_value_to_register (gdbarch, frame,
|
gdbarch_value_to_register (gdbarch, frame,
|
||||||
VALUE_REGNUM (toval), type,
|
VALUE_REGNUM (toval), type,
|
||||||
value_contents (fromval));
|
value_contents (fromval).data ());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gdb::array_view<const gdb_byte> contents
|
gdb::array_view<const gdb_byte> contents
|
||||||
= gdb::make_array_view (value_contents (fromval),
|
= gdb::make_array_view (value_contents (fromval).data (),
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
put_frame_register_bytes (frame, value_reg,
|
put_frame_register_bytes (frame, value_reg,
|
||||||
value_offset (toval),
|
value_offset (toval),
|
||||||
|
@ -1339,7 +1342,7 @@ value_assign (struct value *toval, struct value *fromval)
|
||||||
implies the returned value is not lazy, even if TOVAL was. */
|
implies the returned value is not lazy, even if TOVAL was. */
|
||||||
val = value_copy (toval);
|
val = value_copy (toval);
|
||||||
set_value_lazy (val, 0);
|
set_value_lazy (val, 0);
|
||||||
memcpy (value_contents_raw (val), value_contents (fromval),
|
memcpy (value_contents_raw (val).data (), value_contents (fromval).data (),
|
||||||
TYPE_LENGTH (type));
|
TYPE_LENGTH (type));
|
||||||
|
|
||||||
/* We copy over the enclosing type and pointed-to offset from FROMVAL
|
/* We copy over the enclosing type and pointed-to offset from FROMVAL
|
||||||
|
@ -1373,7 +1376,7 @@ value_repeat (struct value *arg1, int count)
|
||||||
set_value_address (val, value_address (arg1));
|
set_value_address (val, value_address (arg1));
|
||||||
|
|
||||||
read_value_memory (val, 0, value_stack (val), value_address (val),
|
read_value_memory (val, 0, value_stack (val), value_address (val),
|
||||||
value_contents_all_raw (val),
|
value_contents_all_raw (val).data (),
|
||||||
type_length_units (value_enclosing_type (val)));
|
type_length_units (value_enclosing_type (val)));
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
|
@ -1481,7 +1484,7 @@ value_coerce_to_target (struct value *val)
|
||||||
|
|
||||||
length = TYPE_LENGTH (check_typedef (value_type (val)));
|
length = TYPE_LENGTH (check_typedef (value_type (val)));
|
||||||
addr = allocate_space_in_inferior (length);
|
addr = allocate_space_in_inferior (length);
|
||||||
write_memory (addr, value_contents (val), length);
|
write_memory (addr, value_contents (val).data (), length);
|
||||||
return value_at_lazy (value_type (val), addr);
|
return value_at_lazy (value_type (val), addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1747,7 +1750,7 @@ value_cstring (const char *ptr, ssize_t len, struct type *char_type)
|
||||||
= lookup_array_range_type (char_type, lowbound, highbound + lowbound - 1);
|
= lookup_array_range_type (char_type, lowbound, highbound + lowbound - 1);
|
||||||
|
|
||||||
val = allocate_value (stringtype);
|
val = allocate_value (stringtype);
|
||||||
memcpy (value_contents_raw (val), ptr, len);
|
memcpy (value_contents_raw (val).data (), ptr, len);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1770,7 +1773,7 @@ value_string (const char *ptr, ssize_t len, struct type *char_type)
|
||||||
= lookup_string_range_type (char_type, lowbound, highbound + lowbound - 1);
|
= lookup_string_range_type (char_type, lowbound, highbound + lowbound - 1);
|
||||||
|
|
||||||
val = allocate_value (stringtype);
|
val = allocate_value (stringtype);
|
||||||
memcpy (value_contents_raw (val), ptr, len);
|
memcpy (value_contents_raw (val).data (), ptr, len);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2054,7 +2057,7 @@ struct_field_searcher::search (struct value *arg1, LONGEST offset,
|
||||||
struct value *v2;
|
struct value *v2;
|
||||||
|
|
||||||
boffset = baseclass_offset (type, i,
|
boffset = baseclass_offset (type, i,
|
||||||
value_contents_for_printing (arg1),
|
value_contents_for_printing (arg1).data (),
|
||||||
value_embedded_offset (arg1) + offset,
|
value_embedded_offset (arg1) + offset,
|
||||||
value_address (arg1),
|
value_address (arg1),
|
||||||
arg1);
|
arg1);
|
||||||
|
@ -2072,7 +2075,7 @@ struct_field_searcher::search (struct value *arg1, LONGEST offset,
|
||||||
base_addr = value_address (arg1) + boffset;
|
base_addr = value_address (arg1) + boffset;
|
||||||
v2 = value_at_lazy (basetype, base_addr);
|
v2 = value_at_lazy (basetype, base_addr);
|
||||||
if (target_read_memory (base_addr,
|
if (target_read_memory (base_addr,
|
||||||
value_contents_raw (v2),
|
value_contents_raw (v2).data (),
|
||||||
TYPE_LENGTH (value_type (v2))) != 0)
|
TYPE_LENGTH (value_type (v2))) != 0)
|
||||||
error (_("virtual baseclass botch"));
|
error (_("virtual baseclass botch"));
|
||||||
}
|
}
|
||||||
|
@ -2258,13 +2261,13 @@ search_struct_method (const char *name, struct value **arg1p,
|
||||||
base_val = value_from_contents_and_address (baseclass,
|
base_val = value_from_contents_and_address (baseclass,
|
||||||
tmp.data (),
|
tmp.data (),
|
||||||
address + offset);
|
address + offset);
|
||||||
base_valaddr = value_contents_for_printing (base_val);
|
base_valaddr = value_contents_for_printing (base_val).data ();
|
||||||
this_offset = 0;
|
this_offset = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
base_val = *arg1p;
|
base_val = *arg1p;
|
||||||
base_valaddr = value_contents_for_printing (*arg1p);
|
base_valaddr = value_contents_for_printing (*arg1p).data ();
|
||||||
this_offset = offset;
|
this_offset = offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2520,7 +2523,7 @@ find_method_list (struct value **argp, const char *method,
|
||||||
if (BASETYPE_VIA_VIRTUAL (type, i))
|
if (BASETYPE_VIA_VIRTUAL (type, i))
|
||||||
{
|
{
|
||||||
base_offset = baseclass_offset (type, i,
|
base_offset = baseclass_offset (type, i,
|
||||||
value_contents_for_printing (*argp),
|
value_contents_for_printing (*argp).data (),
|
||||||
value_offset (*argp) + offset,
|
value_offset (*argp) + offset,
|
||||||
value_address (*argp), *argp);
|
value_address (*argp), *argp);
|
||||||
}
|
}
|
||||||
|
@ -3448,7 +3451,7 @@ get_baseclass_offset (struct type *vt, struct type *cls,
|
||||||
{
|
{
|
||||||
if (BASETYPE_VIA_VIRTUAL (vt, i))
|
if (BASETYPE_VIA_VIRTUAL (vt, i))
|
||||||
{
|
{
|
||||||
const gdb_byte *adr = value_contents_for_printing (v);
|
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, value_offset (v),
|
||||||
value_as_long (v), v);
|
value_as_long (v), v);
|
||||||
*isvirt = true;
|
*isvirt = true;
|
||||||
|
@ -3462,7 +3465,7 @@ get_baseclass_offset (struct type *vt, struct type *cls,
|
||||||
{
|
{
|
||||||
if (*isvirt == false) /* Add non-virtual base offset. */
|
if (*isvirt == false) /* Add non-virtual base offset. */
|
||||||
{
|
{
|
||||||
const gdb_byte *adr = value_contents_for_printing (v);
|
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, value_offset (v),
|
||||||
value_as_long (v), v);
|
value_as_long (v), v);
|
||||||
}
|
}
|
||||||
|
@ -3659,7 +3662,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
|
||||||
result = allocate_value
|
result = allocate_value
|
||||||
(lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
|
(lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
|
||||||
cplus_make_method_ptr (value_type (result),
|
cplus_make_method_ptr (value_type (result),
|
||||||
value_contents_writeable (result),
|
value_contents_writeable (result).data (),
|
||||||
TYPE_FN_FIELD_VOFFSET (f, j), 1);
|
TYPE_FN_FIELD_VOFFSET (f, j), 1);
|
||||||
}
|
}
|
||||||
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
|
else if (noside == EVAL_AVOID_SIDE_EFFECTS)
|
||||||
|
@ -3684,7 +3687,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
|
||||||
{
|
{
|
||||||
result = allocate_value (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
|
result = allocate_value (lookup_methodptr_type (TYPE_FN_FIELD_TYPE (f, j)));
|
||||||
cplus_make_method_ptr (value_type (result),
|
cplus_make_method_ptr (value_type (result),
|
||||||
value_contents_writeable (result),
|
value_contents_writeable (result).data (),
|
||||||
value_address (v), 0);
|
value_address (v), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4027,10 +4030,10 @@ value_literal_complex (struct value *arg1,
|
||||||
arg1 = value_cast (real_type, arg1);
|
arg1 = value_cast (real_type, arg1);
|
||||||
arg2 = value_cast (real_type, arg2);
|
arg2 = value_cast (real_type, arg2);
|
||||||
|
|
||||||
memcpy (value_contents_raw (val),
|
memcpy (value_contents_raw (val).data (),
|
||||||
value_contents (arg1), TYPE_LENGTH (real_type));
|
value_contents (arg1).data (), TYPE_LENGTH (real_type));
|
||||||
memcpy (value_contents_raw (val) + TYPE_LENGTH (real_type),
|
memcpy (value_contents_raw (val).data () + TYPE_LENGTH (real_type),
|
||||||
value_contents (arg2), TYPE_LENGTH (real_type));
|
value_contents (arg2).data (), TYPE_LENGTH (real_type));
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4072,10 +4075,10 @@ cast_into_complex (struct type *type, struct value *val)
|
||||||
struct value *re_val = allocate_value (val_real_type);
|
struct value *re_val = allocate_value (val_real_type);
|
||||||
struct value *im_val = allocate_value (val_real_type);
|
struct value *im_val = allocate_value (val_real_type);
|
||||||
|
|
||||||
memcpy (value_contents_raw (re_val),
|
memcpy (value_contents_raw (re_val).data (),
|
||||||
value_contents (val), TYPE_LENGTH (val_real_type));
|
value_contents (val).data (), TYPE_LENGTH (val_real_type));
|
||||||
memcpy (value_contents_raw (im_val),
|
memcpy (value_contents_raw (im_val).data (),
|
||||||
value_contents (val) + TYPE_LENGTH (val_real_type),
|
value_contents (val).data () + TYPE_LENGTH (val_real_type),
|
||||||
TYPE_LENGTH (val_real_type));
|
TYPE_LENGTH (val_real_type));
|
||||||
|
|
||||||
return value_literal_complex (re_val, im_val, type);
|
return value_literal_complex (re_val, im_val, type);
|
||||||
|
|
|
@ -484,7 +484,7 @@ generic_value_print_ptr (struct value *val, struct ui_file *stream,
|
||||||
{
|
{
|
||||||
struct type *type = check_typedef (value_type (val));
|
struct type *type = check_typedef (value_type (val));
|
||||||
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
|
struct type *elttype = check_typedef (TYPE_TARGET_TYPE (type));
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
CORE_ADDR addr = unpack_pointer (type, valaddr);
|
CORE_ADDR addr = unpack_pointer (type, valaddr);
|
||||||
|
|
||||||
print_unpacked_pointer (type, elttype, addr, stream, options);
|
print_unpacked_pointer (type, elttype, addr, stream, options);
|
||||||
|
@ -520,7 +520,7 @@ get_value_addr_contents (struct value *deref_val)
|
||||||
gdb_assert (deref_val != NULL);
|
gdb_assert (deref_val != NULL);
|
||||||
|
|
||||||
if (value_lval_const (deref_val) == lval_memory)
|
if (value_lval_const (deref_val) == lval_memory)
|
||||||
return value_contents_for_printing_const (value_addr (deref_val));
|
return value_contents_for_printing_const (value_addr (deref_val)).data ();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* We have a non-addressable value, such as a DW_AT_const_value. */
|
/* We have a non-addressable value, such as a DW_AT_const_value. */
|
||||||
|
@ -545,7 +545,7 @@ generic_val_print_ref (struct type *type,
|
||||||
const int must_coerce_ref = ((options->addressprint && value_is_synthetic)
|
const int must_coerce_ref = ((options->addressprint && value_is_synthetic)
|
||||||
|| options->deref_ref);
|
|| options->deref_ref);
|
||||||
const int type_is_defined = elttype->code () != TYPE_CODE_UNDEF;
|
const int type_is_defined = elttype->code () != TYPE_CODE_UNDEF;
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (original_value);
|
const gdb_byte *valaddr = value_contents_for_printing (original_value).data ();
|
||||||
|
|
||||||
if (must_coerce_ref && type_is_defined)
|
if (must_coerce_ref && type_is_defined)
|
||||||
{
|
{
|
||||||
|
@ -693,7 +693,7 @@ generic_val_print_enum (struct type *type,
|
||||||
|
|
||||||
gdb_assert (!options->format);
|
gdb_assert (!options->format);
|
||||||
|
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (original_value);
|
const gdb_byte *valaddr = value_contents_for_printing (original_value).data ();
|
||||||
|
|
||||||
val = unpack_long (type, valaddr + embedded_offset * unit_size);
|
val = unpack_long (type, valaddr + embedded_offset * unit_size);
|
||||||
|
|
||||||
|
@ -740,7 +740,7 @@ generic_value_print_bool
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (value);
|
const gdb_byte *valaddr = value_contents_for_printing (value).data ();
|
||||||
struct type *type = check_typedef (value_type (value));
|
struct type *type = check_typedef (value_type (value));
|
||||||
LONGEST val = unpack_long (type, valaddr);
|
LONGEST val = unpack_long (type, valaddr);
|
||||||
if (val == 0)
|
if (val == 0)
|
||||||
|
@ -783,7 +783,7 @@ generic_value_print_char (struct value *value, struct ui_file *stream,
|
||||||
{
|
{
|
||||||
struct type *unresolved_type = value_type (value);
|
struct type *unresolved_type = value_type (value);
|
||||||
struct type *type = check_typedef (unresolved_type);
|
struct type *type = check_typedef (unresolved_type);
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (value);
|
const gdb_byte *valaddr = value_contents_for_printing (value).data ();
|
||||||
|
|
||||||
LONGEST val = unpack_long (type, valaddr);
|
LONGEST val = unpack_long (type, valaddr);
|
||||||
if (type->is_unsigned ())
|
if (type->is_unsigned ())
|
||||||
|
@ -804,7 +804,7 @@ generic_val_print_float (struct type *type, struct ui_file *stream,
|
||||||
{
|
{
|
||||||
gdb_assert (!options->format);
|
gdb_assert (!options->format);
|
||||||
|
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (original_value);
|
const gdb_byte *valaddr = value_contents_for_printing (original_value).data ();
|
||||||
|
|
||||||
print_floating (valaddr, type, stream);
|
print_floating (valaddr, type, stream);
|
||||||
}
|
}
|
||||||
|
@ -821,7 +821,7 @@ generic_val_print_fixed_point (struct value *val, struct ui_file *stream,
|
||||||
{
|
{
|
||||||
struct type *type = value_type (val);
|
struct type *type = value_type (val);
|
||||||
|
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
gdb_mpf f;
|
gdb_mpf f;
|
||||||
|
|
||||||
f.read_fixed_point (gdb::make_array_view (valaddr, TYPE_LENGTH (type)),
|
f.read_fixed_point (gdb::make_array_view (valaddr, TYPE_LENGTH (type)),
|
||||||
|
@ -867,7 +867,7 @@ generic_value_print_memberptr
|
||||||
/* Member pointers are essentially specific to C++, and so if we
|
/* Member pointers are essentially specific to C++, and so if we
|
||||||
encounter one, we should print it according to C++ rules. */
|
encounter one, we should print it according to C++ rules. */
|
||||||
struct type *type = check_typedef (value_type (val));
|
struct type *type = check_typedef (value_type (val));
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
cp_print_class_member (valaddr, type, stream, "&");
|
cp_print_class_member (valaddr, type, stream, "&");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -977,7 +977,7 @@ generic_value_print (struct value *val, struct ui_file *stream, int recurse,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TYPE_CODE_METHODPTR:
|
case TYPE_CODE_METHODPTR:
|
||||||
cplus_print_method_ptr (value_contents_for_printing (val), type,
|
cplus_print_method_ptr (value_contents_for_printing (val).data (), type,
|
||||||
stream);
|
stream);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1193,7 +1193,7 @@ static void
|
||||||
val_print_type_code_flags (struct type *type, struct value *original_value,
|
val_print_type_code_flags (struct type *type, struct value *original_value,
|
||||||
int embedded_offset, struct ui_file *stream)
|
int embedded_offset, struct ui_file *stream)
|
||||||
{
|
{
|
||||||
const gdb_byte *valaddr = (value_contents_for_printing (original_value)
|
const gdb_byte *valaddr = (value_contents_for_printing (original_value).data ()
|
||||||
+ embedded_offset);
|
+ embedded_offset);
|
||||||
ULONGEST val = unpack_long (type, valaddr);
|
ULONGEST val = unpack_long (type, valaddr);
|
||||||
int field, nfields = type->num_fields ();
|
int field, nfields = type->num_fields ();
|
||||||
|
@ -1267,7 +1267,7 @@ value_print_scalar_formatted (struct value *val,
|
||||||
/* value_contents_for_printing fetches all VAL's contents. They are
|
/* value_contents_for_printing fetches all VAL's contents. They are
|
||||||
needed to check whether VAL is optimized-out or unavailable
|
needed to check whether VAL is optimized-out or unavailable
|
||||||
below. */
|
below. */
|
||||||
const gdb_byte *valaddr = value_contents_for_printing (val);
|
const gdb_byte *valaddr = value_contents_for_printing (val).data ();
|
||||||
|
|
||||||
/* A scalar object that does not have all bits available can't be
|
/* A scalar object that does not have all bits available can't be
|
||||||
printed, because all bits contribute to its representation. */
|
printed, because all bits contribute to its representation. */
|
||||||
|
@ -3155,7 +3155,7 @@ test_print_flags (gdbarch *arch)
|
||||||
append_flags_type_field (flags_type, 5, 3, field_type, "C");
|
append_flags_type_field (flags_type, 5, 3, field_type, "C");
|
||||||
|
|
||||||
value *val = allocate_value (flags_type);
|
value *val = allocate_value (flags_type);
|
||||||
gdb_byte *contents = value_contents_writeable (val);
|
gdb_byte *contents = value_contents_writeable (val).data ();
|
||||||
store_unsigned_integer (contents, 4, gdbarch_byte_order (arch), 0xaa);
|
store_unsigned_integer (contents, 4, gdbarch_byte_order (arch), 0xaa);
|
||||||
|
|
||||||
string_file out;
|
string_file out;
|
||||||
|
|
80
gdb/value.c
80
gdb/value.c
|
@ -1146,21 +1146,25 @@ set_value_parent (struct value *value, struct value *parent)
|
||||||
value->parent = value_ref_ptr::new_reference (parent);
|
value->parent = value_ref_ptr::new_reference (parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
gdb_byte *
|
gdb::array_view<gdb_byte>
|
||||||
value_contents_raw (struct value *value)
|
value_contents_raw (struct value *value)
|
||||||
{
|
{
|
||||||
struct gdbarch *arch = get_value_arch (value);
|
struct gdbarch *arch = get_value_arch (value);
|
||||||
int unit_size = gdbarch_addressable_memory_unit_size (arch);
|
int unit_size = gdbarch_addressable_memory_unit_size (arch);
|
||||||
|
|
||||||
allocate_value_contents (value);
|
allocate_value_contents (value);
|
||||||
return value->contents.get () + value->embedded_offset * unit_size;
|
|
||||||
|
ULONGEST length = TYPE_LENGTH (value_type (value));
|
||||||
|
return {value->contents.get () + value->embedded_offset * unit_size, length};
|
||||||
}
|
}
|
||||||
|
|
||||||
gdb_byte *
|
gdb::array_view<gdb_byte>
|
||||||
value_contents_all_raw (struct value *value)
|
value_contents_all_raw (struct value *value)
|
||||||
{
|
{
|
||||||
allocate_value_contents (value);
|
allocate_value_contents (value);
|
||||||
return value->contents.get ();
|
|
||||||
|
ULONGEST length = TYPE_LENGTH (value_type (value));
|
||||||
|
return {value->contents.get (), length};
|
||||||
}
|
}
|
||||||
|
|
||||||
struct type *
|
struct type *
|
||||||
|
@ -1238,25 +1242,29 @@ require_available (const struct value *value)
|
||||||
throw_error (NOT_AVAILABLE_ERROR, _("value is not available"));
|
throw_error (NOT_AVAILABLE_ERROR, _("value is not available"));
|
||||||
}
|
}
|
||||||
|
|
||||||
const gdb_byte *
|
gdb::array_view<const gdb_byte>
|
||||||
value_contents_for_printing (struct value *value)
|
value_contents_for_printing (struct value *value)
|
||||||
{
|
{
|
||||||
if (value->lazy)
|
if (value->lazy)
|
||||||
value_fetch_lazy (value);
|
value_fetch_lazy (value);
|
||||||
return value->contents.get ();
|
|
||||||
|
ULONGEST length = TYPE_LENGTH (value_type (value));
|
||||||
|
return {value->contents.get (), length};
|
||||||
}
|
}
|
||||||
|
|
||||||
const gdb_byte *
|
gdb::array_view<const gdb_byte>
|
||||||
value_contents_for_printing_const (const struct value *value)
|
value_contents_for_printing_const (const struct value *value)
|
||||||
{
|
{
|
||||||
gdb_assert (!value->lazy);
|
gdb_assert (!value->lazy);
|
||||||
return value->contents.get ();
|
|
||||||
|
ULONGEST length = TYPE_LENGTH (value_type (value));
|
||||||
|
return {value->contents.get (), length};
|
||||||
}
|
}
|
||||||
|
|
||||||
const gdb_byte *
|
gdb::array_view<const gdb_byte>
|
||||||
value_contents_all (struct value *value)
|
value_contents_all (struct value *value)
|
||||||
{
|
{
|
||||||
const gdb_byte *result = value_contents_for_printing (value);
|
gdb::array_view<const gdb_byte> result = value_contents_for_printing (value);
|
||||||
require_not_optimized_out (value);
|
require_not_optimized_out (value);
|
||||||
require_available (value);
|
require_available (value);
|
||||||
return result;
|
return result;
|
||||||
|
@ -1334,8 +1342,8 @@ value_contents_copy_raw (struct value *dst, LONGEST dst_offset,
|
||||||
TARGET_CHAR_BIT * length));
|
TARGET_CHAR_BIT * length));
|
||||||
|
|
||||||
/* Copy the data. */
|
/* Copy the data. */
|
||||||
memcpy (value_contents_all_raw (dst) + dst_offset * unit_size,
|
memcpy (value_contents_all_raw (dst).data () + dst_offset * unit_size,
|
||||||
value_contents_all_raw (src) + src_offset * unit_size,
|
value_contents_all_raw (src).data () + src_offset * unit_size,
|
||||||
length * unit_size);
|
length * unit_size);
|
||||||
|
|
||||||
/* Copy the meta-data, adjusted. */
|
/* Copy the meta-data, adjusted. */
|
||||||
|
@ -1392,16 +1400,16 @@ set_value_stack (struct value *value, int val)
|
||||||
value->stack = val;
|
value->stack = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gdb_byte *
|
gdb::array_view<const gdb_byte>
|
||||||
value_contents (struct value *value)
|
value_contents (struct value *value)
|
||||||
{
|
{
|
||||||
const gdb_byte *result = value_contents_writeable (value);
|
gdb::array_view<const gdb_byte> result = value_contents_writeable (value);
|
||||||
require_not_optimized_out (value);
|
require_not_optimized_out (value);
|
||||||
require_available (value);
|
require_available (value);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
gdb_byte *
|
gdb::array_view<gdb_byte>
|
||||||
value_contents_writeable (struct value *value)
|
value_contents_writeable (struct value *value)
|
||||||
{
|
{
|
||||||
if (value->lazy)
|
if (value->lazy)
|
||||||
|
@ -1713,7 +1721,8 @@ value_copy (struct value *arg)
|
||||||
val->initialized = arg->initialized;
|
val->initialized = arg->initialized;
|
||||||
if (!value_lazy (val))
|
if (!value_lazy (val))
|
||||||
{
|
{
|
||||||
memcpy (value_contents_all_raw (val), value_contents_all_raw (arg),
|
memcpy (value_contents_all_raw (val).data (),
|
||||||
|
value_contents_all_raw (arg).data (),
|
||||||
TYPE_LENGTH (value_enclosing_type (arg)));
|
TYPE_LENGTH (value_enclosing_type (arg)));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1761,7 +1770,8 @@ value_non_lval (struct value *arg)
|
||||||
struct type *enc_type = value_enclosing_type (arg);
|
struct type *enc_type = value_enclosing_type (arg);
|
||||||
struct value *val = allocate_value (enc_type);
|
struct value *val = allocate_value (enc_type);
|
||||||
|
|
||||||
memcpy (value_contents_all_raw (val), value_contents_all (arg),
|
memcpy (value_contents_all_raw (val).data (),
|
||||||
|
value_contents_all (arg).data (),
|
||||||
TYPE_LENGTH (enc_type));
|
TYPE_LENGTH (enc_type));
|
||||||
val->type = arg->type;
|
val->type = arg->type;
|
||||||
set_value_embedded_offset (val, value_embedded_offset (arg));
|
set_value_embedded_offset (val, value_embedded_offset (arg));
|
||||||
|
@ -1778,7 +1788,7 @@ value_force_lval (struct value *v, CORE_ADDR addr)
|
||||||
{
|
{
|
||||||
gdb_assert (VALUE_LVAL (v) == not_lval);
|
gdb_assert (VALUE_LVAL (v) == not_lval);
|
||||||
|
|
||||||
write_memory (addr, value_contents_raw (v), TYPE_LENGTH (value_type (v)));
|
write_memory (addr, value_contents_raw (v).data (), TYPE_LENGTH (value_type (v)));
|
||||||
v->lval = lval_memory;
|
v->lval = lval_memory;
|
||||||
v->location.address = addr;
|
v->location.address = addr;
|
||||||
}
|
}
|
||||||
|
@ -2303,7 +2313,7 @@ set_internalvar_component (struct internalvar *var,
|
||||||
switch (var->kind)
|
switch (var->kind)
|
||||||
{
|
{
|
||||||
case INTERNALVAR_VALUE:
|
case INTERNALVAR_VALUE:
|
||||||
addr = value_contents_writeable (var->u.value);
|
addr = value_contents_writeable (var->u.value).data ();
|
||||||
arch = get_value_arch (var->u.value);
|
arch = get_value_arch (var->u.value);
|
||||||
unit_size = gdbarch_addressable_memory_unit_size (arch);
|
unit_size = gdbarch_addressable_memory_unit_size (arch);
|
||||||
|
|
||||||
|
@ -2311,7 +2321,7 @@ set_internalvar_component (struct internalvar *var,
|
||||||
modify_field (value_type (var->u.value), addr + offset,
|
modify_field (value_type (var->u.value), addr + offset,
|
||||||
value_as_long (newval), bitpos, bitsize);
|
value_as_long (newval), bitpos, bitsize);
|
||||||
else
|
else
|
||||||
memcpy (addr + offset * unit_size, value_contents (newval),
|
memcpy (addr + offset * unit_size, value_contents (newval).data (),
|
||||||
TYPE_LENGTH (value_type (newval)));
|
TYPE_LENGTH (value_type (newval)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2695,7 +2705,7 @@ value_as_long (struct value *val)
|
||||||
in disassemble_command). It also dereferences references, which
|
in disassemble_command). It also dereferences references, which
|
||||||
I suspect is the most logical thing to do. */
|
I suspect is the most logical thing to do. */
|
||||||
val = coerce_array (val);
|
val = coerce_array (val);
|
||||||
return unpack_long (value_type (val), value_contents (val));
|
return unpack_long (value_type (val), value_contents (val).data ());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extract a value as a C pointer. Does not deallocate the value.
|
/* Extract a value as a C pointer. Does not deallocate the value.
|
||||||
|
@ -2798,9 +2808,9 @@ value_as_address (struct value *val)
|
||||||
if (!value_type (val)->is_pointer_or_reference ()
|
if (!value_type (val)->is_pointer_or_reference ()
|
||||||
&& gdbarch_integer_to_address_p (gdbarch))
|
&& gdbarch_integer_to_address_p (gdbarch))
|
||||||
return gdbarch_integer_to_address (gdbarch, value_type (val),
|
return gdbarch_integer_to_address (gdbarch, value_type (val),
|
||||||
value_contents (val));
|
value_contents (val).data ());
|
||||||
|
|
||||||
return unpack_long (value_type (val), value_contents (val));
|
return unpack_long (value_type (val), value_contents (val).data ());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2924,7 +2934,7 @@ is_floating_value (struct value *val)
|
||||||
|
|
||||||
if (is_floating_type (type))
|
if (is_floating_type (type))
|
||||||
{
|
{
|
||||||
if (!target_float_is_valid (value_contents (val), type))
|
if (!target_float_is_valid (value_contents (val).data (), type))
|
||||||
error (_("Invalid floating value found in program."));
|
error (_("Invalid floating value found in program."));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -3066,7 +3076,7 @@ value_primitive_field (struct value *arg1, LONGEST offset,
|
||||||
for references to ordinary fields of unavailable values. */
|
for references to ordinary fields of unavailable values. */
|
||||||
if (BASETYPE_VIA_VIRTUAL (arg_type, fieldno))
|
if (BASETYPE_VIA_VIRTUAL (arg_type, fieldno))
|
||||||
boffset = baseclass_offset (arg_type, fieldno,
|
boffset = baseclass_offset (arg_type, fieldno,
|
||||||
value_contents (arg1),
|
value_contents (arg1).data (),
|
||||||
value_embedded_offset (arg1),
|
value_embedded_offset (arg1),
|
||||||
value_address (arg1),
|
value_address (arg1),
|
||||||
arg1);
|
arg1);
|
||||||
|
@ -3325,7 +3335,7 @@ unpack_value_bitfield (struct value *dest_val,
|
||||||
|
|
||||||
num = unpack_bits_as_long (field_type, valaddr + embedded_offset,
|
num = unpack_bits_as_long (field_type, valaddr + embedded_offset,
|
||||||
bitpos, bitsize);
|
bitpos, bitsize);
|
||||||
store_signed_integer (value_contents_raw (dest_val),
|
store_signed_integer (value_contents_raw (dest_val).data (),
|
||||||
TYPE_LENGTH (field_type), byte_order, num);
|
TYPE_LENGTH (field_type), byte_order, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3532,7 +3542,7 @@ value_from_longest (struct type *type, LONGEST num)
|
||||||
{
|
{
|
||||||
struct value *val = allocate_value (type);
|
struct value *val = allocate_value (type);
|
||||||
|
|
||||||
pack_long (value_contents_raw (val), type, num);
|
pack_long (value_contents_raw (val).data (), type, num);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3544,7 +3554,7 @@ value_from_ulongest (struct type *type, ULONGEST num)
|
||||||
{
|
{
|
||||||
struct value *val = allocate_value (type);
|
struct value *val = allocate_value (type);
|
||||||
|
|
||||||
pack_unsigned_long (value_contents_raw (val), type, num);
|
pack_unsigned_long (value_contents_raw (val).data (), type, num);
|
||||||
|
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -3558,7 +3568,7 @@ value_from_pointer (struct type *type, CORE_ADDR addr)
|
||||||
{
|
{
|
||||||
struct value *val = allocate_value (type);
|
struct value *val = allocate_value (type);
|
||||||
|
|
||||||
store_typed_address (value_contents_raw (val),
|
store_typed_address (value_contents_raw (val).data (),
|
||||||
check_typedef (type), addr);
|
check_typedef (type), addr);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
@ -3572,7 +3582,7 @@ value_from_host_double (struct type *type, double d)
|
||||||
{
|
{
|
||||||
struct value *value = allocate_value (type);
|
struct value *value = allocate_value (type);
|
||||||
gdb_assert (type->code () == TYPE_CODE_FLT);
|
gdb_assert (type->code () == TYPE_CODE_FLT);
|
||||||
target_float_from_host_double (value_contents_raw (value),
|
target_float_from_host_double (value_contents_raw (value).data (),
|
||||||
value_type (value), d);
|
value_type (value), d);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -3638,7 +3648,7 @@ value_from_contents (struct type *type, const gdb_byte *contents)
|
||||||
struct value *result;
|
struct value *result;
|
||||||
|
|
||||||
result = allocate_value (type);
|
result = allocate_value (type);
|
||||||
memcpy (value_contents_raw (result), contents, TYPE_LENGTH (type));
|
memcpy (value_contents_raw (result).data (), contents, TYPE_LENGTH (type));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3790,7 +3800,7 @@ coerce_ref (struct value *arg)
|
||||||
enc_type = check_typedef (value_enclosing_type (arg));
|
enc_type = check_typedef (value_enclosing_type (arg));
|
||||||
enc_type = TYPE_TARGET_TYPE (enc_type);
|
enc_type = TYPE_TARGET_TYPE (enc_type);
|
||||||
|
|
||||||
CORE_ADDR addr = unpack_pointer (value_type (arg), value_contents (arg));
|
CORE_ADDR addr = unpack_pointer (value_type (arg), value_contents (arg).data ());
|
||||||
retval = value_at_lazy (enc_type, addr);
|
retval = value_at_lazy (enc_type, addr);
|
||||||
enc_type = value_type (retval);
|
enc_type = value_type (retval);
|
||||||
return readjust_indirect_value_type (retval, enc_type, value_type_arg_tmp,
|
return readjust_indirect_value_type (retval, enc_type, value_type_arg_tmp,
|
||||||
|
@ -3887,7 +3897,7 @@ value_fetch_lazy_bitfield (struct value *val)
|
||||||
value_fetch_lazy (parent);
|
value_fetch_lazy (parent);
|
||||||
|
|
||||||
unpack_value_bitfield (val, value_bitpos (val), value_bitsize (val),
|
unpack_value_bitfield (val, value_bitpos (val), value_bitsize (val),
|
||||||
value_contents_for_printing (parent),
|
value_contents_for_printing (parent).data (),
|
||||||
value_offset (val), parent);
|
value_offset (val), parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3903,7 +3913,7 @@ value_fetch_lazy_memory (struct value *val)
|
||||||
|
|
||||||
if (TYPE_LENGTH (type))
|
if (TYPE_LENGTH (type))
|
||||||
read_value_memory (val, 0, value_stack (val),
|
read_value_memory (val, 0, value_stack (val),
|
||||||
addr, value_contents_all_raw (val),
|
addr, value_contents_all_raw (val).data (),
|
||||||
type_length_units (type));
|
type_length_units (type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3999,7 +4009,7 @@ value_fetch_lazy_register (struct value *val)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const gdb_byte *buf = value_contents (new_val);
|
const gdb_byte *buf = value_contents (new_val).data ();
|
||||||
|
|
||||||
if (VALUE_LVAL (new_val) == lval_register)
|
if (VALUE_LVAL (new_val) == lval_register)
|
||||||
fprintf_unfiltered (&debug_file, " register=%d",
|
fprintf_unfiltered (&debug_file, " register=%d",
|
||||||
|
|
14
gdb/value.h
14
gdb/value.h
|
@ -360,7 +360,7 @@ extern void error_value_optimized_out (void);
|
||||||
get to the real subobject, if the value happens to represent
|
get to the real subobject, if the value happens to represent
|
||||||
something embedded in a larger run-time object. */
|
something embedded in a larger run-time object. */
|
||||||
|
|
||||||
extern gdb_byte *value_contents_raw (struct value *);
|
extern gdb::array_view<gdb_byte> value_contents_raw (struct value *);
|
||||||
|
|
||||||
/* Actual contents of the value. For use of this value; setting it
|
/* Actual contents of the value. For use of this value; setting it
|
||||||
uses the stuff above. Not valid if lazy is nonzero. Target
|
uses the stuff above. Not valid if lazy is nonzero. Target
|
||||||
|
@ -368,24 +368,24 @@ extern gdb_byte *value_contents_raw (struct value *);
|
||||||
value. Note that a value therefore extends beyond what is
|
value. Note that a value therefore extends beyond what is
|
||||||
declared here. */
|
declared here. */
|
||||||
|
|
||||||
extern const gdb_byte *value_contents (struct value *);
|
extern gdb::array_view<const gdb_byte> value_contents (struct value *);
|
||||||
extern gdb_byte *value_contents_writeable (struct value *);
|
extern gdb::array_view<gdb_byte> value_contents_writeable (struct value *);
|
||||||
|
|
||||||
/* The ALL variants of the above two macros do not adjust the returned
|
/* The ALL variants of the above two macros do not adjust the returned
|
||||||
pointer by the embedded_offset value. */
|
pointer by the embedded_offset value. */
|
||||||
|
|
||||||
extern gdb_byte *value_contents_all_raw (struct value *);
|
extern gdb::array_view<gdb_byte> value_contents_all_raw (struct value *);
|
||||||
extern const gdb_byte *value_contents_all (struct value *);
|
extern gdb::array_view<const gdb_byte> value_contents_all (struct value *);
|
||||||
|
|
||||||
/* Like value_contents_all, but does not require that the returned
|
/* Like value_contents_all, but does not require that the returned
|
||||||
bits be valid. This should only be used in situations where you
|
bits be valid. This should only be used in situations where you
|
||||||
plan to check the validity manually. */
|
plan to check the validity manually. */
|
||||||
extern const gdb_byte *value_contents_for_printing (struct value *value);
|
extern gdb::array_view<const gdb_byte> value_contents_for_printing (struct value *value);
|
||||||
|
|
||||||
/* Like value_contents_for_printing, but accepts a constant value
|
/* Like value_contents_for_printing, but accepts a constant value
|
||||||
pointer. Unlike value_contents_for_printing however, the pointed
|
pointer. Unlike value_contents_for_printing however, the pointed
|
||||||
value must _not_ be lazy. */
|
value must _not_ be lazy. */
|
||||||
extern const gdb_byte *
|
extern gdb::array_view<const gdb_byte>
|
||||||
value_contents_for_printing_const (const struct value *value);
|
value_contents_for_printing_const (const struct value *value);
|
||||||
|
|
||||||
extern void value_fetch_lazy (struct value *val);
|
extern void value_fetch_lazy (struct value *val);
|
||||||
|
|
|
@ -123,7 +123,7 @@ vax_store_arguments (struct regcache *regcache, int nargs,
|
||||||
|
|
||||||
sp -= (len + 3) & ~3;
|
sp -= (len + 3) & ~3;
|
||||||
count += (len + 3) / 4;
|
count += (len + 3) / 4;
|
||||||
write_memory (sp, value_contents_all (args[i]), len);
|
write_memory (sp, value_contents_all (args[i]).data (), len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Push argument count. */
|
/* Push argument count. */
|
||||||
|
|
|
@ -408,7 +408,7 @@ tlb_value_read (struct value *val)
|
||||||
|
|
||||||
if (!target_get_tib_address (inferior_ptid, &tlb))
|
if (!target_get_tib_address (inferior_ptid, &tlb))
|
||||||
error (_("Unable to read tlb"));
|
error (_("Unable to read tlb"));
|
||||||
store_typed_address (value_contents_raw (val), type, tlb);
|
store_typed_address (value_contents_raw (val).data (), type, tlb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This function implements the lval_computed support for writing a
|
/* This function implements the lval_computed support for writing a
|
||||||
|
|
|
@ -257,7 +257,7 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Put argument into registers wordwise. */
|
/* Put argument into registers wordwise. */
|
||||||
const gdb_byte *val = value_contents (args[i]);
|
const gdb_byte *val = value_contents (args[i]).data ();
|
||||||
for (j = 0; j < typelen; j += xstormy16_reg_size)
|
for (j = 0; j < typelen; j += xstormy16_reg_size)
|
||||||
{
|
{
|
||||||
ULONGEST regval;
|
ULONGEST regval;
|
||||||
|
@ -275,7 +275,7 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
wordaligned. */
|
wordaligned. */
|
||||||
for (j = nargs - 1; j >= i; j--)
|
for (j = nargs - 1; j >= i; j--)
|
||||||
{
|
{
|
||||||
const gdb_byte *bytes = value_contents (args[j]);
|
const gdb_byte *bytes = value_contents (args[j]).data ();
|
||||||
|
|
||||||
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
|
typelen = TYPE_LENGTH (value_enclosing_type (args[j]));
|
||||||
slacklen = typelen & 1;
|
slacklen = typelen & 1;
|
||||||
|
|
|
@ -1731,7 +1731,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fprintf_unfiltered (gdb_stdlog, " %s\n",
|
fprintf_unfiltered (gdb_stdlog, " %s\n",
|
||||||
host_address_to_string (value_contents (arg)));
|
host_address_to_string (value_contents (arg).data ()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1787,7 +1787,7 @@ xtensa_push_dummy_call (struct gdbarch *gdbarch,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
info->length = TYPE_LENGTH (arg_type);
|
info->length = TYPE_LENGTH (arg_type);
|
||||||
info->contents = value_contents (arg);
|
info->contents = value_contents (arg).data ();
|
||||||
|
|
||||||
/* Align size and onstack_size. */
|
/* Align size and onstack_size. */
|
||||||
size = (size + info->align - 1) & ~(info->align - 1);
|
size = (size + info->align - 1) & ~(info->align - 1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue