gdb.sum: ... PASS: gdb.ada/vla.exp: compilation vla.adb FAIL: gdb.ada/vla.exp: print r00 FAIL: gdb.ada/vla.exp: print r01 FAIL: gdb.ada/vla.exp: print r10 FAIL: gdb.ada/vla.exp: print r22 ... gdb.log: ... (gdb) break vla.adb:53^M Breakpoint 1 at 0x401f84: file /data/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/vla/vla.adb, line 53.^M (gdb) run ^M Starting program: /data/gdb_versions/devel/build/gdb/testsuite/outputs/gdb.ada/vla/vla ^M ^M Breakpoint 1, vla () at /data/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/vla/vla.adb:53^M 53 Process (R00); -- Set breakpoint here^M (gdb) print r00^M $1 = (l1 => 0, l2 => 0, i1 => 1, a1 => (), i2 => 2, a2 => (), i3 => 3)^M (gdb) FAIL: gdb.ada/vla.exp: print r00 print r01^M $2 = (l1 => 0, l2 => 1, i1 => 1, a1 => (), i2 => 2, a2 => (20), i3 => 3)^M (gdb) FAIL: gdb.ada/vla.exp: print r01 print r10^M $3 = (l1 => 1, l2 => 0, i1 => 1, a1 => (10), i2 => 2, a2 => (), i3 => 3)^M (gdb) FAIL: gdb.ada/vla.exp: print r10 print r22^M $4 = (l1 => 2, l2 => 2, i1 => 1, a1 => (10, 10), i2 => 2, a2 => (20, 20), i3 => 3)^M (gdb) FAIL: gdb.ada/vla.exp: print r22 ... There seems to be an order discrepancy: ... (l1 => 0, l2 => 0, i1 => 1, a1 => (), i2 => 2, a2 => (), i3 => 3) ... vs: ... (l1 => 0, l2 => 0, i1 => 1, i2 => 2, i3 => 3, a1 => (), a2 => ()) ...
Which version of gcc/gnat are you using? I actually think the output you are seeing is more correct, because it's in the declaration order. However all the compilers I have locally seem to emit things in the wrong order.
I think for gdb it makes sense to simply accept both results. Meanwhile I filed an internal bug report to get one of the Gnat compiler engineers to fix the bug.
I sent a patch.
(In reply to Tom Tromey from comment #1) > Which version of gcc/gnat are you using? Default compilers on openSUSE Leap 15.0: ... $ gnatmake --version GNATMAKE 7.4.0 $ gcc --version gcc (SUSE Linux) 7.4.0 ...
The master branch has been updated by Tom Tromey <tromey@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9a9e394b05a841bdd9163f280d7ef19cc65634d6 commit 9a9e394b05a841bdd9163f280d7ef19cc65634d6 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-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.
Fixed.