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 19F0F3864C65 for ; Wed, 23 Mar 2022 17:49:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 19F0F3864C65 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22NGBiLP016457 for ; Wed, 23 Mar 2022 17:49:13 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f06ust42d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Mar 2022 17:49:13 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22NHbliE005775 for ; Wed, 23 Mar 2022 17:49:12 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma03wdc.us.ibm.com with ESMTP id 3ew6t9mmtc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 23 Mar 2022 17:49:12 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22NHnBhc28115350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Mar 2022 17:49:11 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3B2BF78064; Wed, 23 Mar 2022 17:49:11 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E105878069; Wed, 23 Mar 2022 17:49:10 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.211.82.62]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 23 Mar 2022 17:49:10 +0000 (GMT) Message-ID: Subject: [PATCH] Powerpc fix for gdb.base/eh_return.exp From: Carl Love To: gdb-patches@sourceware.org, cel@us.ibm.com Cc: Rogerio Alves , Will Schmidt Date: Wed, 23 Mar 2022 10:49:10 -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: N398tjxWQhs-LUnQvR8roDTs-25--ix9 X-Proofpoint-ORIG-GUID: N398tjxWQhs-LUnQvR8roDTs-25--ix9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-23_07,2022-03-23_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 mlxlogscore=995 clxscore=1015 suspectscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203230093 X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, 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: Wed, 23 Mar 2022 17:49:17 -0000 GDB maintainers: The following patch fixes the one testfailure in gdb.base/eh_return.exp on Powerpc. Basically, the output format of the disassembly for Powerpc is a little different requiring an additional test for Powerpc in the gdb_test_multiple statement. The patch has been tested on a Power 10 platform and on an Intel 64-bit system. No test regressions were found. Please let me know if this patch is acceptable for gdb mainline. 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 Intel and Power. This patch adds the needed gdb_test_multiple match statement for the Powerpc disassembly code. This patch fixes the one test failure on Powerpc. --- gdb/testsuite/gdb.base/eh_return.exp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/gdb/testsuite/gdb.base/eh_return.exp b/gdb/testsuite/gdb.base/eh_return.exp index df55dbc72da..041df5f2c84 100644 --- a/gdb/testsuite/gdb.base/eh_return.exp +++ b/gdb/testsuite/gdb.base/eh_return.exp @@ -26,7 +26,35 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ set address -1 # Get the address of the last insn in function eh2. +# 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 +# +# The dissassembly on Intel looks like: +# Dump of assembler code for function eh2: +# 0x00000000004012cf <+0>: endbr64 +# 0x00000000004012d3 <+4>: push %rbp +# ... +# 0x000000000040134d <+126>: pop %rcx +# 0x000000000040134e <+127>: jmp *%rcx +# End of assembler dump. +# +# Intel needs the address of the last jmp instruction + gdb_test_multiple "disassemble eh2" "" { + -re "($hex)\[^\r\n\]*blr.*" { + 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.32.0