From: Anton Blanchard <anton@samba.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] Fix powerpc 64bit backtrace code
Date: Fri, 02 Jun 2006 02:40:00 -0000 [thread overview]
Message-ID: <20060602023824.GC1736@krispykreme> (raw)
Hi,
When backtracing a 64bit task on ppc64/Linux I notice we sometimes get
garbage for the PC:
#3 0xc00000006d337cd0 in ?? ()
#4 0x8822248200000001 in ?? ()
#5 0x4822248200000000 in ?? ()
Looking closer, it appears that gdb has missed the LR field and instead
got the CR field. On 32bit the LR is at SP + wordsize, however on 64bit
it is SP + 2*wordsize.
Knowing this I looked through the backtrace code and it looks like the
fallback is incorrect. If we fail to determine the stack layout
accurately we should make a guess based on the ABI. It turns out
tdep->lr_frame_offset was created for this purpose, but isnt used
anywhere.
Look OK?
Anton
---
2006-06-02 Anton Blanchard <anton@samba.org>
* rs6000-tdep.c (rs6000_frame_cache): Use tdep->lr_frame_offset
instead of wordsize when looking for the LR in a stack frame.
--- src/gdb/rs6000-tdep.c~ 2006-06-02 09:34:44.000000000 +1000
+++ src/gdb/rs6000-tdep.c 2006-06-02 09:33:42.000000000 +1000
@@ -2988,7 +2988,7 @@
if (make_frame)
{
fdata.frameless = 0;
- fdata.lr_offset = wordsize;
+ fdata.lr_offset = tdep->lr_frame_offset;
}
}
next reply other threads:[~2006-06-02 2:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-02 2:40 Anton Blanchard [this message]
2006-06-08 18:41 ` Daniel Jacobowitz
2007-03-27 19:05 ` Daniel Jacobowitz
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=20060602023824.GC1736@krispykreme \
--to=anton@samba.org \
--cc=gdb-patches@sourceware.org \
/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