From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 24EAC3858402 for ; Mon, 29 Nov 2021 23:22:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 24EAC3858402 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1ATNGdXg028861 for ; Mon, 29 Nov 2021 23:22:07 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cn8d1r3aa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 29 Nov 2021 23:22:07 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1ATNI1r3012213 for ; Mon, 29 Nov 2021 23:22:06 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma03dal.us.ibm.com with ESMTP id 3ckcaatbt4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 29 Nov 2021 23:22:06 +0000 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1ATNM4CX18743998 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Nov 2021 23:22:04 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B9A47B2078; Mon, 29 Nov 2021 23:22:04 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6113AB206C; Mon, 29 Nov 2021 23:22:04 +0000 (GMT) Received: from sig-9-65-64-31.ibm.com (unknown [9.65.64.31]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 29 Nov 2021 23:22:04 +0000 (GMT) Message-ID: <78599c0f654cddbedf63344bf3d7b68ae34f31ce.camel@vnet.ibm.com> Subject: Re: [PATCH] gdb: Add PowerPC support to gdb.dwarf2/frame-inlined-in-outer-frame.exp From: will schmidt To: Carl Love , gdb-patches@sourceware.org Cc: Rogerio Alves Date: Mon, 29 Nov 2021 17:22:03 -0600 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-16.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: O9sH9oFMXkK2Mxdb_u_dIPSNNwLMe52p X-Proofpoint-ORIG-GUID: O9sH9oFMXkK2Mxdb_u_dIPSNNwLMe52p X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-29_11,2021-11-28_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 spamscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 bulkscore=0 adultscore=0 priorityscore=1501 impostorscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111290109 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP 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: Mon, 29 Nov 2021 23:22:10 -0000 On Mon, 2021-11-29 at 13:43 -0800, Carl Love wrote: > GDB maintainers: > Hi, > The following patch adds the needed Powerpc support to the > gdb.dwarf2/frame-inlined-in-outer-frame test. The patch adds the > needed Power instructions to the exit_0 macro. It also adds the needed > support for PowerPC Elfv1 or Elfv2 if the architecture is powerpc64. > Part of this could be combined with the patch description below. > The patch has been tested on PowerPC LE and BE as well as X86_64 with > no failures. > > Please let me know if this patch is acceptable for mainline. Thanks. > > Carl > -------------------------------------------- > gdb: Add PowerPC support to gdb.dwarf2/frame-inlined-in-outer-frame.exp > > The test does not run on PowerPC BE or LE as it is missing an #elif It does after this patch, so I'd suggest stating this as "This patch adds an #elif clause for powerpc ..." > defined for PowerPC to setup the exit_0 macro. This patch addes the needed > macro definition. It also setup the assembly code to use the elfv1 if Not an also, the macro definition includes logic to handle both elfV1 and elfV2 ABIs. > running on a PowerPC BE system and elfv2 if running on a PowerPC LE system. > > The patch has been successfully tested on both PowerPC BE, Powerpc LE and > X86_64 with no regressions. > --- > .../gdb.dwarf2/frame-inlined-in-outer-frame.S | 34 +++++++++++++++++-- > 1 file changed, 32 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S > index 9fb6e7b7164..ecb344f4426 100644 > --- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S > +++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.S > @@ -65,6 +65,16 @@ > swi 0x0 > .endm > > +#elif defined __powerpc64__ > + > +# define RETURN_ADDRESS_REGNO 65 > + > +.macro exit_0 > + li 0, __NR_exit /* r0 - contains system call number */ > + li 3, 0 /* r3 - contains first argument for sys call */ > + sc > +.endm > + > #else > # error "Unsupported architecture" > #endif > @@ -90,8 +100,28 @@ > 16 } > */ > > -.global _start > -_start: > +# if defined __powerpc64__ > + #if _CALL_ELF == 2 > + .abiversion 2 /* Tell gdb what ELF version to use. */ > + .global _start GCC currently emits .globl (without 'a'). GAS documentation suggests that .global is compatible. I would lean towards that, but no strong feelings, I just mention it as it caught my eye. > + _start: > + #else > + .abiversion 1 /* Tell gdb what ELF version to use. */ Nit, There is a whitespace variation between the two .abiversion lines above. > + .align 2 > + .global _start > + .section ".opd", "aw" > + .align 3 I see .align 3 is also emitted by gcc, so presumably this is necessary and appropriate. > + _start: > + .quad ._start,.TOC.@tocbase,0 > + .previous > + .type ._start,@function > + ._start: > + #endif > +#else > + .global _start > + _start: > +#endif > + Cosmetic nits aside, this looks reasonable to me, I defer to maintainers, of course. Thanks -Will > .cfi_startproc > > /* State that the return address for this frame is undefined. */