Message ID | 20221128132354.2571-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 8192B3858C62 for <patchwork@sourceware.org>; Mon, 28 Nov 2022 13:24:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8192B3858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669641864; bh=kJx/ctZ9uZH07SJPeXx1WNc9qYBU7Eg7P0HSFZjXbWo=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=W/y8f+pzOsBYKSus+4toGmhDLrtIF2FKuoz5/thqb84QFerUWPYBphBYjLSzpnbZF PoozTo0VnT0TkTqOgTQu8GZ8O/4MLTwLnQeRA71wnCTb/6fBbQ16ro2OYKpmPpFlMm T5LRSCR7YBkkrKuHaWyJscJgruOldqqM3oyuFVmQ= 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 B4FE03858414 for <gdb-patches@sourceware.org>; Mon, 28 Nov 2022 13:23:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B4FE03858414 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 DF99521B88; Mon, 28 Nov 2022 13:23:54 +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 BAA7C13273; Mon, 28 Nov 2022 13:23:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id eWEnK2q2hGPuAgAAMHmgww (envelope-from <tdevries@suse.de>); Mon, 28 Nov 2022 13:23:54 +0000 To: gdb-patches@sourceware.org Cc: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, Carl Love <cel@us.ibm.com> Subject: [pushed] [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp for powerpc64le Date: Mon, 28 Nov 2022 14:23:54 +0100 Message-Id: <20221128132354.2571-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.opt/solib-intra-step.exp for powerpc64le
|
|
Commit Message
Tom de Vries
Nov. 28, 2022, 1:23 p.m. UTC
On powerpc64le-linux, I run into: ... (gdb) PASS: gdb.opt/solib-intra-step.exp: first-hit step^M 28 { /* first-retry */^M (gdb) FAIL: gdb.opt/solib-intra-step.exp: second-hit ... It's a bit easier to understand what happens if we do a full stepping session: ... Temporary breakpoint 1, main () at solib-intra-step-main.c:23 23 shlib_first (); (gdb) step shlib_first () at solib-intra-step-lib.c:29 29 shlib_second (0); /* first-hit */ (gdb) step 28 { /* first-retry */ (gdb) step 29 shlib_second (0); /* first-hit */ (gdb) step shlib_second (dummy=0) at solib-intra-step-lib.c:23 23 abort (); /* second-hit */ ... and compare that to the line info: ... CU: solib-intra-step-lib.c: File name Line number Starting address View Stmt solib-intra-step-lib.c 22 0x710 x solib-intra-step-lib.c 23 0x724 x solib-intra-step-lib.c 28 0x740 x solib-intra-step-lib.c 29 0x74c x solib-intra-step-lib.c 28 0x750 x solib-intra-step-lib.c 29 0x758 x solib-intra-step-lib.c 30 0x760 x solib-intra-step-lib.c - 0x77c ... So we step from line 29 to line 28, and back to line 29, which is behaviour that matches the line table. The peculiar order is due to using optimization. The problem is that the test-case doesn't expect this order. Fix this by allowing this order in the test-case. Tested on powerpc64le-linux. PR testsuite/29792 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29792 --- gdb/testsuite/gdb.opt/solib-intra-step.exp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) base-commit: ddff2a2dea5261789e1f281f3ee1b33dd5fd8892
Comments
Tom: On Mon, 2022-11-28 at 14:23 +0100, Tom de Vries wrote: > On powerpc64le-linux, I run into: > ... > (gdb) PASS: gdb.opt/solib-intra-step.exp: first-hit > step^M > 28 { /* first-retry */^M > (gdb) FAIL: gdb.opt/solib-intra-step.exp: second-hit > ... > > It's a bit easier to understand what happens if we do a full stepping > session: > ... > Temporary breakpoint 1, main () > at solib-intra-step-main.c:23 > 23 shlib_first (); > (gdb) step > shlib_first () at solib-intra-step-lib.c:29 > 29 shlib_second (0); /* first-hit */ > (gdb) step > 28 { /* first-retry */ > (gdb) step > 29 shlib_second (0); /* first-hit */ > (gdb) step > shlib_second (dummy=0) > at solib-intra-step-lib.c:23 > 23 abort (); /* second-hit */ > ... > and compare that to the line info: > ... > CU: solib-intra-step-lib.c: > File name Line number Starting > address View Stmt > solib-intra-step- > lib.c 22 0x710 x > solib-intra-step- > lib.c 23 0x724 x > solib-intra-step- > lib.c 28 0x740 x > solib-intra-step- > lib.c 29 0x74c x > solib-intra-step- > lib.c 28 0x750 x > solib-intra-step- > lib.c 29 0x758 x > solib-intra-step- > lib.c 30 0x760 x > solib-intra-step-lib.c - 0x77c > ... > > So we step from line 29 to line 28, and back to line 29, which is > behaviour > that matches the line table. The peculiar order is due to using > optimization. > The problem is that the test-case doesn't expect this order. > > Fix this by allowing this order in the test-case. > > Tested on powerpc64le-linux. > > PR testsuite/29792 > Bug: > https://sourceware.org/bugzilla/show_bug.cgi?id=29792 > > --- > gdb/testsuite/gdb.opt/solib-intra-step.exp | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > > diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp > b/gdb/testsuite/gdb.opt/solib-intra-step.exp > index 0acda6594c5..e803a7db14d 100644 > --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp > +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp > @@ -58,16 +58,35 @@ gdb_test_multiple "step" $test { > } > } > > +set in_second 0 > set test "second-hit" > gdb_test_multiple "step" $test { > + -re -wrap " first-retry .*" { > + if { $in_second } { > + fail $gdb_test_name > + } else { > + send_gdb "step\n" > + exp_continue > + } > + } > + -re -wrap " first-hit .*" { > + if { $in_second } { > + fail $gdb_test_name > + } else { > + send_gdb "step\n" > + exp_continue > + } > + } > -re -wrap " second-hit .*" { > pass $gdb_test_name > } > -re -wrap " second-retry .*" { > + set in_second 1 > send_gdb "step\n" > exp_continue > } > -re -wrap "get_pc_thunk.*" { > + set in_second 1 > send_gdb "step\n" > exp_continue > } > > base-commit: ddff2a2dea5261789e1f281f3ee1b33dd5fd8892 I ran the test with and without the commit on my Power 10 and Power 9 systems. I did not see the issue on either system before or after the fix. I am guessing there is probably a system configuration difference between my systems and yours. The fix looks fine to me in that it doesn't break anything on my systems. But I am unable to reproduce the reported failure. 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 Carl
On 11/28/22 18:13, Carl Love wrote: > Tom: > > On Mon, 2022-11-28 at 14:23 +0100, Tom de Vries wrote: >> On powerpc64le-linux, I run into: >> ... >> (gdb) PASS: gdb.opt/solib-intra-step.exp: first-hit >> step^M >> 28 { /* first-retry */^M >> (gdb) FAIL: gdb.opt/solib-intra-step.exp: second-hit >> ... >> >> It's a bit easier to understand what happens if we do a full stepping >> session: >> ... >> Temporary breakpoint 1, main () >> at solib-intra-step-main.c:23 >> 23 shlib_first (); >> (gdb) step >> shlib_first () at solib-intra-step-lib.c:29 >> 29 shlib_second (0); /* first-hit */ >> (gdb) step >> 28 { /* first-retry */ >> (gdb) step >> 29 shlib_second (0); /* first-hit */ >> (gdb) step >> shlib_second (dummy=0) >> at solib-intra-step-lib.c:23 >> 23 abort (); /* second-hit */ >> ... >> and compare that to the line info: >> ... >> CU: solib-intra-step-lib.c: >> File name Line number Starting >> address View Stmt >> solib-intra-step- >> lib.c 22 0x710 x >> solib-intra-step- >> lib.c 23 0x724 x >> solib-intra-step- >> lib.c 28 0x740 x >> solib-intra-step- >> lib.c 29 0x74c x >> solib-intra-step- >> lib.c 28 0x750 x >> solib-intra-step- >> lib.c 29 0x758 x >> solib-intra-step- >> lib.c 30 0x760 x >> solib-intra-step-lib.c - 0x77c >> ... >> >> So we step from line 29 to line 28, and back to line 29, which is >> behaviour >> that matches the line table. The peculiar order is due to using >> optimization. >> The problem is that the test-case doesn't expect this order. >> >> Fix this by allowing this order in the test-case. >> >> Tested on powerpc64le-linux. >> >> PR testsuite/29792 >> Bug: >> https://sourceware.org/bugzilla/show_bug.cgi?id=29792 >> >> --- >> gdb/testsuite/gdb.opt/solib-intra-step.exp | 19 +++++++++++++++++++ >> 1 file changed, 19 insertions(+) >> >> diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp >> b/gdb/testsuite/gdb.opt/solib-intra-step.exp >> index 0acda6594c5..e803a7db14d 100644 >> --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp >> +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp >> @@ -58,16 +58,35 @@ gdb_test_multiple "step" $test { >> } >> } >> >> +set in_second 0 >> set test "second-hit" >> gdb_test_multiple "step" $test { >> + -re -wrap " first-retry .*" { >> + if { $in_second } { >> + fail $gdb_test_name >> + } else { >> + send_gdb "step\n" >> + exp_continue >> + } >> + } >> + -re -wrap " first-hit .*" { >> + if { $in_second } { >> + fail $gdb_test_name >> + } else { >> + send_gdb "step\n" >> + exp_continue >> + } >> + } >> -re -wrap " second-hit .*" { >> pass $gdb_test_name >> } >> -re -wrap " second-retry .*" { >> + set in_second 1 >> send_gdb "step\n" >> exp_continue >> } >> -re -wrap "get_pc_thunk.*" { >> + set in_second 1 >> send_gdb "step\n" >> exp_continue >> } >> >> base-commit: ddff2a2dea5261789e1f281f3ee1b33dd5fd8892 > > I ran the test with and without the commit on my Power 10 and Power 9 > systems. I did not see the issue on either system before or after the > fix. I am guessing there is probably a system configuration difference > between my systems and yours. The fix looks fine to me in that it > doesn't break anything on my systems. But I am unable to reproduce the > reported failure. > > 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 Hi Carl, my system (openSUSE Leap 15.4) has system gcc 7.5.0, so my guess is that that is the relevant system configuration difference. Thanks, - Tom
diff --git a/gdb/testsuite/gdb.opt/solib-intra-step.exp b/gdb/testsuite/gdb.opt/solib-intra-step.exp index 0acda6594c5..e803a7db14d 100644 --- a/gdb/testsuite/gdb.opt/solib-intra-step.exp +++ b/gdb/testsuite/gdb.opt/solib-intra-step.exp @@ -58,16 +58,35 @@ gdb_test_multiple "step" $test { } } +set in_second 0 set test "second-hit" gdb_test_multiple "step" $test { + -re -wrap " first-retry .*" { + if { $in_second } { + fail $gdb_test_name + } else { + send_gdb "step\n" + exp_continue + } + } + -re -wrap " first-hit .*" { + if { $in_second } { + fail $gdb_test_name + } else { + send_gdb "step\n" + exp_continue + } + } -re -wrap " second-hit .*" { pass $gdb_test_name } -re -wrap " second-retry .*" { + set in_second 1 send_gdb "step\n" exp_continue } -re -wrap "get_pc_thunk.*" { + set in_second 1 send_gdb "step\n" exp_continue }