This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING]Fix for prologue processing on PowerPC
- From: Kevin Buettner <kevinb at redhat dot com>
- To: Nikola Prica <nikola dot prica at rt-rk dot com>
- Cc: gdb-patches at sourceware dot org, "Ananthakrishna Sowda (asowda)" <asowda at cisco dot com>, "Ivan Baev (ibaev)" <ibaev at cisco dot com>, 'Nemanja Popov' <nemanja dot popov at rt-rk dot com>, Djordje Todorovic <Djordje dot Todorovic at rt-rk dot com>
- Date: Wed, 8 Nov 2017 09:58:50 -0700
- Subject: Re: [PING]Fix for prologue processing on PowerPC
- Authentication-results: sourceware.org; auth=none
- References: <f90d189e-7ec5-34f9-c776-8af42a3c07a6@rt-rk.com> <e3274bee-eb2d-3706-3af0-59f28c9c0899@rt-rk.com>
See:
https://sourceware.org/ml/gdb-patches/2017-10/msg00098.html
Kevin
On Thu, 26 Oct 2017 12:02:19 +0200
Nikola Prica <nikola.prica@rt-rk.com> wrote:
> 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
> > watchdog_force_here () function, GDB couldn't print full back trace
> > because GDB couldn't unwind PC from the watchdog fucntion.
> >
> > The problem is introduced with the following patch:
> >
> > https://sourceware.org/ml/gdb-patches/2008-08/msg00245.html
> >
> > In function skip_prologue(), shifted lr_reg makes below condition always
> > false because non-shifted lr_reg value is expected to be checked.
> >
> > else if (lr_reg >= 0 &&
> > /* std Rx, NUM(r1) || stdu Rx, NUM(r1) */
> > (((op & 0xffff0000) == (lr_reg | 0xf8010000)) ||
> > /* stw Rx, NUM(r1) */
> > ((op & 0xffff0000) == (lr_reg | 0x90010000)) ||
> > /* stwu Rx, NUM(r1) */
> > ((op & 0xffff0000) == (lr_reg | 0x94010000))))
> >
> > 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.
> >
> > 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
> > called, but I don't have valid ppc board to try this. I have tried this
> > code on simple test case with few functions in back trace. The back
> > trace is printed correctly with and without this fix, but the difference
> > between those two runs is that the body of the upper condition was
> > visited with this patch. After visiting the body there was no need to
> > look for PC counter in next frames nor to use unwind directives.