From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /RYDIs0hGWTVlxUAWB0awg (envelope-from ) for ; Mon, 20 Mar 2023 23:17:33 -0400 Received: by simark.ca (Postfix, from userid 112) id 7F7731E223; Mon, 20 Mar 2023 23:17:33 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=mSlhPxOs; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 819B11E0D2 for ; Mon, 20 Mar 2023 23:17:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3465E385842A for ; Tue, 21 Mar 2023 03:17:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3465E385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679368650; bh=5Vkj1cy1A+gqF4w2QB/FbbYuceiz2ZLf6GLQjVlzHjA=; h=To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=mSlhPxOsQ/cQAyoOKBGzNG9K5I9CYWnrwyAlFCJHFsv1xGjbN4o21iYnBMonLys1S MTLGk0dlKsSERddtHsgmXlysVae2Mz2jLLsIJ3razLe4xbs5Tp0USI8dqdJATL7iJZ pwlN8aKwWHfxr1cDVm+L/zlGqI+wlwj3y81nG2pM= 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 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 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: 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-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Carl Love via Gdb-patches Reply-To: Carl Love Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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