fprintf_filtered (stream, ", ");
}
}
+ else if (options->prettyformat_arrays)
+ {
+ fprintf_filtered (stream, "\n");
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ }
wrap_here (n_spaces (2 + 2 * recurse));
maybe_print_array_index (index_type, i + low, stream, options);
{
struct type *type = value_type (value);
struct type *var_type = TYPE_FIELD_TYPE (type, field_num);
- int which = ada_which_variant_applies (var_type,
- value_type (outer_value),
- value_contents (outer_value));
+ int which = ada_which_variant_applies (var_type, outer_value);
if (which < 0)
return 0;
- struct value *active_component = value_field (value, which);
+ struct value *variant_field = value_field (value, field_num);
+ struct value *active_component = value_field (variant_field, which);
return print_field_values (active_component, outer_value, stream, recurse,
options, comma_needed, language);
}
if (ada_is_wrapper_field (type, i))
{
+ struct value *field_val = ada_value_primitive_field (value, 0,
+ i, type);
comma_needed =
- print_field_values (value_field (value, i), outer_value,
+ print_field_values (field_val, field_val,
stream, recurse, options,
comma_needed, language);
continue;
eltlen = TYPE_LENGTH (elttype);
len = TYPE_LENGTH (type) / eltlen;
- if (options->prettyformat_arrays)
- print_spaces_filtered (2 + 2 * recurse, stream);
-
/* If requested, look for the first null char and only print
elements up to it. */
if (options->stop_print_at_null)
const gdb_byte *valaddr = value_contents_for_printing (val);
CORE_ADDR address = value_address (val);
- type = ada_check_typedef (resolve_dynamic_type (type, valaddr, address));
+ gdb::array_view<const gdb_byte> view
+ = gdb::make_array_view (valaddr, TYPE_LENGTH (type));
+ type = ada_check_typedef (resolve_dynamic_type (type, view, address));
if (type != saved_type)
{
val = value_copy (val);