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 697633858016 for ; Thu, 5 May 2022 20:07:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 697633858016 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 245JZhNo005014 for ; Thu, 5 May 2022 20:07:32 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fvmveghmj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 05 May 2022 20:07:31 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 245JwUts030928 for ; Thu, 5 May 2022 20:07:31 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma01dal.us.ibm.com with ESMTP id 3frvrams1u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 05 May 2022 20:07:31 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 245K7U2B13893896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 5 May 2022 20:07:30 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 62E6428059; Thu, 5 May 2022 20:07:30 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CAE192805E; Thu, 5 May 2022 20:07:29 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.152.172]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 5 May 2022 20:07:29 +0000 (GMT) Message-ID: <76bea9ad010a71ea5e2c7fd78f818bdb399810a6.camel@us.ibm.com> Subject: [PATCH] PowerPC: fix for gdb.base/eh_return.exp From: Carl Love To: gdb-patches@sourceware.org Cc: cel@us.ibm.com, Will Schmidt , Rogerio Alves Date: Thu, 05 May 2022 13:07:29 -0700 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: yaTifj2FQ47OiXzK_HetSZS3FEPbq092 X-Proofpoint-ORIG-GUID: yaTifj2FQ47OiXzK_HetSZS3FEPbq092 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-05_08,2022-05-05_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 suspectscore=0 bulkscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 spamscore=0 mlxlogscore=925 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205050132 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Thu, 05 May 2022 20:07:33 -0000 GDB maintainers: The following patch fixes a test failure on PowerPC. The test needs to determing the last instruction in function e2. The current parsing to get the last instruction doesn't work on PowerPC as there are three additional .long statements after the last instruction. This patch adds an entry to the gdb_test_multiple statement to parse the PowerPC assembly code to get the address. The patch has been tested on PowerPC and Intel with no regression failures. Please let me know if this patch is acceptable. Thanks. Carl Love ---------------------------------------------- PowerPC: fix for gdb.base/eh_return.exp The expect file does a disassembly of function eh2 to get the address of the last instruction of function eh2. The last instruction on PowerPC is followed by three .long entries. This requires a different pattern matching for PowerPC versus other architectures. This patch adds the needed gdb_test_multiple match statement for the PowerPC disassembly code. This patch fixes the one test failure on PowerPC. The patch has been tested on Power 10 and Intel 64. --- gdb/testsuite/gdb.base/eh_return.exp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp index df55dbc72da..ce46a3623d9 100644 --- a/gdb/testsuite/gdb.base/eh_return.exp +++ b/gdb/testsuite/gdb.base/eh_return.exp @@ -27,6 +27,22 @@ set address -1 # Get the address of the last insn in function eh2. gdb_test_multiple "disassemble eh2" "" { + -re "($hex)\[^\r\n\]*blr.*" { + # The dissassebmly on Powerpc looks like: + # 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. + # + # Powerpc needs the address for the blr instruction above. + set address $expect_out(1,string) + pass $gdb_test_name + } -re -wrap "($hex)\[^\r\n\]*\r\nEnd of assembler dump." { set address $expect_out(1,string) pass $gdb_test_name -- 2.31.1