{
type = create_array_type_with_stride (NULL, type, range_types[i++],
byte_stride_prop, bit_stride);
+ type->set_is_multi_dimensional (true);
bit_stride = 0;
byte_stride_prop = nullptr;
}
{
type = create_array_type_with_stride (NULL, type, range_types[ndim],
byte_stride_prop, bit_stride);
+ type->set_is_multi_dimensional (true);
bit_stride = 0;
byte_stride_prop = nullptr;
}
}
+ /* Clear the flag on the outermost array type. */
+ type->set_is_multi_dimensional (false);
gdb_assert (type != element_type);
/* Understand Dwarf2 support for vector types (like they occur on
wrong size when trying to find elements of the outer
array. */
if (element_type->code () == TYPE_CODE_ARRAY
+ && (stride != 0 || element_type->is_multi_dimensional ())
&& element_type->length () != 0
&& TYPE_FIELD_BITSIZE (element_type, 0) != 0
&& get_array_bounds (element_type, &low_bound, &high_bound)
unsigned int m_flag_flag_enum : 1;
+ /* * For TYPE_CODE_ARRAY, this is true if this type is part of a
+ multi-dimensional array. Multi-dimensional arrays are
+ represented internally as arrays of arrays, and this flag lets
+ gdb distinguish between multiple dimensions and an ordinary array
+ of arrays. The flag is set on each inner dimension, but not the
+ outermost dimension. */
+
+ unsigned int m_multi_dimensional : 1;
+
/* * A discriminant telling us which field of the type_specific
union is being used for this type, if any. */
this->main_type->m_flag_flag_enum = is_flag_enum;
}
+ /* True if this array type is part of a multi-dimensional array. */
+
+ bool is_multi_dimensional () const
+ {
+ return this->main_type->m_multi_dimensional;
+ }
+
+ void set_is_multi_dimensional (bool value)
+ {
+ this->main_type->m_multi_dimensional = value;
+ }
+
/* * Assuming that THIS is a TYPE_CODE_FIXED_POINT, return a reference
to this type's fixed_point_info. */
xfail $test
}
}
+
+ set line "(4 => true, false, true, false, true)"
+ gdb_test "print o_var" \
+ [string_to_regexp " = ($line, $line, $line, $line)"]
+ gdb_test "print o2_var" \
+ [string_to_regexp " = ($line, $line, $line, $line)"]
}
U_Var : Unconstrained_Packed_Array (1 .. Ident (6));
+ -- Note that this array is not packed.
+ type Outer_Array is array (1 .. 4) of Packed_Array;
+ O_Var : Outer_Array := ((true, false, true, false, true),
+ (true, false, true, false, true),
+ (true, false, true, false, true),
+ (true, false, true, false, true));
+
+ type Outer_Array2 is array (1 .. 4) of Packed_Array;
+ pragma pack (Outer_Array2);
+ O2_Var : Outer_Array2 := ((true, false, true, false, true),
+ (true, false, true, false, true),
+ (true, false, true, false, true),
+ (true, false, true, false, true));
+
begin
Var := (True, False, True, False, True);