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 B65E53858D37 for ; Tue, 21 Mar 2023 03:17:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B65E53858D37 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 (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32KNodOQ017745; Tue, 21 Mar 2023 03:17:05 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 : mime-version : content-transfer-encoding : subject; s=pp1; bh=5Vkj1cy1A+gqF4w2QB/FbbYuceiz2ZLf6GLQjVlzHjA=; b=M7YpNlKOYJR6sFSFty3/f3uewokjzePrWpkJSnbkNXwLByZ8R2DhqNT3HxqqdgD/zL9q P62YD/Rorhmm6FL2Aslo9doO3Bx2XZwlkyxDFg2bmf1lJNIuzh9l12L9sLXHW1TwOdl1 SHC4FwNLeQLEYLT1p14O5M6tC2Y6n5PgMr74zF0KsZl9VJPa2cBdjgvhJgraX1u9wkxA ZiJgolkeh8t7BTlwbMsLUK0p9wPfIV9qAuS+zJ+fqeorJLd/fDLyiPj0jQCsqtpAq6F2 +n47+LzwtCkM7ftADmBiYiZ8cUVwELHcxMtrSSnjlzsXE8tH3NtsX6MwvDEVoGFOU8qH 9g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pf1h2u5w8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Mar 2023 03:17:05 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32L3E5oX017915; Tue, 21 Mar 2023 03:17:04 GMT 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 3pf1h2u5vx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Mar 2023 03:17:04 +0000 Received: from pps.filterd (ppma05wdc.us.ibm.com [127.0.0.1]) by ppma05wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32L3A2TH021504; Tue, 21 Mar 2023 03:17:04 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([9.208.130.99]) by ppma05wdc.us.ibm.com (PPS) with ESMTPS id 3pd4x709y2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 21 Mar 2023 03:17:04 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32L3H2mZ29360840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Mar 2023 03:17:02 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B588D58051; Tue, 21 Mar 2023 03:17:02 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2EE8B5805A; Tue, 21 Mar 2023 03:17:02 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.103.7]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 21 Mar 2023 03:17:02 +0000 (GMT) Message-ID: From: Carl Love To: Tom de Vries , Ulrich Weigand , "gdb-patches@sourceware.org" , Bruno Larsen , "pedro@palves.net" Cc: luis.machado@arm.com, cel@us.ibm.com Date: Mon, 20 Mar 2023 20:17:01 -0700 In-Reply-To: <4725509beea4800de5e7d657e585d09137e9ee74.camel@us.ibm.com> References: <7a494157-494f-6adf-d533-bf373b0f054f@redhat.com> <71aa635593df0677811afb85409aa190bcfa4f6a.camel@us.ibm.com> <15864a6b87b25c93e99a28149f23138267735f2a.camel@us.ibm.com> <041f62e9f26fd4a536bc90c34f072985582e6237.camel@de.ibm.com> <46c2c756475ba5923d7eed97996632a08285dd42.camel@us.ibm.com> <65861786-069e-53a1-ca17-a525b6629c95@suse.de> <5be0c849abeef84d34a6ff255fb2705ca5dcb035.camel@us.ibm.com> <27caff18b9e133583ba147a21cdd997a0a580828.camel@de.ibm.com> <4195b7b1fe6120e71310a1036841f141b9d1199e.camel@us.ibm.com> <4725509beea4800de5e7d657e585d09137e9ee74.camel@us.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-ORIG-GUID: nz5XySCO7WV27VgnvXAUfDoNqQiCsEQn X-Proofpoint-GUID: WxrLUXBXthLOi0w5tS7JynfpZmvAizoY Subject: RE: [PATCH 2/2 ver2] PowerPC: fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-20_18,2023-03-20_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303210023 X-Spam-Status: No, score=-10.7 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, Luis, GDB maintainers: The recent commit to fix the reverse-finish command on PowerPC introduced some regression test failures on X86 and Arm. The following patch fixes the failures. The fix has been tested on Power10 and X86. Please let me know if this patch is acceptable. Thanks. Carl ---------------------------------------- PowerPC: regression fix for reverse-finish command. The recent commit: commit 2a8339b71f37f2d02f5b2194929c9d702ef27223 Author: Carl Love Date: Thu Mar 9 16:10:18 2023 -0500 PowerPC: fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-rev\ erse.exp PPC64 multiple entry points, a normal entry point and an alternate entry point. The alternate entry point is to setup the Table of Contents (TOC) register before continuing at the normal entry point. When the TOC is already valid, the normal entry point is used, this is typically the case. The alternate entry point is typically referred to as the global entry point (GEP) in IBM. The normal entry point is typically referred to as the local entry point (LEP). ..... Is causing regression failures on on PowerPC platforms. The regression failures are in tests: gdb.reverse/finish-precsave.exp gdb.btrace/tailcall.exp gdb.mi/mi-reverse.exp gdb.btrace/step.exp gdb.reverse/until-precsave.exp gdb.reverse/finish-reverse.exp gdb.btrace/tailcall-only.exp The issue is in gdb/infcmd.c, function finish_command. The value of the two new variables ALT_ENTRY_POINT and ENTRY_POINT are being initializezed to SAL.PC. However, SAL has just been declared. The value of SAL.PC is zero at this point. The intialization of ALT_ENTRY_POINT and ENTRY_POINT needs to be after the initialization of SAL. This patch moves the initialization of ALT_ENTRY_POINT and ENTRY_POINT variables to fix the regression failures. The patch has been tested on Power10 and on X86. --- gdb/infcmd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/infcmd.c b/gdb/infcmd.c index f46461512fe..e2032d18564 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1710,8 +1710,8 @@ finish_backward (struct finish_command_fsm *sm) struct thread_info *tp = inferior_thread (); CORE_ADDR pc; CORE_ADDR func_addr; - CORE_ADDR alt_entry_point = sal.pc; - CORE_ADDR entry_point = alt_entry_point; + CORE_ADDR alt_entry_point; + CORE_ADDR entry_point; frame_info_ptr frame = get_selected_frame (nullptr); struct gdbarch *gdbarch = get_frame_arch (frame); @@ -1721,6 +1721,8 @@ finish_backward (struct finish_command_fsm *sm) error (_("Cannot find bounds of current function")); sal = find_pc_line (func_addr, 0); + alt_entry_point = sal.pc; + entry_point = alt_entry_point; if (gdbarch_skip_entrypoint_p (gdbarch)) /* Some architectures, like PowerPC use local and global entry points. -- 2.37.2