Message ID | 20221128162134.20424-1-tdevries@suse.de |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 33B4B385B1A6 for <patchwork@sourceware.org>; Mon, 28 Nov 2022 16:22:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33B4B385B1A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669652522; bh=hlFDC+BB9OAs2Px5ZJugEe7TzXM/jllPmsl6cdJ8KuQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=sETjrMNsR6PWuSRqdKRra5DLe38b5f/QH4fN1WTkYRlBAp7JGyr0CtgiP5+bhEv81 YQS7birTZKAUuzIpFwNZbwjS5YameplLp5LfWpyG8UfK/0oBMTYan8bmiscOYiezEN leqpbjXDsCYwDDjlAtjAE6fuwLfRqvEd+WU1g7pw= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 8B0313857C51 for <gdb-patches@sourceware.org>; Mon, 28 Nov 2022 16:21:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B0313857C51 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id BD62821B5A; Mon, 28 Nov 2022 16:21:34 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 9E35E1326E; Mon, 28 Nov 2022 16:21:34 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nIdvJQ7ghGN6YgAAMHmgww (envelope-from <tdevries@suse.de>); Mon, 28 Nov 2022 16:21:34 +0000 To: gdb-patches@sourceware.org Cc: Carl Love <cel@us.ibm.com>, Ulrich Weigand <Ulrich.Weigand@de.ibm.com> Subject: [pushed] [gdb/testsuite] Fix gdb.ada/out_of_line_in_inlined.exp for ppc64le Date: Mon, 28 Nov 2022 17:21:34 +0100 Message-Id: <20221128162134.20424-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tom de Vries via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tom de Vries <tdevries@suse.de> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
[pushed,gdb/testsuite] Fix gdb.ada/out_of_line_in_inlined.exp for ppc64le
|
|
Commit Message
Tom de Vries
Nov. 28, 2022, 4:21 p.m. UTC
On powerpc64le-linux, with test-case gdb.ada/out_of_line_in_inlined.exp I run into: ... (gdb) run ^M Starting program: foo_o224_021-all ^M ^M Breakpoint 1, 0x0000000010002f48 in foo_o224_021.child1.child2 (s=...) at \ foo_o224_021.adb:24^M 24 function Child2 (S : String) return Boolean is -- STOP^M (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: \ run to foo_o224_021.child1.child2 ... The breakpoint is correctly set at the local entry point, and given that the local entry point doesn't correspond to a line number entry, the instruction address of the breakpoint is shown. The problem is that test-case doesn't expect the breakpoint address. Fix this by allowing the breakpoint address to occur. Tested on powerpc64le-linux. --- gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 76cd77dc729b03d6b33c683323594479e33a3f9a
Comments
Tom: On Mon, 2022-11-28 at 17:21 +0100, Tom de Vries wrote: > On powerpc64le-linux, with test-case > gdb.ada/out_of_line_in_inlined.exp I run > into: > ... > (gdb) run ^M > Starting program: foo_o224_021-all ^M > ^M > Breakpoint 1, 0x0000000010002f48 in foo_o224_021.child1.child2 > (s=...) at \ > foo_o224_021.adb:24^M > 24 function Child2 (S : String) return Boolean is -- > STOP^M > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: \ > run to foo_o224_021.child1.child2 > ... > > The breakpoint is correctly set at the local entry point, and given > that the > local entry point doesn't correspond to a line number entry, the > instruction > address of the breakpoint is shown. > > The problem is that test-case doesn't expect the breakpoint address. > > Fix this by allowing the breakpoint address to occur. > > Tested on powerpc64le-linux. > --- > gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > index 4bdb4decaaf..621b04e179b 100644 > --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { > > gdb_run_cmd > gdb_test "" \ > - "Breakpoint $decimal, foo_o224_021\\.child1\\.child2 > \\(s=\\.\\.\\.\\).*" \ > + "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 > \\(s=\\.\\.\\.\\).*" \ > "run to foo_o224_021.child1.child2" > > set opt_addr_in "($hex in)?" > > base-commit: 76cd77dc729b03d6b33c683323594479e33a3f9a The commit fixes the two test failures when run on my Power 9 box. The test runs without any errors on Power 9 with the fix. However, with the commit to fix the test on Power 10, I see the following failures: (gdb) run Starting program: /home/carll/GDB/build-test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_021-all [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at /home/carll/GDB/binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_\ in_inlined/foo_o224_021.adb:27 27 Do_Nothing (C); (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run to foo_o224_021.child1.child2 ... Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 locations) (gdb) run Starting program: /home/carll/GDB/build-test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_021-minimal [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at /home/carll/GDB/binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_\ in_inlined/foo_o224_021.adb:27 27 Do_Nothing (C); (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=minimal: run to foo_o224_021.child1.child2 I backed the gdb tree up to the previous commit on Power 10 with the command: git checkout af31506c31a59a6edbb13498d6075fa704b801cd and re-ran the tests. I see the same two failures. These failures appear to be different than the ones that Tom reported and fixed with the commit. From discussion of previous test fixes, there may be a system configuration difference here: My Power 10 system: Fedora release 36 (Thirty Six), gcc (GCC) 12.2.1 20220819 (Red Hat 12.2.1-2) Power 9 system: Ubuntu 20.04.5 LTS, gcc (Ubuntu 9.4.0- 1ubuntu1~20.04.1) 9.4.0 From what Tom reported on another test, he is running on (openSUSE Leap 15.4) has system gcc 7.5.0. Carl
On 11/28/22 18:45, Carl Love wrote: > Tom: > > > On Mon, 2022-11-28 at 17:21 +0100, Tom de Vries wrote: >> On powerpc64le-linux, with test-case >> gdb.ada/out_of_line_in_inlined.exp I run >> into: >> ... >> (gdb) run ^M >> Starting program: foo_o224_021-all ^M >> ^M >> Breakpoint 1, 0x0000000010002f48 in foo_o224_021.child1.child2 >> (s=...) at \ >> foo_o224_021.adb:24^M >> 24 function Child2 (S : String) return Boolean is -- >> STOP^M >> (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: \ >> run to foo_o224_021.child1.child2 >> ... >> >> The breakpoint is correctly set at the local entry point, and given >> that the >> local entry point doesn't correspond to a line number entry, the >> instruction >> address of the breakpoint is shown. >> >> The problem is that test-case doesn't expect the breakpoint address. >> >> Fix this by allowing the breakpoint address to occur. >> >> Tested on powerpc64le-linux. >> --- >> gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >> b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >> index 4bdb4decaaf..621b04e179b 100644 >> --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >> +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >> @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { >> >> gdb_run_cmd >> gdb_test "" \ >> - "Breakpoint $decimal, foo_o224_021\\.child1\\.child2 >> \\(s=\\.\\.\\.\\).*" \ >> + "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 >> \\(s=\\.\\.\\.\\).*" \ >> "run to foo_o224_021.child1.child2" >> >> set opt_addr_in "($hex in)?" >> >> base-commit: 76cd77dc729b03d6b33c683323594479e33a3f9a > > The commit fixes the two test failures when run on my Power 9 box. The > test runs without any errors on Power 9 with the fix. > > However, with the commit to fix the test on Power 10, I see the > following failures: > > (gdb) run > Starting program: /home/carll/GDB/build-test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_021-all > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib64/libthread_db.so.1". > > Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at /home/carll/GDB/binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_\ > in_inlined/foo_o224_021.adb:27 > 27 Do_Nothing (C); > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run to foo_o224_021.child1.child2 > > ... > > Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 locations) > (gdb) run > Starting program: /home/carll/GDB/build-test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_021-minimal > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib64/libthread_db.so.1". > > Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at /home/carll/GDB/binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_\ > in_inlined/foo_o224_021.adb:27 > 27 Do_Nothing (C); > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=minimal: run to foo_o224_021.child1.child2 > > I backed the gdb tree up to the previous commit on Power 10 with the command: > > git checkout af31506c31a59a6edbb13498d6075fa704b801cd > > and re-ran the tests. I see the same two failures. These failures > appear to be different than the ones that Tom reported and fixed with > the commit. > > From discussion of previous test fixes, there may be a system > configuration difference here: > > My Power 10 system: Fedora release 36 (Thirty Six), gcc (GCC) 12.2.1 > 20220819 (Red Hat 12.2.1-2) > > Power 9 system: Ubuntu 20.04.5 LTS, gcc (Ubuntu 9.4.0- > 1ubuntu1~20.04.1) 9.4.0 > > From what Tom reported on another test, he is running on (openSUSE Leap > 15.4) has system gcc 7.5.0. > Hi Carl, thanks for looking into this. AFAICT, the FAIL is due to the "1.1" rather than "1" for the breakpoint. So apparently, the compiler optimizes a bit more, resulting in two breakpoints instead of one. So, this looks like an independent issue, and I think it could be fixed by just accepting the 1.1, by something like replacing "$decimal" with "$decimal(\\.$decimal)?". Thanks, - Tom
Tom: On Mon, 2022-11-28 at 19:08 +0100, Tom de Vries wrote: > On 11/28/22 18:45, Carl Love wrote: > > Tom: > > > > > > On Mon, 2022-11-28 at 17:21 +0100, Tom de Vries wrote: > > > On powerpc64le-linux, with test-case > > > gdb.ada/out_of_line_in_inlined.exp I run > > > into: > > > ... > > > (gdb) run ^M > > > Starting program: foo_o224_021-all ^M > > > ^M > > > Breakpoint 1, 0x0000000010002f48 in foo_o224_021.child1.child2 > > > (s=...) at \ > > > foo_o224_021.adb:24^M > > > 24 function Child2 (S : String) return Boolean is -- > > > STOP^M > > > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: \ > > > run to foo_o224_021.child1.child2 > > > ... > > > > > > The breakpoint is correctly set at the local entry point, and > > > given > > > that the > > > local entry point doesn't correspond to a line number entry, the > > > instruction > > > address of the breakpoint is shown. > > > > > > The problem is that test-case doesn't expect the breakpoint > > > address. > > > > > > Fix this by allowing the breakpoint address to occur. > > > > > > Tested on powerpc64le-linux. > > > --- > > > gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > index 4bdb4decaaf..621b04e179b 100644 > > > --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { > > > > > > gdb_run_cmd > > > gdb_test "" \ > > > - "Breakpoint $decimal, foo_o224_021\\.child1\\.child2 > > > \\(s=\\.\\.\\.\\).*" \ > > > + "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 > > > \\(s=\\.\\.\\.\\).*" \ > > > "run to foo_o224_021.child1.child2" > > > > > > set opt_addr_in "($hex in)?" > > > > > > base-commit: 76cd77dc729b03d6b33c683323594479e33a3f9a > > > > The commit fixes the two test failures when run on my Power 9 > > box. The > > test runs without any errors on Power 9 with the fix. > > > > However, with the commit to fix the test on Power 10, I see the > > following failures: > > > > (gdb) run > > Starting program: /home/carll/GDB/build- > > test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_ > > 021-all > > [Thread debugging using libthread_db enabled] > > Using host libthread_db library "/lib64/libthread_db.so.1". > > > > Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at > > /home/carll/GDB/binutils-gdb- > > test/gdb/testsuite/gdb.ada/out_of_line_\ > > in_inlined/foo_o224_021.adb:27 > > 27 Do_Nothing (C); > > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run > > to foo_o224_021.child1.child2 > > > > ... > > > > Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 > > locations) > > (gdb) run > > Starting program: /home/carll/GDB/build- > > test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_ > > 021-minimal > > [Thread debugging using libthread_db enabled] > > Using host libthread_db library "/lib64/libthread_db.so.1". > > > > Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at > > /home/carll/GDB/binutils-gdb- > > test/gdb/testsuite/gdb.ada/out_of_line_\ > > in_inlined/foo_o224_021.adb:27 > > 27 Do_Nothing (C); > > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=minimal: > > run to foo_o224_021.child1.child2 > > > > I backed the gdb tree up to the previous commit on Power 10 with > > the command: > > > > git checkout af31506c31a59a6edbb13498d6075fa704b801cd > > > > and re-ran the tests. I see the same two failures. These failures > > appear to be different than the ones that Tom reported and fixed > > with > > the commit. > > > > From discussion of previous test fixes, there may be a system > > configuration difference here: > > > > My Power 10 system: Fedora release 36 (Thirty Six), gcc (GCC) > > 12.2.1 > > 20220819 (Red Hat 12.2.1-2) > > > > Power 9 system: Ubuntu 20.04.5 LTS, gcc (Ubuntu 9.4.0- > > 1ubuntu1~20.04.1) 9.4.0 > > > > From what Tom reported on another test, he is running on (openSUSE > > Leap > > 15.4) has system gcc 7.5.0. > > > > Hi Carl, > > thanks for looking into this. > > AFAICT, the FAIL is due to the "1.1" rather than "1" for the > breakpoint. > > So apparently, the compiler optimizes a bit more, resulting in two > breakpoints instead of one. > > So, this looks like an independent issue, and I think it could be > fixed > by just accepting the 1.1, by something like replacing "$decimal" > with > "$decimal(\\.$decimal)?". > > Thanks, > - Tom Thanks for the help. I hadn't had time yet to dig into it before posting the failure. Trying to do too many things all at the same time. I tried your suggested fix. GDB didn't take the parenthesis around \\.$decimal. I made the change $decimal\\.$decimal? and that seemed to work on my system. I tried the test on my X86 box but it is not supported. Looks like the system doesn't have the ada compiler installed. Can you verify that the change works on your system and if the patch looks ok. Thanks. Carl --------------------------------------------------------- Additional Fix for gdb.ada/out_of_line_in_inlined.exp for ppc64le The command to set the breakpoing on foo_o224_021.child1.child2 with Power 10, Fedora release 36 (Thirty Six) gives the following output: (gdb) break foo_o224_021.child1.child2^M Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 locations) (gdb) run Starting program: ...gdb.ada/out_of_line_in_inlined/foo_o224_021-all Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at ...gdb.ada/out_of_line_in_inlined/foo_o224_021.adb:27^M 27 Do_Nothing (C); (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run to foo_o224_021.child1.child2 bt The issue appears to be that gdb prints the breakpoint number as 1.1 instead of the expected value of 1. It appears this is due to a compile optimization resulting in two breakpoints. This patch fixes the issue by accepting both breakpoint numbers. This patch has been tested on Power 10. --- gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp index 621b04e179b..da80a4f7dd9 100644 --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { gdb_run_cmd gdb_test "" \ - "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ + "Breakpoint $decimal\\.$decimal?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ "run to foo_o224_021.child1.child2" set opt_addr_in "($hex in)?"
On 11/28/22 20:55, Carl Love wrote: > Tom: > > On Mon, 2022-11-28 at 19:08 +0100, Tom de Vries wrote: >> On 11/28/22 18:45, Carl Love wrote: >>> Tom: >>> >>> >>> On Mon, 2022-11-28 at 17:21 +0100, Tom de Vries wrote: >>>> On powerpc64le-linux, with test-case >>>> gdb.ada/out_of_line_in_inlined.exp I run >>>> into: >>>> ... >>>> (gdb) run ^M >>>> Starting program: foo_o224_021-all ^M >>>> ^M >>>> Breakpoint 1, 0x0000000010002f48 in foo_o224_021.child1.child2 >>>> (s=...) at \ >>>> foo_o224_021.adb:24^M >>>> 24 function Child2 (S : String) return Boolean is -- >>>> STOP^M >>>> (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: \ >>>> run to foo_o224_021.child1.child2 >>>> ... >>>> >>>> The breakpoint is correctly set at the local entry point, and >>>> given >>>> that the >>>> local entry point doesn't correspond to a line number entry, the >>>> instruction >>>> address of the breakpoint is shown. >>>> >>>> The problem is that test-case doesn't expect the breakpoint >>>> address. >>>> >>>> Fix this by allowing the breakpoint address to occur. >>>> >>>> Tested on powerpc64le-linux. >>>> --- >>>> gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >>>> b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >>>> index 4bdb4decaaf..621b04e179b 100644 >>>> --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >>>> +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp >>>> @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { >>>> >>>> gdb_run_cmd >>>> gdb_test "" \ >>>> - "Breakpoint $decimal, foo_o224_021\\.child1\\.child2 >>>> \\(s=\\.\\.\\.\\).*" \ >>>> + "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 >>>> \\(s=\\.\\.\\.\\).*" \ >>>> "run to foo_o224_021.child1.child2" >>>> >>>> set opt_addr_in "($hex in)?" >>>> >>>> base-commit: 76cd77dc729b03d6b33c683323594479e33a3f9a >>> >>> The commit fixes the two test failures when run on my Power 9 >>> box. The >>> test runs without any errors on Power 9 with the fix. >>> >>> However, with the commit to fix the test on Power 10, I see the >>> following failures: >>> >>> (gdb) run >>> Starting program: /home/carll/GDB/build- >>> test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_ >>> 021-all >>> [Thread debugging using libthread_db enabled] >>> Using host libthread_db library "/lib64/libthread_db.so.1". >>> >>> Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at >>> /home/carll/GDB/binutils-gdb- >>> test/gdb/testsuite/gdb.ada/out_of_line_\ >>> in_inlined/foo_o224_021.adb:27 >>> 27 Do_Nothing (C); >>> (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run >>> to foo_o224_021.child1.child2 >>> >>> ... >>> >>> Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 >>> locations) >>> (gdb) run >>> Starting program: /home/carll/GDB/build- >>> test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_ >>> 021-minimal >>> [Thread debugging using libthread_db enabled] >>> Using host libthread_db library "/lib64/libthread_db.so.1". >>> >>> Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at >>> /home/carll/GDB/binutils-gdb- >>> test/gdb/testsuite/gdb.ada/out_of_line_\ >>> in_inlined/foo_o224_021.adb:27 >>> 27 Do_Nothing (C); >>> (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=minimal: >>> run to foo_o224_021.child1.child2 >>> >>> I backed the gdb tree up to the previous commit on Power 10 with >>> the command: >>> >>> git checkout af31506c31a59a6edbb13498d6075fa704b801cd >>> >>> and re-ran the tests. I see the same two failures. These failures >>> appear to be different than the ones that Tom reported and fixed >>> with >>> the commit. >>> >>> From discussion of previous test fixes, there may be a system >>> configuration difference here: >>> >>> My Power 10 system: Fedora release 36 (Thirty Six), gcc (GCC) >>> 12.2.1 >>> 20220819 (Red Hat 12.2.1-2) >>> >>> Power 9 system: Ubuntu 20.04.5 LTS, gcc (Ubuntu 9.4.0- >>> 1ubuntu1~20.04.1) 9.4.0 >>> >>> From what Tom reported on another test, he is running on (openSUSE >>> Leap >>> 15.4) has system gcc 7.5.0. >>> >> >> Hi Carl, >> >> thanks for looking into this. >> >> AFAICT, the FAIL is due to the "1.1" rather than "1" for the >> breakpoint. >> >> So apparently, the compiler optimizes a bit more, resulting in two >> breakpoints instead of one. >> >> So, this looks like an independent issue, and I think it could be >> fixed >> by just accepting the 1.1, by something like replacing "$decimal" >> with >> "$decimal(\\.$decimal)?". >> >> Thanks, >> - Tom > > Thanks for the help. I hadn't had time yet to dig into it before > posting the failure. Trying to do too many things all at the same > time. Yeah, I known what you mean :) > I tried your suggested fix. GDB didn't take the parenthesis around > \\.$decimal. Hmm, that sounds unexpected to me. Can you post the exact patch that didn't work for you? Note that the regexp uses the same construct in the "($hex in )?" bit. > I made the change $decimal\\.$decimal? and that seemed > to work on my system. I tried the test on my X86 box but it is not > supported. Looks like the system doesn't have the ada compiler > installed. > > Can you verify that the change works on your system and if the patch > looks ok. Thanks. > It doesn't work, as expected, because the output is: ... Breakpoint 1, foo_o224_021.child1.child2 (s=...) at /home/vries/gdb_versions/devel/binutils-gdb.git/gdb/testsuite/gdb.ada/out_of_line_in_inlined/foo_o224_021.adb:24^M ... and $decimal\\.$decimal? does not match "1". Thanks, - Tom > Carl > --------------------------------------------------------- > Additional Fix for gdb.ada/out_of_line_in_inlined.exp for ppc64le > > The command to set the breakpoing on foo_o224_021.child1.child2 with > Power 10, Fedora release 36 (Thirty Six) gives the following output: > > (gdb) break foo_o224_021.child1.child2^M > Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 locations) > (gdb) run > Starting program: ...gdb.ada/out_of_line_in_inlined/foo_o224_021-all > Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib64/libthread_db.so.1". > > Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at ...gdb.ada/out_of_line_in_inlined/foo_o224_021.adb:27^M > 27 Do_Nothing (C); > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run to foo_o224_021.child1.child2 > bt > > The issue appears to be that gdb prints the breakpoint number as 1.1 > instead of the expected value of 1. It appears this is due to a compile > optimization resulting in two breakpoints. > > This patch fixes the issue by accepting both breakpoint numbers. > > This patch has been tested on Power 10. > --- > gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > index 621b04e179b..da80a4f7dd9 100644 > --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { > > gdb_run_cmd > gdb_test "" \ > - "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ > + "Breakpoint $decimal\\.$decimal?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ > "run to foo_o224_021.child1.child2" > > set opt_addr_in "($hex in)?"
Tom: On Mon, 2022-11-28 at 21:46 +0100, Tom de Vries wrote: > > I made the change $decimal\\.$decimal? and that seemed > > to work on my system. I tried the test on my X86 box but it is not > > supported. Looks like the system doesn't have the ada compiler > > installed. > > > > Can you verify that the change works on your system and if the > > patch > > looks ok. Thanks. > > > > It doesn't work, as expected, because the output is: > ... > Breakpoint 1, foo_o224_021.child1.child2 (s=...) at > /home/vries/gdb_versions/devel/binutils- > gdb.git/gdb/testsuite/gdb.ada/out_of_line_in_inlined/foo_o224_021.adb > :24^M > ... > and $decimal\\.$decimal? does not match "1". If I use the original suggestion, here is the patch I ran: diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp index 621b04e179b..54c55bc6f7e 100644 --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { gdb_run_cmd gdb_test "" \ - "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ + "Breakpoint $decimal(\\.$decimal)?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ "run to foo_o224_021.child1.child2" set opt_addr_in "($hex in)?" then I run the test I get: make check RUNTESTFLAGS='GDB=/home/carll/bin/gdb gdb.ada/out_of_line_in_inlined.exp ' > out WARNING: Couldn't find the global config file. WARNING: Couldn't find tool init file WARNING: Couldn't find the global config file. WARNING: Couldn't find tool init file WARNING: Couldn't find the global config file. WARNING: Couldn't find tool init file WARNING: Couldn't find the global config file. WARNING: No tool specified WARNING: Couldn't find the global config file. ERROR: tcl error sourcing /home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp. ERROR: tcl error code TCL LOOKUP VARNAME decimal ERROR: can't read "decimal(\.[0-9]+)": variable isn't array while executing "gdb_test "" "Breakpoint $decimal(\\.$decimal)?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" "run to foo_o224_021.child1.child2"" ("uplevel" body line 13) invoked from within "uplevel 1 $body" invoked from within "foreach_with_prefix scenario {all minimal} { set flags [list debug \ optimize=-O2 \ additional_flags=-fgnat-encodings=$scenario] if..." (file "/home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp" line 22) invoked from within "source /home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source /home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp" invoked from within "catch "uplevel #0 source $test_file_name" msg" ERROR: ------------------------------------------- ERROR: in testcase /home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp ERROR: can't read "decimal(\.[0-9]+)": variable isn't array ERROR: tcl error code TCL LOOKUP VARNAME decimal ERROR: tcl error info: can't read "decimal(\.[0-9]+)": variable isn't array while executing "gdb_test "" "Breakpoint $decimal(\\.$decimal)?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" "run to foo_o224_021.child1.child2"" ("uplevel" body line 13) invoked from within "uplevel 1 $body" invoked from within "foreach_with_prefix scenario {all minimal} { set flags [list debug \ optimize=-O2 \ additional_flags=-fgnat-encodings=$scenario] if..." (file "/home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp" line 22) invoked from within "source /home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp" ("uplevel" body line 1) invoked from within "uplevel #0 source /home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp" invoked from within "catch "uplevel #0 source $test_file_name" msg" -------------------------------------------------- make[4]: *** [Makefile:226: do-check-single] Error 1 make[3]: *** [Makefile:161: check] Error 2 make[2]: *** [Makefile:1922: check] Error 2 make[1]: *** [Makefile:13585: check-gdb] Error 2 make: *** [Makefile:2531: do-check] Error 2 The error seems to be that it is looking for an array??? Second attempt, maybe the parenthesis need to be escaped, i.e. diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp index 621b04e179b..de1a6d053f1 100644 --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { gdb_run_cmd gdb_test "" \ - "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ + "Breakpoint $decimal\\(\\.$decimal\\)?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ "run to foo_o224_021.child1.child2" set opt_addr_in "($hex in)?" GDB seems to accept this, but I get the test failure: (gdb) break foo_o224_021.child1.child2^M Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 locations) (gdb) run Starting program: /home/carll/GDB/build-test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o224_021-all [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at /home/carll/GDB/binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined/foo_o224_021.adb:27^M 27 Do_Nothing (C); (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run to foo_o224_021.child1.child2 So it doesn't match. I am guessing it is looking for the parentheses in the string to match and of course doesn't see them. Carl
On 11/28/22 22:07, Carl Love wrote: > Tom: > > On Mon, 2022-11-28 at 21:46 +0100, Tom de Vries wrote: >>> I made the change $decimal\\.$decimal? and that seemed >>> to work on my system. I tried the test on my X86 box but it is not >>> supported. Looks like the system doesn't have the ada compiler >>> installed. >>> >>> Can you verify that the change works on your system and if the >>> patch >>> looks ok. Thanks. >>> >> >> It doesn't work, as expected, because the output is: >> ... >> Breakpoint 1, foo_o224_021.child1.child2 (s=...) at >> /home/vries/gdb_versions/devel/binutils- >> gdb.git/gdb/testsuite/gdb.ada/out_of_line_in_inlined/foo_o224_021.adb >> :24^M >> ... >> and $decimal\\.$decimal? does not match "1". > > If I use the original suggestion, here is the patch I ran: > > diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > index 621b04e179b..54c55bc6f7e 100644 > --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { > > gdb_run_cmd > gdb_test "" \ > - "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ > + "Breakpoint $decimal(\\.$decimal)?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ > "run to foo_o224_021.child1.child2" > > set opt_addr_in "($hex in)?" > > then I run the test I get: > > make check RUNTESTFLAGS='GDB=/home/carll/bin/gdb gdb.ada/out_of_line_in_inlined.exp ' > out > WARNING: Couldn't find the global config file. > WARNING: Couldn't find tool init file > WARNING: Couldn't find the global config file. > WARNING: Couldn't find tool init file > WARNING: Couldn't find the global config file. > WARNING: Couldn't find tool init file > WARNING: Couldn't find the global config file. > WARNING: No tool specified > WARNING: Couldn't find the global config file. > ERROR: tcl error sourcing /home/carll/GDB/build-test/gdb/testsuite/../../../binutils-gdb-test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp. > ERROR: tcl error code TCL LOOKUP VARNAME decimal > ERROR: can't read "decimal(\.[0-9]+)": variable isn't array Ah I see, yes the $var($index) is tcl syntax for accessing an array element. So, this should work: ${decimal}(\\.$decimal)? Thanks, - Tom
Tom: On Mon, 2022-11-28 at 21:46 +0100, Tom de Vries wrote: > On 11/28/22 20:55, Carl Love wrote: > > Tom: > > > > On Mon, 2022-11-28 at 19:08 +0100, Tom de Vries wrote: > > > On 11/28/22 18:45, Carl Love wrote: > > > > Tom: > > > > > > > > > > > > On Mon, 2022-11-28 at 17:21 +0100, Tom de Vries wrote: > > > > > On powerpc64le-linux, with test-case > > > > > gdb.ada/out_of_line_in_inlined.exp I run > > > > > into: > > > > > ... > > > > > (gdb) run ^M > > > > > Starting program: foo_o224_021-all ^M > > > > > ^M > > > > > Breakpoint 1, 0x0000000010002f48 in > > > > > foo_o224_021.child1.child2 > > > > > (s=...) at \ > > > > > foo_o224_021.adb:24^M > > > > > 24 function Child2 (S : String) return Boolean > > > > > is -- > > > > > STOP^M > > > > > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: > > > > > \ > > > > > run to foo_o224_021.child1.child2 > > > > > ... > > > > > > > > > > The breakpoint is correctly set at the local entry point, and > > > > > given > > > > > that the > > > > > local entry point doesn't correspond to a line number entry, > > > > > the > > > > > instruction > > > > > address of the breakpoint is shown. > > > > > > > > > > The problem is that test-case doesn't expect the breakpoint > > > > > address. > > > > > > > > > > Fix this by allowing the breakpoint address to occur. > > > > > > > > > > Tested on powerpc64le-linux. > > > > > --- > > > > > gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > > > b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > > > index 4bdb4decaaf..621b04e179b 100644 > > > > > --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > > > +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp > > > > > @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} > > > > > { > > > > > > > > > > gdb_run_cmd > > > > > gdb_test "" \ > > > > > - "Breakpoint $decimal, foo_o224_021\\.child1\\.child2 > > > > > \\(s=\\.\\.\\.\\).*" \ > > > > > + "Breakpoint $decimal, ($hex in > > > > > )?foo_o224_021\\.child1\\.child2 > > > > > \\(s=\\.\\.\\.\\).*" \ > > > > > "run to foo_o224_021.child1.child2" > > > > > > > > > > set opt_addr_in "($hex in)?" > > > > > > > > > > base-commit: 76cd77dc729b03d6b33c683323594479e33a3f9a > > > > > > > > The commit fixes the two test failures when run on my Power 9 > > > > box. The > > > > test runs without any errors on Power 9 with the fix. > > > > > > > > However, with the commit to fix the test on Power 10, I see the > > > > following failures: > > > > > > > > (gdb) run > > > > Starting program: /home/carll/GDB/build- > > > > test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o > > > > 224_ > > > > 021-all > > > > [Thread debugging using libthread_db enabled] > > > > Using host libthread_db library "/lib64/libthread_db.so.1". > > > > > > > > Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at > > > > /home/carll/GDB/binutils-gdb- > > > > test/gdb/testsuite/gdb.ada/out_of_line_\ > > > > in_inlined/foo_o224_021.adb:27 > > > > 27 Do_Nothing (C); > > > > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: > > > > run > > > > to foo_o224_021.child1.child2 > > > > > > > > ... > > > > > > > > Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 > > > > locations) > > > > (gdb) run > > > > Starting program: /home/carll/GDB/build- > > > > test/gdb/testsuite/outputs/gdb.ada/out_of_line_in_inlined/foo_o > > > > 224_ > > > > 021-minimal > > > > [Thread debugging using libthread_db enabled] > > > > Using host libthread_db library "/lib64/libthread_db.so.1". > > > > > > > > Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at > > > > /home/carll/GDB/binutils-gdb- > > > > test/gdb/testsuite/gdb.ada/out_of_line_\ > > > > in_inlined/foo_o224_021.adb:27 > > > > 27 Do_Nothing (C); > > > > (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: > > > > scenario=minimal: > > > > run to foo_o224_021.child1.child2 > > > > > > > > I backed the gdb tree up to the previous commit on Power 10 > > > > with > > > > the command: > > > > > > > > git checkout af31506c31a59a6edbb13498d6075fa704b801cd > > > > > > > > and re-ran the tests. I see the same two failures. These > > > > failures > > > > appear to be different than the ones that Tom reported and > > > > fixed > > > > with > > > > the commit. > > > > > > > > From discussion of previous test fixes, there may be a system > > > > configuration difference here: > > > > > > > > My Power 10 system: Fedora release 36 (Thirty Six), gcc > > > > (GCC) > > > > 12.2.1 > > > > 20220819 (Red Hat 12.2.1-2) > > > > > > > > Power 9 system: Ubuntu 20.04.5 LTS, gcc (Ubuntu 9.4.0- > > > > 1ubuntu1~20.04.1) 9.4.0 > > > > > > > > From what Tom reported on another test, he is running on > > > > (openSUSE > > > > Leap > > > > 15.4) has system gcc 7.5.0. > > > > > > > > > > Hi Carl, > > > > > > thanks for looking into this. > > > > > > AFAICT, the FAIL is due to the "1.1" rather than "1" for the > > > breakpoint. > > > > > > So apparently, the compiler optimizes a bit more, resulting in > > > two > > > breakpoints instead of one. > > > > > > So, this looks like an independent issue, and I think it could be > > > fixed > > > by just accepting the 1.1, by something like replacing "$decimal" > > > with > > > "$decimal(\\.$decimal)?". > > > > > > Thanks, > > > - Tom > > > > Thanks for the help. I hadn't had time yet to dig into it before > > posting the failure. Trying to do too many things all at the same > > time. > > Yeah, I known what you mean :) > > > I tried your suggested fix. GDB didn't take the parenthesis around > > \\.$decimal. > > Hmm, that sounds unexpected to me. Can you post the exact patch > that > didn't work for you? Note that the regexp uses the same construct > in > the "($hex in )?" bit. > > > I made the change $decimal\\.$decimal? and that seemed > > to work on my system. I tried the test on my X86 box but it is not > > supported. Looks like the system doesn't have the ada compiler > > installed. > > > > Can you verify that the change works on your system and if the > > patch > > looks ok. Thanks. > > > > It doesn't work, as expected, because the output is: > ... > Breakpoint 1, foo_o224_021.child1.child2 (s=...) at > /home/vries/gdb_versions/devel/binutils- > gdb.git/gdb/testsuite/gdb.ada/out_of_line_in_inlined/foo_o224_021.adb > :24^M > ... > and $decimal\\.$decimal? does not match "1". > Digging around looking for the definition of $decimal, I ran into: # A regular expression that matches a breakpoint hit with a breakpoint # having several code locations. set bkptno_num_re "$decimal\\.$decimal" in lib/gdb.exp. I tried changing the patch to diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp index 621b04e179b..ca3798ea9db 100644 --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { gdb_run_cmd gdb_test "" \ - "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ + "Breakpoint $bkptno_num_re, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ "run to foo_o224_021.child1.child2" set opt_addr_in "($hex in)?" That seems to work on Power 10. See if that works for you. Carl
On Mon, 2022-11-28 at 22:31 +0100, Tom de Vries wrote: > > then I run the test I get: > > > > make check RUNTESTFLAGS='GDB=/home/carll/bin/gdb > > gdb.ada/out_of_line_in_inlined.exp ' > out > > WARNING: Couldn't find the global config file. > > WARNING: Couldn't find tool init file > > WARNING: Couldn't find the global config file. > > WARNING: Couldn't find tool init file > > WARNING: Couldn't find the global config file. > > WARNING: Couldn't find tool init file > > WARNING: Couldn't find the global config file. > > WARNING: No tool specified > > WARNING: Couldn't find the global config file. > > ERROR: tcl error sourcing /home/carll/GDB/build- > > test/gdb/testsuite/../../../binutils-gdb- > > test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp. > > ERROR: tcl error code TCL LOOKUP VARNAME decimal > > ERROR: can't read "decimal(\.[0-9]+)": variable isn't array > > Ah I see, yes the $var($index) is tcl syntax for accessing an array > element. > > So, this should work: ${decimal}(\\.$decimal)? Yes, that also works for me as well as $bkptno_num_re which I mentioned in my previous email work for me. I guess my preference would be $bkptno_num_re if it also works for you. Carl
On 11/28/22 22:44, Carl Love wrote: > On Mon, 2022-11-28 at 22:31 +0100, Tom de Vries wrote: >>> then I run the test I get: >>> >>> make check RUNTESTFLAGS='GDB=/home/carll/bin/gdb >>> gdb.ada/out_of_line_in_inlined.exp ' > out >>> WARNING: Couldn't find the global config file. >>> WARNING: Couldn't find tool init file >>> WARNING: Couldn't find the global config file. >>> WARNING: Couldn't find tool init file >>> WARNING: Couldn't find the global config file. >>> WARNING: Couldn't find tool init file >>> WARNING: Couldn't find the global config file. >>> WARNING: No tool specified >>> WARNING: Couldn't find the global config file. >>> ERROR: tcl error sourcing /home/carll/GDB/build- >>> test/gdb/testsuite/../../../binutils-gdb- >>> test/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp. >>> ERROR: tcl error code TCL LOOKUP VARNAME decimal >>> ERROR: can't read "decimal(\.[0-9]+)": variable isn't array >> >> Ah I see, yes the $var($index) is tcl syntax for accessing an array >> element. >> >> So, this should work: ${decimal}(\\.$decimal)? > > Yes, that also works for me as well as $bkptno_num_re which I mentioned > in my previous email work for me. I guess my preference would be > $bkptno_num_re if it also works for you. That one doesn't work. As mentioned in the comment, it attempts to match: ... # A regular expression that matches a breakpoint hit with a breakpoint # having several code locations. set bkptno_num_re "$decimal\\.$decimal" ... in other words, "1.1" and in my case there's only one code location, in other words, "1". Thanks, - Tom
Tom: On Mon, 2022-11-28 at 23:09 +0100, Tom de Vries wrote: > Yes, that also works for me as well as $bkptno_num_re which I > mentioned > > in my previous email work for me. I guess my preference would be > > $bkptno_num_re if it also works for you. > > That one doesn't work. As mentioned in the comment, it attempts to > match: > ... > # A regular expression that matches a breakpoint hit with a > breakpoint > > # having several code locations. > > set bkptno_num_re "$decimal\\.$decimal" > ... > in other words, "1.1" and in my case there's only one code location, > in > other words, "1". Yea, right. So I think we are down to the following patch that works on my Power 10 with no regressions. It sounds like this one works for you as well. Carl ------------------------------------------ Additional Fix for gdb.ada/out_of_line_in_inlined.exp for ppc64le The command to set the breakpoing on foo_o224_021.child1.child2 with Power 10, Fedora release 36 (Thirty Six) gives the following output: (gdb) break foo_o224_021.child1.child2^M Breakpoint 1 at 0x10011870: foo_o224_021.child1.child2. (3 locations) (gdb) run Starting program: ...gdb.ada/out_of_line_in_inlined/foo_o224_021-all Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Breakpoint 1.1, foo_o224_021.child1.child2 (s=...) at ...gdb.ada/out_of_line_in_inlined/foo_o224_021.adb:27 27 Do_Nothing (C); (gdb) FAIL: gdb.ada/out_of_line_in_inlined.exp: scenario=all: run to foo_o224_021.child1.child2 The issue appears to be that gdb prints the breakpoint number as 1.1 instead of the expected value of 1. It appears this is due to a compile optimization resulting in two breakpoints. This patch fixes the issue by accepting both breakpoint numbers. This patch has been tested on Power 10. --- gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp index 621b04e179b..5698a0632a1 100644 --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { gdb_run_cmd gdb_test "" \ - "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ + "Breakpoint ${decimal}(\\.$decimal)?, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ "run to foo_o224_021.child1.child2" set opt_addr_in "($hex in)?"
On 11/29/22 00:01, Carl Love wrote: > Tom: > > On Mon, 2022-11-28 at 23:09 +0100, Tom de Vries wrote: >> Yes, that also works for me as well as $bkptno_num_re which I >> mentioned >>> in my previous email work for me. I guess my preference would be >>> $bkptno_num_re if it also works for you. >> >> That one doesn't work. As mentioned in the comment, it attempts to >> match: >> ... >> # A regular expression that matches a breakpoint hit with a >> breakpoint >> >> # having several code locations. >> >> set bkptno_num_re "$decimal\\.$decimal" >> ... >> in other words, "1.1" and in my case there's only one code location, >> in >> other words, "1". > > Yea, right. So I think we are down to the following patch that works > on my Power 10 with no regressions. It sounds like this one works for > you as well. > LGTM. Approved-By: Tom de Vries <tdevries@suse.de> Thanks, - Tom
diff --git a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp index 4bdb4decaaf..621b04e179b 100644 --- a/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp +++ b/gdb/testsuite/gdb.ada/out_of_line_in_inlined.exp @@ -34,7 +34,7 @@ foreach_with_prefix scenario {all minimal} { gdb_run_cmd gdb_test "" \ - "Breakpoint $decimal, foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ + "Breakpoint $decimal, ($hex in )?foo_o224_021\\.child1\\.child2 \\(s=\\.\\.\\.\\).*" \ "run to foo_o224_021.child1.child2" set opt_addr_in "($hex in)?"