From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116108 invoked by alias); 12 Sep 2018 13:53:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 116094 invoked by uid 89); 12 Sep 2018 13:53:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.0 required=5.0 tests=AWL,BAYES_20,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=well-known, wellknown, 2018-08-27, sk:aix_tra X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 12 Sep 2018 13:53:35 +0000 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8CDn2Tj012538 for ; Wed, 12 Sep 2018 09:53:33 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mf1jmqqj0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 12 Sep 2018 09:53:33 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 12 Sep 2018 14:53:23 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 12 Sep 2018 14:53:22 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8CDrKin64291042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 12 Sep 2018 13:53:20 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 83C414C04E; Wed, 12 Sep 2018 16:53:11 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7299E4C040; Wed, 12 Sep 2018 16:53:11 +0100 (BST) Received: from oc3748833570.ibm.com (unknown [9.152.213.40]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 12 Sep 2018 16:53:11 +0100 (BST) Received: by oc3748833570.ibm.com (Postfix, from userid 1000) id E5948D80320; Wed, 12 Sep 2018 15:53:19 +0200 (CEST) Subject: Re: [PATCH] Adding support for reding signal handler frame in AIX To: sangamesh.swamy@in.ibm.com (Sangamesh Mallayya) Date: Wed, 12 Sep 2018 13:53:00 -0000 From: "Ulrich Weigand" Cc: kevinb@redhat.com (Kevin Buettner), gdb-patches@sourceware.org In-Reply-To: from "Sangamesh Mallayya" at Sep 10, 2018 12:02:38 PM MIME-Version: 1.0 x-cbid: 18091213-0012-0000-0000-000002A7BE69 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091213-0013-0000-0000-000020DC0080 Message-Id: <20180912135319.E5948D80320@oc3748833570.ibm.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit X-SW-Source: 2018-09/txt/msg00360.txt.bz2 Sangamesh Mallayya wrote: > Yes. Thanks! > Earlier code was calling validate function twice which wasn't required. > We can remove that AIX ifdef and i have made the below changes. Rest all=20 > are same. > Let me know your view on this. > > # diff -u tramp-frame.c_orig tramp-frame.c > --- tramp-frame.c_orig 2018-08-27 03:25:49 +0000 > +++ tramp-frame.c 2018-09-07 10:20:09 +0000 > @@ -86,11 +86,15 @@ > struct gdbarch *gdbarch =3D get_frame_arch (this_frame); > enum bfd_endian byte_order =3D gdbarch_byte_order (gdbarch); > int ti; > + CORE_ADDR old_pc =3D pc; > =20 > /* Check if we can use this trampoline. */ > if (tramp->validate && !tramp->validate (tramp, this_frame, &pc)) > return 0; > - > + if ((tramp->insn[0].bytes =3D=3D TRAMP_SENTINEL_INSN) && > + (tramp->insn[1].bytes =3D=3D AIX_TRAMP_SENTINEL_INSN) && > + (old_pc < 0x1000000)) > + return pc; I agree with Kevin that code like this shouldn't be in common code. It looks like the underlying problem is that tramp-frame isn't a good match for what you're trying to do: tramp-frame tries to detect trampolines by matching well-known *code sequences*. However, you don't actually have any code sequence to match, but want to identify trampolines solely by their PC. Since you pass no code sequence to the tramp-frame matcher, it will actually never match. I'd suggest the best way forward is to not actually use tramp-frame at all then, but just write your own matcher based directly on a trad-frame cache. An example to look at might be s390_stub_frame_unwind. Along those lines, you can implement a sniffer that checks for special PC value (and possibly a backchain zero check in addition), and then implement this_id and prev_register routines based on a trad-frame register cache (you should be able to use the aix_sigtramp_cache routine in your patch as-is for that part). Bye, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com