From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id EB1983858414 for ; Mon, 28 Nov 2022 17:13:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB1983858414 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=us.ibm.com Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ASG55CK004046; Mon, 28 Nov 2022 17:13:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version : subject; s=pp1; bh=C5TzKzu6hDfW1spCQpOzOcHPyCuHwq08DlBjXPC9oqM=; b=euT2NbeN6zPvPujAkmRu6ri+NZacJr3D6jykX/f5BIOZmIisVrLt84/SOPROrCV6S5PN a6xCYGMGfuarQr1I7a8FG/R7/gvMetFK9C/aIjztAo3BmHJwAfXIocJFmK+5avNbA+yu fwJZRXRg3TX7lfrgGHpCJgrqueP1xGjx4vzF7JQBUo32dy6jUQO3jV2KTJp5pGgDGqAI ibrNx2kZ3J4dNVYKAlzJnOhQqcTccuHBsVsftiQp5cVf4J9xt8x7mbVCpIyRRitymHCF tiDgLXtT/omSMKcEikKWAzXt18ddka9T0yxjT4j+2bDWF4kLUf5Oj5GpXFv4VDjRkdnC vA== Received: from ppma05wdc.us.ibm.com (1b.90.2fa9.ip4.static.sl-reverse.com [169.47.144.27]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m3vnpeg8m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 17:13:52 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2ASHDPlx000466; Mon, 28 Nov 2022 17:13:51 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma05wdc.us.ibm.com with ESMTP id 3m3t71avm4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 17:13:51 +0000 Received: from smtpav03.dal12v.mail.ibm.com ([9.208.128.129]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2ASHDogr63177084 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 17:13:51 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A205658063; Mon, 28 Nov 2022 17:13:50 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4732B58056; Mon, 28 Nov 2022 17:13:50 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.52.7]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 28 Nov 2022 17:13:50 +0000 (GMT) Message-ID: <2f7fe4da206abe6f0a3bf9b016bda22fa20e5a4c.camel@us.ibm.com> From: Carl Love To: Tom de Vries , gdb-patches@sourceware.org Cc: Ulrich Weigand , cel@us.ibm.com Date: Mon, 28 Nov 2022 09:13:49 -0800 In-Reply-To: <20221128132354.2571-1-tdevries@suse.de> References: <20221128132354.2571-1-tdevries@suse.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: RSKRMGMofxMmC1z_zAFBuCcT5oCWVhDD X-Proofpoint-GUID: RSKRMGMofxMmC1z_zAFBuCcT5oCWVhDD Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 1 URL was un-rewritten MIME-Version: 1.0 Subject: Re: [pushed] [gdb/testsuite] Fix gdb.opt/solib-intra-step.exp for powerpc64le X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-28_14,2022-11-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 impostorscore=0 clxscore=1015 mlxlogscore=833 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211280126 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: 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