From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62312 invoked by alias); 27 Sep 2018 08:33:48 -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 59892 invoked by uid 89); 27 Sep 2018 08:33:44 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-12.6 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=well-known, wellknown, U*gdb-patches, gdbpatchessourcewareorg X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Sep 2018 08:33:37 +0000 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8R8TCng095818 for ; Thu, 27 Sep 2018 04:33:36 -0400 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.81]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mrubq92j8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 27 Sep 2018 04:33:36 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Thu, 27 Sep 2018 08:33:35 -0000 Received: from us1a3-smtp02.a3.dal06.isc4sb.com (10.106.154.159) by smtp.notes.na.collabserv.com (10.106.227.88) with smtp.notes.na.collabserv.com ESMTP; Thu, 27 Sep 2018 08:33:31 -0000 Received: from us1a3-mail142.a3.dal06.isc4sb.com ([10.146.38.78]) by us1a3-smtp02.a3.dal06.isc4sb.com with ESMTP id 2018092708333037-292048 ; Thu, 27 Sep 2018 08:33:30 +0000 In-Reply-To: <20180912135319.E5948D80320@oc3748833570.ibm.com> To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, kevinb@redhat.com (Kevin Buettner) Subject: Re: [PATCH] Adding support for reding signal handler frame in AIX From: "Sangamesh Mallayya" Date: Thu, 27 Sep 2018 08:33:00 -0000 References: from "Sangamesh Mallayya" at Sep 10, 2018 12:02:38 PM <20180912135319.E5948D80320@oc3748833570.ibm.com> MIME-Version: 1.0 X-KeepSent: 4C5ED06A:3C846B3C-65258315:002EABF7; type=4; name=$KeepSent X-LLNOutbound: False X-Disclaimed: 16075 X-TNEFEvaluated: 1 x-cbid: 18092708-7093-0000-0000-0000087FC944 X-IBM-SpamModules-Scores: BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.40962; ST=0; TS=0; UL=0; ISC=; MB=0.033034 X-IBM-SpamModules-Versions: BY=3.00009779; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000267; SDB=6.01094307; UDB=6.00565665; IPR=6.00874343; BA=6.00006107; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00023527; XFM=3.00000015; UTC=2018-09-27 08:33:33 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2018-09-27 05:18:12 - 6.00009020 x-cbparentid: 18092708-7094-0000-0000-00005B4ACFC3 Message-Id: Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Reason: safe X-SW-Source: 2018-09/txt/msg00872.txt.bz2 Thanks Ulrich and kevin for the review and comments. Sorry for the late reply as i was off due to personal emergency. I will have look at the suggestions and implement the new changes. Thanks, Sangamesh From: "Ulrich Weigand" To: Sangamesh Mallayya/India/IBM@IBMIN Cc: kevinb@redhat.com (Kevin Buettner), gdb-patches@sourceware.org Date: 09/12/2018 07:23 PM Subject: Re: [PATCH] Adding support for reding signal handler frame= =20 in AIX 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=20 all=3D20 > are same. > Let me know your view on this. >=20 > # 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 =3D3D get_frame_arch (this_frame); > enum bfd_endian byte_order =3D3D gdbarch_byte_order (gdbarch); > int ti; > + CORE_ADDR old_pc =3D3D pc; > =3D20 > /* Check if we can use this trampoline. */ > if (tramp->validate && !tramp->validate (tramp, this_frame, &pc)) > return 0; > - > + if ((tramp->insn[0].bytes =3D3D=3D3D TRAMP_SENTINEL_INSN) && > + (tramp->insn[1].bytes =3D3D=3D3D 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 --=20 Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com