From: Aleksandar Ristovski <aristovski@qnx.com>
To: gdb@sources.redhat.com
Subject: PowerPC prologue analysis
Date: Mon, 28 Jul 2008 20:13:00 -0000 [thread overview]
Message-ID: <g6l92j$330$1@ger.gmane.org> (raw)
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
next reply other threads:[~2008-07-28 20:10 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-28 20:13 Aleksandar Ristovski [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='g6l92j$330$1@ger.gmane.org' \
--to=aristovski@qnx.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox