From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6j2jEEJkdWLZvgQAWB0awg (envelope-from ) for ; Fri, 06 May 2022 14:09:06 -0400 Received: by simark.ca (Postfix, from userid 112) id 2D9861E21F; Fri, 6 May 2022 14:09:06 -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=jMdzj7Iv; 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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.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 23BE81E01D for ; Fri, 6 May 2022 14:09:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AD3B73954437 for ; Fri, 6 May 2022 18:09:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AD3B73954437 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1651860544; bh=g11O66jUwy74QYRXq7t6bx4/Dozbmw7PYKVTsr0lCuY=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=jMdzj7Iv+IXWOj32EdnVrmPLza3+PoCy8yVXB1rrG/+3Kz8uT7bUIGyyU7/u3VWIn S/1tADFf52l8q1UYX5a9GjyduwjfDwA2OrTThs4L7ayIAs670Ytf+mWDWDNYQ4+9/U 3kNLWQoPZpwsNwUq1HdApb+SdMZfR/CQMaECXVOU= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 61F7C395563D for ; Fri, 6 May 2022 18:08:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 61F7C395563D Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-259-Egd4Pm9ROnq8Dhpk1nXT9Q-1; Fri, 06 May 2022 14:08:29 -0400 X-MC-Unique: Egd4Pm9ROnq8Dhpk1nXT9Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 57BCC85A5BE; Fri, 6 May 2022 18:08:29 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.17.65]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D10F71121315; Fri, 6 May 2022 18:08:28 +0000 (UTC) Date: Fri, 6 May 2022 11:08:26 -0700 To: Carl Love via Gdb-patches Subject: Re: [PATCH] PowerPC: fix for gdb.base/eh_return.exp Message-ID: <20220506110826.5e16c8b6@f35-zws-1> In-Reply-To: <76bea9ad010a71ea5e2c7fd78f818bdb399810a6.camel@us.ibm.com> References: <76bea9ad010a71ea5e2c7fd78f818bdb399810a6.camel@us.ibm.com> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Kevin Buettner via Gdb-patches Reply-To: Kevin Buettner Cc: Rogerio Alves Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi Carl, On Thu, 05 May 2022 13:07:29 -0700 Carl Love via Gdb-patches wrote: > 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 > -- I'd prefer to see a solution which doesn't explicitly test for PPC's blr or any other architecture specific instruction. It seems to me that the problem results from the .long entries following the last executable instruction. My guess is that these would be problematic on other architectures too. I think it'd be better to write an RE which skips all trailing occurrences of $hex\[^\r\n\]*\.long\[^\r\n\]* . Kevin