From patchwork Wed May 29 16:25:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32901 Received: (qmail 85280 invoked by alias); 29 May 2019 16:25:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 85267 invoked by uid 89); 29 May 2019 16:25:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 May 2019 16:25:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 64260117760; Wed, 29 May 2019 12:25:10 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZWZxnzN9im4C; Wed, 29 May 2019 12:25:10 -0400 (EDT) Received: from murgatroyd (174-29-48-168.hlrn.qwest.net [174.29.48.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id D090111740A; Wed, 29 May 2019 12:25:09 -0400 (EDT) From: Tom Tromey To: Joel Brobecker Cc: Tom Tromey , gdb-patches@sourceware.org, vries@gcc.gnu.org Subject: Re: [PATCH] Fix gdb.ada/vla.exp References: <20190528182556.20011-1-tromey@adacore.com> <20190529152739.GA4572@adacore.com> Date: Wed, 29 May 2019 10:25:09 -0600 In-Reply-To: <20190529152739.GA4572@adacore.com> (Joel Brobecker's message of "Wed, 29 May 2019 08:27:39 -0700") Message-ID: <87y32pxm6y.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 >>>>> "Joel" == Joel Brobecker 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 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 PR ada/24539: * gdb.ada/vla.exp: Update tests. * gdb.ada/vla/vla.adb (Record_Type): Use No_Component_Reordering pragma. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 661c93860ca..8e16b4e1b5d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2019-05-29 Tom Tromey + + 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 * gdb.ada/complete.exp (test_gdb_no_completion): Add "/" and "-" diff --git a/gdb/testsuite/gdb.ada/vla.exp b/gdb/testsuite/gdb.ada/vla.exp index 7e10e9b8223..c03d1cc929b 100644 --- a/gdb/testsuite/gdb.ada/vla.exp +++ b/gdb/testsuite/gdb.ada/vla.exp @@ -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\\)" diff --git a/gdb/testsuite/gdb.ada/vla/vla.adb b/gdb/testsuite/gdb.ada/vla/vla.adb index 2b6cc8a1114..1986fb194f9 100644 --- a/gdb/testsuite/gdb.ada/vla/vla.adb +++ b/gdb/testsuite/gdb.ada/vla/vla.adb @@ -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;