Commit Message
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> That's pretty much what we did in AdaCore's internal gdb-testsuite
Joel> (not based on the official dejagnu-based testsuite), and the change
Joel> looks good to me, so could be pushed as is. But I thought I'd mention
Joel> another option for this testcase, which is to change the source code
Joel> to use...
Joel> pragma No_Component_Reordering (Record_Type);
[...]
This seems more clear to me, so I've implemented it.
Let me know what you think.
Tom
commit 56dc2e044bc991a81e49ee714951f3045c9423a9
Author: Tom Tromey <tromey@adacore.com>
Date: Wed May 29 10:21:52 2019 -0600
Fix gdb.ada/vla.exp
PR ada/24539 concerns a test failure in gdb.ada/vla.exp.
The problem here is that different versions of Gnat emit the
structure's fields in different orders -- with the order currently
failing actually being the correct one.
Joel pointed out that this can be fixed by simply adding the
No_Component_Reordering pragma to the type in question, which is what
this patch does.
I've reported a Gnat compiler bug internally in hopes of getting the
underlying problem fixed.
gdb/testsuite/ChangeLog
2019-05-29 Tom Tromey <tromey@adacore.com>
PR ada/24539:
* gdb.ada/vla.exp: Update tests.
* gdb.ada/vla/vla.adb (Record_Type): Use No_Component_Reordering
pragma.
Comments
On 29-05-19 18:25, Tom Tromey wrote:
>>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
>
> Joel> That's pretty much what we did in AdaCore's internal gdb-testsuite
> Joel> (not based on the official dejagnu-based testsuite), and the change
> Joel> looks good to me, so could be pushed as is. But I thought I'd mention
> Joel> another option for this testcase, which is to change the source code
> Joel> to use...
>
> Joel> pragma No_Component_Reordering (Record_Type);
>
> [...]
>
> This seems more clear to me, so I've implemented it.
> Let me know what you think.
Hi,
I've tested this, and it works for me.
[ Sorry for the late reaction, I did not have the @gcc.gnu.org email
address in my keep-in-inbox mail filter rule. Hopefully fixed now. ]
Thanks,
- Tom
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> I've tested this, and it works for me.
Thanks, I'm going to check it in.
Tom
@@ -1,3 +1,10 @@
+2019-05-29 Tom Tromey <tromey@adacore.com>
+
+ PR ada/24539:
+ * gdb.ada/vla.exp: Update tests.
+ * gdb.ada/vla/vla.adb (Record_Type): Use No_Component_Reordering
+ pragma.
+
2019-05-29 Tom Tromey <tromey@adacore.com>
* gdb.ada/complete.exp (test_gdb_no_completion): Add "/" and "-"
@@ -29,10 +29,10 @@ set bp_location [gdb_get_line_number "Set breakpoint here" ${testdir}/vla.adb]
runto "vla.adb:$bp_location"
gdb_test "print r00" \
- "= \\(l1 => 0, l2 => 0, i1 => 1, i2 => 2, i3 => 3, a1 => \\(\\), a2 => \\(\\)\\)"
+ "= \\(l1 => 0, l2 => 0, i1 => 1, a1 => \\(\\), i2 => 2, a2 => \\(\\), i3 => 3\\)"
gdb_test "print r01" \
- "= \\(l1 => 0, l2 => 1, i1 => 1, i2 => 2, i3 => 3, a1 => \\(\\), a2 => \\(20\\)\\)"
+ "= \\(l1 => 0, l2 => 1, i1 => 1, a1 => \\(\\), i2 => 2, a2 => \\(20\\), i3 => 3\\)"
gdb_test "print r10" \
- "= \\(l1 => 1, l2 => 0, i1 => 1, i2 => 2, i3 => 3, a1 => \\(10\\), a2 => \\(\\)\\)"
+ "= \\(l1 => 1, l2 => 0, i1 => 1, a1 => \\(10\\), i2 => 2, a2 => \\(\\), i3 => 3\\)"
gdb_test "print r22" \
- "= \\(l1 => 2, l2 => 2, i1 => 1, i2 => 2, i3 => 3, a1 => \\(10, 10\\), a2 => \\(20, 20\\)\\)"
+ "= \\(l1 => 2, l2 => 2, i1 => 1, a1 => \\(10, 10\\), i2 => 2, a2 => \\(20, 20\\), i3 => 3\\)"
@@ -23,6 +23,11 @@ procedure Vla is
I3 : Integer;
end record;
+ -- Some versions of GCC emit the members in the incorrect order.
+ -- Since this isn't relevant to the bug at hand, disable
+ -- reordering to get consistent results.
+ pragma No_Component_Reordering (Record_Type);
+
procedure Process (R : Record_Type) is
begin
null;