Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* PowerPC prologue analysis
@ 2008-07-28 20:13 Aleksandar Ristovski
  2008-07-28 20:29 ` Daniel Jacobowitz
  0 siblings, 1 reply; 8+ messages in thread
From: Aleksandar Ristovski @ 2008-07-28 20:13 UTC (permalink / raw)
  To: gdb

Hello,

In the code, in rs6000-tdep.c around line 3334, there is a comment stating:

  /* if != -1, fdata.saved_gpr is the smallest number of saved_gpr.
     All gpr's from saved_gpr to gpr31 are saved.  */

I am, however, witnessing a function that appears to be saving r30, but not r31 (see the disassembly below). This, in turn, causes gdb to unwind r31 from a 'saved' area even though the area does not exist.

I am not very familiar with PowerPC ABI, but from what I gather reading the "function call" section, but can not see where is it stated that if r30 is saved, then r31 must be saved too? But again, I haven't studied the ABI very thoroughly and might be missing that line. 


Just for the reference, here is the disassembly of the function:

(gdb) disassemble foo
Dump of assembler code for function foo
0xfe346aa0 <foo+0>:    stwu    r1,-16(r1)
0xfe346aa4 <foo+4>:    mflr    r0
0xfe346aa8 <foo+8>:    bl      0xfe37ca18
0xfe346aac <foo+12>:   mr      r4,r3
0xfe346ab0 <foo+16>:   stw     r30,8(r1)
0xfe346ab4 <foo+20>:   mflr    r30
0xfe346ab8 <foo+24>:   li      r5,0
0xfe346abc <foo+28>:   li      r6,0
0xfe346ac0 <foo+32>:   stw     r0,20(r1)
0xfe346ac4 <foo+36>:   lwz     r3,-176(r30)
0xfe346ac8 <foo+40>:   bl      0xfe37d738
0xfe346acc <foo+44>:   lwz     r0,20(r1)
0xfe346ad0 <foo+48>:   lwz     r30,8(r1)
0xfe346ad4 <foo+52>:   addi    r1,r1,16
0xfe346ad8 <foo+56>:   mtlr    r0
0xfe346adc <foo+60>:   blr
End of assembler dump.


Thanks,

Aleksandar Ristovski
QNX Software Systems


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-07-29 16:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-28 20:13 PowerPC prologue analysis Aleksandar Ristovski
2008-07-28 20:29 ` Daniel Jacobowitz
2008-07-28 21:08   ` Aleksandar Ristovski
2008-07-29  1:46     ` Daniel Jacobowitz
2008-07-29 14:10       ` Aleksandar Ristovski
2008-07-29 15:42         ` Aleksandar Ristovski
2008-07-29 15:47           ` Daniel Jacobowitz
2008-07-29 16:52             ` Aleksandar Ristovski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox