This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING]Fix for prologue processing on PowerPC


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.  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]