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 4357C3856DC5 for ; Wed, 2 Nov 2022 15:59:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4357C3856DC5 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 (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2A2FDWPq019855 for ; Wed, 2 Nov 2022 15:59:18 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=fJWxHu0oDeuDNyHcL8eHjrl96egtgBHn/QueESKSt7c=; b=tBH1RBxdvsdxlx60aFAQ7xkFW10aVjIxR6cZfDHMZq4hC2N3G70UWkjaKxHDAoI2q1nq mlJk0zvRSCXD22LwIw8V4JTc1BuZs3bLFylT+6GuzErtizvLU9IpfceO5/mqN5VLX5k0 KAg1j0UF9sUPMSpQZOeud//3ylC0KUrG89Saf8LxjXWB3mZUO2zxQDlRaraBFyl3fWKh xwop5Up2DawOEIAeVFGo1Dd6kVTdwoUldI/MxHrTCuEFTWmob0yv4VdcfsQQrgUYbz9b 64sEXD4b2wFy76VtKssoSqvYbHw5oIjVgpM2HcPGBgddXeVWU+M7RJFnPKubW3ijsk0R BQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kktvgstyc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 02 Nov 2022 15:59:18 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2A2FEoKE025299 for ; Wed, 2 Nov 2022 15:59:17 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kktvgstxb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 15:59:17 +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 2A2FnlOh004200; Wed, 2 Nov 2022 15:59:16 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma02wdc.us.ibm.com with ESMTP id 3kgutabnk4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Nov 2022 15:59:16 +0000 Received: from smtpav02.dal12v.mail.ibm.com ([9.208.128.128]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2A2FxGIn58523954 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Nov 2022 15:59:16 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 16EC558051; Wed, 2 Nov 2022 15:59:15 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 97D285805E; Wed, 2 Nov 2022 15:59:14 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.10.231]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 2 Nov 2022 15:59:14 +0000 (GMT) Message-ID: <83ed9fdfcfdb6a578ff67ab5accc00d55b077ac5.camel@us.ibm.com> From: Carl Love To: Bruno Larsen , cel@us.ibm.com Cc: "gdb-patches@sourceware.org" , Ulrich Weigand , Will Schmidt Date: Wed, 02 Nov 2022 08:59:14 -0700 In-Reply-To: References: <711495ea-57f4-276d-db50-067b29c14de6@redhat.com> <9cbed9664acd4483eb8ec5a5d1b30a4f44f56ecf.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: c0Hm50RxaxaHB9sLuZc5JeBFsi853uYy X-Proofpoint-GUID: inS1zUH6WAPcnB-N46J-H7srJgff01fk Subject: RE: Question: [PATCH] Change calculation of frame_id by amd64 epilogue unwinder X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-02_13,2022-11-02_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 mlxscore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 priorityscore=1501 phishscore=0 spamscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211020100 X-Spam-Status: No, score=-12.0 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: On Wed, 2022-11-02 at 08:36 -0700, Carl Love wrote: > Bruno: > > The idea of the patch looks fine, I just have a few style nits > > inlined. > > > > > --- > > > .../gdb.base/unwind-on-each-insn.exp | 25 > > > +++++++++++++++++-- > > > 1 file changed, 23 insertions(+), 2 deletions(-) > > > > > > diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp > > > b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp > > > index 3b48805cff8..c908a4b838e 100644 > > > --- a/gdb/testsuite/gdb.base/unwind-on-each-insn.exp > > > +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn.exp > > > @@ -41,7 +41,6 @@ if ![runto_main] then { > > > proc get_sp_and_fba { testname } { > > > with_test_prefix "get \$sp and frame base $testname" { > > > set sp [get_hexadecimal_valueof "\$sp" "*UNKNOWN*"] > > > - > > > set fba "" > > > gdb_test_multiple "info frame" "" { > > > -re -wrap ".*Stack level ${::decimal}, frame at > > > ($::hex):.*" { > > > @@ -75,6 +74,23 @@ gdb_continue_to_breakpoint "enter foo" > > > > > > # Figure out the range of addresses covered by this function. > > > set last_addr_in_foo "" > > > + > > > +# The disassembly of foo on PowerPC looks like: > > > +# Dump of assembler code for function foo: > > > +# => 0x00000000100006dc <+0>: std r31,-8(r1) > > > +# 0x00000000100006e0 <+4>: stdu r1,-48(r1) > > > +# 0x00000000100006e4 <+8>: mr r31,r1 > > > +# 0x00000000100006e8 <+12>: nop > > > +# 0x00000000100006ec <+16>: addi r1,r31,48 > > > +# 0x00000000100006f0 <+20>: ld r31,-8(r1) > > > +# 0x00000000100006f4 <+24>: blr > > > +# 0x00000000100006f8 <+28>: .long 0x0 > > > +# 0x00000000100006fc <+32>: .long 0x0 > > > +# 0x0000000010000700 <+36>: .long 0x1000180 > > > +# End of assembler dump. > > > +# > > > +# The last instruction in function foo is blr. Ignore the .long > > > +# entries following the blr instruction. > > > gdb_test_multiple "disassemble foo" "" { > > > -re "^disassemble foo\r\n" { > > > exp_continue > > > @@ -84,7 +100,11 @@ gdb_test_multiple "disassemble foo" "" { > > > exp_continue > > > } > > > > > > - -re "^...($hex) \[^\r\n\]+\r\n" { > > > + -re "^...($hex) \[<>+0- > > > 9:\s\t\]*\.long\[\s\t\]*\[^\r\n\]*\r\n" > > > { > > > > I wonder if this pattern is unnecessarily strict. Correct me if > > I'm > > wrong, but I think that no architecture has an instruction that > > starts > > with a . so this pattern could probably be simplified to > > > > ^...($hex) \[<>+0-9:\s\t\]*\.[^\r\n\]*\r\n > > And no other architectures would have a similar problem in the > > future. > > > > I'm not very knowledgeable on assembly so you may know better in > > this > > area. > > I do not know of any architectures that have a dot at the beginning > of > an instruction name. So yes the pattern could be changed as > suggested. > That will require changing the above comment as well to make it clear > we are skipping any "instruction" that starts with a dot, such as > .long. Well, I guess I should have tried the change before I sent the email! Using just a dot in the pattern doesn't work as the pattern matches on the period in the line "End of assembler dump." resulting in a failure to find the statement for the end of the dump. Argh! I will leave the pattern as it was to check for ".long". Carl