From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id h3knFtloeWL0TQUAWB0awg (envelope-from ) for ; Mon, 09 May 2022 15:17:45 -0400 Received: by simark.ca (Postfix, from userid 112) id 4CD9B1E21F; Mon, 9 May 2022 15:17:45 -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=AeuoZ4m7; 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=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 C68F21E143 for ; Mon, 9 May 2022 15:17:44 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35EDB388E823 for ; Mon, 9 May 2022 19:17:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 35EDB388E823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1652123864; bh=OpXj+nbhucQr6WT0iX20RTxFLhD3NfkMwG5sjUWbd1I=; h=Subject:To:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=AeuoZ4m7+Cqd8YsTSO/D84eOVh0ViYdbNAhUJFmedfELcRHZwvUumH8MnE5PUOHmC mehwsYNYJDTgTxvQI4HNO8+0zBTjVdrzofW6tGp2PJ+y7MRx7BRrWnQpLEXZEiNHZw 1ZGNKMnvsBLJf3Fa7szPt4I8GGVuT44aCnprgHQ4= Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 31FF13888C4B for ; Mon, 9 May 2022 19:17:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 31FF13888C4B Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 249ItCiY000735; Mon, 9 May 2022 19:17:23 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fy8nkress-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 May 2022 19:17:23 +0000 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 249ItF5N000823; Mon, 9 May 2022 19:17:22 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3fy8nkresd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 May 2022 19:17:22 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 249JH3uJ024331; Mon, 9 May 2022 19:17:22 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma02wdc.us.ibm.com with ESMTP id 3fwgd9g7te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 May 2022 19:17:22 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 249JHLsr20513240 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 9 May 2022 19:17:21 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6976CB2067; Mon, 9 May 2022 19:17:21 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A83E7B206A; Mon, 9 May 2022 19:17:20 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.152.172]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 9 May 2022 19:17:20 +0000 (GMT) Message-ID: Subject: [PATCH V2] PowerPC: fix for gdb.base/eh_return.exp To: will schmidt , Pedro Alves , Kevin Buettner , gdb-patches@sourceware.org Date: Mon, 09 May 2022 12:17:20 -0700 In-Reply-To: <099c8f8d8729a0051f83a034d62c18f03c789167.camel@vnet.ibm.com> References: <76bea9ad010a71ea5e2c7fd78f818bdb399810a6.camel@us.ibm.com> <20220506110826.5e16c8b6@f35-zws-1> <70a877cc-2f35-3924-6717-9d519c2730c5@palves.net> <099c8f8d8729a0051f83a034d62c18f03c789167.camel@vnet.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: U-ImzHhepSClgAiiZ2nomE3EAdmCxtyi X-Proofpoint-ORIG-GUID: RhQsrQrr3peS9nmsnJrkO469b5vabZ-z X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-09_05,2022-05-09_02,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 phishscore=0 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205090100 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 Cc: Rogerio Alves Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Will, Pedro, Kevin, GDB maintainers: Sorry, resend, the first attempt was missing the mailing list. I have updated the patch per the comments from Will. The new version of the patch uses a PowerPC specific gcc option to suppress the generation of the Traceback Table information. The Traceback information is contained in the .long statements following the last instruction in the function. Now the existing test to locate the last instruction in the function works without any changes. Note, the use of the gcc mtraceback option is not valid on other architectures. I have tested the patch on Power 10 and Intel. Please let me know if this patch is acceptable. Thanks for the input and help with the patch. Carl Love ----------------------------------------------------------------- PowerPC: fix for gdb.base/eh_return.exp Disable the Traceback Table generation on PowerPC. The Traceback Table consists of multiple .long statement following the final instruction in the function. Generation of the .long statements needs to be disabled with the PowerPC specific gcc compiler option -mtraceback=no so the test will correctly locate the address of the bclr instruction before the statement "End of assembler dump." --- gdb/testsuite/gdb.base/eh_return.exp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp index df55dbc72da..3a49464af63 100644 --- a/gdb/testsuite/gdb.base/eh_return.exp +++ b/gdb/testsuite/gdb.base/eh_return.exp @@ -18,8 +18,30 @@ standard_testfile +if {[istarget "powerpc*"]} then { + # PowerPC generates a Traceback Table following each function by default. + # The .long statements following the function contain the Traceback Table + # information. For example: + # Dump of assembler code for function eh2: + # 0x00000000100009e0 <+0>: lis r2,4098 + # ... + # 0x0000000010000b04 <+292>: add r1,r1,r10 + # 0x0000000010000b08 <+296>: blr + # 0x0000000010000b0c <+300>: .long 0x0 + # 0x0000000010000b10 <+304>: .long 0x1000000 + # 0x0000000010000b14 <+308>: .long 0x1000180 + # End of assembler dump. + # + # Disable the Traceback Table generation, using the PowerPC specific + # gcc option, so the test gdb_test_multiple "disassemble eh2" will match + # the blr instruction not the .long statement. + set compile_flags {debug nopie additional_flags=-mtraceback=no} +} else { + set compile_flags {debug nopie} +} + if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ - {debug nopie}]} { + $compile_flags]} { return -1 } -- 2.31.1