From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 76D073858C83 for ; Wed, 11 Jan 2023 18:27:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 76D073858C83 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 (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30BHgD8A026230 for ; Wed, 11 Jan 2023 18:27:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=tT0z78xEsKNiEk2DefV/nzUDiq/zF432l3nQH5ggQBc=; b=DwEX8K+nLidcMOlBpROa8M4Jn8CdaElZKGDDUEvxErwrk3KRscK7wTNc57y7mz5lJ1ZI 0lZC0gQkvUEFDuY9kGFDAK3qHJILR4i46EWWXKC5iKK6A8wc7rOl/mwUFeokTmnlaKJ5 xZPKh2tXJGmVCE+/FV7qIHDfCuSrKOLNEioKgTX4GSDlJV3wxN/NietIflQXDWzl9k8W Hao/FUJmx1brVmV//Hyyfq7aUoSgrsXTcUhndkithwdRejs064dt4y7wRvRXPkR7q6ye Skmp3lQDN35tYtrTVAQPEJzyVg5J84Q6r6ILItuGD9EB28soqQc20zautK0UvKpOP91+ Ow== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3n21r1h0cp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Jan 2023 18:27:40 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30BH0ZEn012982 for ; Wed, 11 Jan 2023 18:27:39 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma03dal.us.ibm.com (PPS) with ESMTPS id 3n1ka0wqk5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Jan 2023 18:27:39 +0000 Received: from smtpav03.dal12v.mail.ibm.com (smtpav03.dal12v.mail.ibm.com [10.241.53.102]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30BIRcXK18088300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Jan 2023 18:27:38 GMT Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8EA8A58056; Wed, 11 Jan 2023 18:27:38 +0000 (GMT) Received: from smtpav03.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 33F365803F; Wed, 11 Jan 2023 18:27:38 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.12.142]) by smtpav03.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Jan 2023 18:27:38 +0000 (GMT) Message-ID: <78f3d00844cc59549c79885a59fee4161bf021ba.camel@us.ibm.com> Subject: [PATCH 0/2] fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp From: Carl Love To: Ulrich Weigand , "will_schmidt@vnet.ibm.com" , gdb-patches@sourceware.org Cc: cel@us.ibm.com Date: Wed, 11 Jan 2023 10:27:37 -0800 In-Reply-To: <1d9b21914354bef6a290ac30673741e722e11757.camel@de.ibm.com> References: <8bce850fa1e03e798506dc170d9b57f52034a18a.camel@us.ibm.com> <86c5e9c47945894f21b1d8bf6089c730a9f0e1a5.camel@de.ibm.com> <5f9047b9582403561d7cce998cab9184167366a1.camel@de.ibm.com> <5b50668cbe882c57b8c0e9dcf5be0a253713c4c6.camel@us.ibm.com> <51c4bfc82ac72e475e10577dc60e4d75fa48767e.camel@de.ibm.com> <3ea97a8aa9cccb39299adde682f92055d1986ab3.camel@us.ibm.com> <53878e37c6e57de1d04d9c9960c5d0a74324ee6e.camel@us.ibm.com> <50474aa92ba82eff05cdc8f49001eae56be29670.camel@us.ibm.com> <89331c26795e3f7743e1e068dce43b3c2dd53008.camel@us.ibm.com> <071f24ecf9b3a2bbbe8fee7db77492eb55c5f3ff.camel@us.ibm.com> <1d9b21914354bef6a290ac30673741e722e11757.camel@de.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: RdDrn-4TlEm0GMLZR2VOoCWy64lZAOED X-Proofpoint-ORIG-GUID: RdDrn-4TlEm0GMLZR2VOoCWy64lZAOED X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-11_08,2023-01-11_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxlogscore=777 spamscore=0 priorityscore=1501 suspectscore=0 adultscore=0 mlxscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301110132 X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,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: GDB maintainers: This patch set fixes a couple of issues with the gdb.reverse tests finish-precsave.exp and finish-reverse.exp. The first issue is when doing a reverse-finish command from a function, gdb should stop at the first instruction of the source code line where the call was made. The behavior should look the same as doing a reverse-next from the first line of the function. Currently gdb stops at the last instruction in the caller source code line. Issuing reverse-step or reverse-next stops at the first instruction in the same source code line. It then requires a second reverse step or next command to reach the previous source code line in the caller. It should only require one reverse step or next command to reach the previous line. The first patch in this series fixes the above issue on X86. A number of additional testcases require updating since the output is slightly different or the test case no longer needs to issue the two reverse step/next instructions. The step_until proceedure in test gdb.reverse/step-indirect-call-thunk.exp was moved to lib/gdb.exp and renamed cmd_until. The proceedure is used to test the reverse-finish command when returning from the entry point of the function. The second issue with the reverse-finish command is that on PowerPC the reverse-finish doesn't stop at the function call. The issue is PowerPC uses two entry points. PowerPC calls the two entry points the local entry point (LEP) and the global entry point (GEP). The LEP is normally used when calling a function. The GEP is used when the table of contents (TOC) needs to be setup before continuing execution at the LEP. GDB is not handling the two entry points correctly. The second patch fixes the reverse-finish behavior on PowerPC. On systems that don't use two entry points the LEP and the GEP are the same. A new testcase is added to verify the reverse-finish command works correctly for X86 when returning from the body of a function and from the entry point. Note, the finish_backward function must handle the two scenarios slightly differently. The new testcase is expanded in the PPC patch to add tests for the two scenarios for a function called via the GEP. The initial set of tests added in the X86 patch take care of the function being called via the LEP on PowerPC. The patches have been tested on PowerPC and X86 with no new regressions. Please let me know if the patches are acceptable for mainline. Thanks.