Re: [RFC] pb unwinding from pthread_cond_wait on ppc-linux (RFA?)

Joel Brobecker
2004-12-08T16:32:16Z

> > I think that the reason that gdb-6.0 worked is a bit related to luck.
> > Here are the first few instructions of pthread_cond_timedwait():
> >
> > 0x0ffe45b4 <pthread_cond_timedwait+0>: stwu r1,-128(r1)
> > 0x0ffe45b8 <pthread_cond_timedwait+4>: mflr r8
> > 0x0ffe45bc <pthread_cond_timedwait+8>: lis r7,15258
> > 0x0ffe45c0 <pthread_cond_timedwait+12>: bl 0xffed01c
> > 0x0ffe45c4 <pthread_cond_timedwait+16>: stw r8,132(r1)
>
> What's the bl actually calling?

(strange that the information appears to have gotten lost somewhere
during the copy/paste). According to GDB:

bl 0xffed01c <stack_used+8>

But then, when I try to look deeper:

(gdb) disass &stack_used
Dump of assembler code for function stack_used:
0x0ffed014 <stack_used+0>: addic r2,r2,-5280
0x0ffed018 <stack_used+4>: addic r2,r2,-5280
End of assembler dump.

ie, stack_used+8 does not exist... However:

(gdb) x /10i 0xffed01c
0xffed01c <stack_used+8>: blrl
0xffed020 <stack_used+12>: .long 0x10f10
0xffed024 <stack_used+16>: .long 0x0
0xffed028 <stack_used+20>: .long 0x0
0xffed02c <stack_used+24>: twi 31,r30,-12756
0xffed030 <stack_used+28>: twi 31,r30,1928
0xffed034 <stack_used+32>: twi 31,r30,-24472
0xffed038 <stack_used+36>: twi 31,r30,-12280
0xffed03c <stack_used+40>: twi 31,r30,-11904
0xffed040 <stack_used+44>: twi 31,r30,-12276

Gah? Do I understand correctly that the code jumps to 0xffed01c
only to return back?

--
Joel