From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67381 invoked by alias); 26 Oct 2017 10:02:28 -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 67363 invoked by uid 89); 26 Oct 2017 10:02:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=stw, unwinding X-HELO: mail.rt-rk.com Received: from mx2.rt-rk.com (HELO mail.rt-rk.com) (89.216.37.149) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 26 Oct 2017 10:02:25 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id 8CFC61A1DDB; Thu, 26 Oct 2017 12:02:23 +0200 (CEST) Received: from [10.10.13.98] (rtrkw512-lin.domain.local [10.10.13.98]) by mail.rt-rk.com (Postfix) with ESMTPSA id 649B91A1DCA; Thu, 26 Oct 2017 12:02:23 +0200 (CEST) Subject: [PING]Fix for prologue processing on PowerPC From: Nikola Prica To: gdb-patches@sourceware.org Cc: "Ananthakrishna Sowda (asowda)" , "Ivan Baev (ibaev)" , 'Nemanja Popov' , Djordje Todorovic References: Message-ID: Date: Thu, 26 Oct 2017 10:02:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-SW-Source: 2017-10/txt/msg00801.txt.bz2 Can someone please take a look into this? Thanks, Nikola Prica On 22.09.2017. 14:11, Nikola Prica wrote: > After analyzing dump of ppc program, whose crash occurred after=20 > watchdog_force_here () function, GDB couldn't print full back trace=20 > because GDB couldn't unwind PC from the watchdog fucntion. >=20 > The problem is introduced with the following patch: >=20 > https://sourceware.org/ml/gdb-patches/2008-08/msg00245.html >=20 > In function skip_prologue(), shifted lr_reg makes below condition always= =20 > false because non-shifted lr_reg value is expected to be checked. >=20 > =C2=A0=C2=A0 else if (lr_reg >=3D 0 && > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* std Rx, NUM(r1) || stdu Rx= , NUM(r1) */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (((op & 0xffff0000) =3D=3D (l= r_reg | 0xf8010000)) || > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* stw Rx, NUM(r1) */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((op & 0xffff0000) =3D=3D (lr= _reg | 0x90010000)) || > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* stwu Rx, NUM(r1) */ > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((op & 0xffff0000) =3D=3D (lr= _reg | 0x94010000)))) >=20 > Before this fix unwinding was able to work because it relied on unwind > directives or on some of the next frames to find PC. Problem came with > watchdog_force_here() function which didn't contain unwind directives. >=20 > I wasn't able to produce test case that would show improvements for end > user. I suppose that changes would be visible if watchdog event was=20 > called, but I don't have valid ppc board to try this. I have tried this=20 > code on simple test case with few functions in back trace. The back=20 > trace is printed correctly with and without this fix, but the difference= =20 > between those two runs is that the body of the upper condition was=20 > visited with this patch. After visiting the body there was no need to=20 > look for PC counter in next frames nor to use unwind directives.