+2020-11-04 Tom Tromey <tromey@adacore.com>
+
+ * dwarf2/read.c (read_array_type): Only apply stride to innermost
+ array.
+
2020-11-04 Tom Tromey <tromey@adacore.com>
* gdbtypes.c (update_static_array_size): Handle bit stride.
int i = 0;
while (i < range_types.size ())
- type = create_array_type_with_stride (NULL, type, range_types[i++],
- byte_stride_prop, bit_stride);
+ {
+ type = create_array_type_with_stride (NULL, type, range_types[i++],
+ byte_stride_prop, bit_stride);
+ bit_stride = 0;
+ byte_stride_prop = nullptr;
+ }
}
else
{
size_t ndim = range_types.size ();
while (ndim-- > 0)
- type = create_array_type_with_stride (NULL, type, range_types[ndim],
- byte_stride_prop, bit_stride);
+ {
+ type = create_array_type_with_stride (NULL, type, range_types[ndim],
+ byte_stride_prop, bit_stride);
+ bit_stride = 0;
+ byte_stride_prop = nullptr;
+ }
}
/* Understand Dwarf2 support for vector types (like they occur on
+2020-11-04 Tom Tromey <tromey@adacore.com>
+
+ * gdb.ada/enum_idx_packed.exp: Add test.
+ * gdb.ada/enum_idx_packed/foo.adb (Multi_Access):
+ New variable.
+ * gdb.ada/enum_idx_packed/pck.ads (Short)
+ (Multi_Dimension, Multi_Dimension_Access): New types.
+
2020-11-04 Tom Tromey <tromey@adacore.com>
* gdb.ada/enum_idx_packed.exp: Test two forms of -fgnat-encodings.
setup_kfail "minimal encodings" *-*-*
}
gdb_test "print multi_multi(2)" " = $matrix"
+
+ gdb_test "print multi_access.all" \
+ " = \\(\\(8, 13, 21, 34, 55\\), \\(1, 1, 2, 3, 5\\)\\)"
}
Small : Small_Table := New_Small_Table (Low => Red, High => Green);
Multi : Multi_Table := New_Multi_Table (Red, Green, Low, Medium);
Multi_Multi : Multi_Multi_Table := New_Multi_Multi_Table (1, 2, 1, 7, 1, 10);
+ Multi_Access : Multi_Dimension_Access
+ := new Multi_Dimension'(True => (1, 1, 2, 3, 5),
+ False => (8, 13, 21, 34, 55));
+
begin
Do_Nothing (Full'Address); -- STOP
Do_Nothing (Primary'Address);
Do_Nothing (Small'Address);
Do_Nothing (Multi'Address);
Do_Nothing (Multi_Multi'Address);
+ Do_Nothing (Multi_Access'Address);
end Foo;
package Pck is
type Color is (Black, Red, Green, Blue, White);
type Strength is (None, Low, Medium, High);
+ type Short is new Natural range 0 .. 2 ** 8 - 1;
type Full_Table is array (Color) of Boolean;
pragma Pack (Full_Table);
function New_Multi_Multi_Table (L1, H1, L2, H2, L3, H3: Positive)
return Multi_Multi_Table;
+ type Multi_Dimension is array (Boolean, Color) of Short;
+ pragma Pack (Multi_Dimension);
+ type Multi_Dimension_Access is access all Multi_Dimension;
+
procedure Do_Nothing (A : System.Address);
end Pck;