From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id CDBCD385B1BE for ; Mon, 28 Nov 2022 17:17:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CDBCD385B1BE Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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-out2.suse.de (Postfix) with ESMTPS id 17A801FDCA; Mon, 28 Nov 2022 17:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1669655821; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4VyJkSOUILmCIQh+AQzU3ztR//43d0TEy6ksyHF6dIE=; b=y/eT+V4AC5ihXZ8NuswVGUtIi3YwNuRQ0f3s9CHLb+mj8/f/yhtRVSD/MY98lBCjRInjLy VwFOTyPNsCPvAXQCC48uQBdsbqK29P/BbCxRM7CsVbg85HgzRBoJ/6KT9tzULOwxyckiLH D9fajVEajM7j+wtCeH3NELZLdRT07is= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1669655821; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4VyJkSOUILmCIQh+AQzU3ztR//43d0TEy6ksyHF6dIE=; b=itzRi5lxTxFhPEDj7vUHLsW2VpTvOrED1kdrm25Dp3klnjhWQDYtjPjdUJvPm3PVPfjfl2 20DXlkBR6O7PflAg== 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 EBFCF13273; Mon, 28 Nov 2022 17:17:00 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xCcMOAzthGOffwAAMHmgww (envelope-from ); Mon, 28 Nov 2022 17:17:00 +0000 Message-ID: <7d3590e8-3ab8-58d2-00d2-ff964a16a20c@suse.de> Date: Mon, 28 Nov 2022 18:17:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [pushed] [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp for powerpc64le Content-Language: en-US To: Carl Love , gdb-patches@sourceware.org Cc: Ulrich Weigand References: <20221128132354.2571-1-tdevries@suse.de> <2f7fe4da206abe6f0a3bf9b016bda22fa20e5a4c.camel@us.ibm.com> From: Tom de Vries In-Reply-To: <2f7fe4da206abe6f0a3bf9b016bda22fa20e5a4c.camel@us.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,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 List-Id: 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