]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix gdb.ada/vla.exp
authorTom Tromey <tromey@adacore.com>
Wed, 29 May 2019 16:21:52 +0000 (10:21 -0600)
committerTom Tromey <tromey@adacore.com>
Fri, 14 Jun 2019 12:53:24 +0000 (06:53 -0600)
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-06-14  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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/vla.exp
gdb/testsuite/gdb.ada/vla/vla.adb

index 37e327d9f2adabcb42f945db920a233f4b1af1c0..bd48c9212dc1f0caa6102033a110d403d7e14b70 100644 (file)
@@ -1,3 +1,10 @@
+2019-06-14  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-06-13  Pedro Alves  <palves@redhat.com>
 
        * gdb.base/settings.exp (test-integer): Test junk after
index 7e10e9b82236e233c7fe0fc65b79843706f365e8..c03d1cc929bd468f1c97c0c93966615a91ad8c4f 100644 (file)
@@ -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\\)"
index 2b6cc8a1114f6981bb8264bac8eba91265bdceeb..1986fb194f923b019f74a6381fce23626f1ff318 100644 (file)
@@ -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;