|
From: <sv...@va...> - 2005-12-23 23:33:53
|
Author: sewardj
Date: 2005-12-23 23:33:51 +0000 (Fri, 23 Dec 2005)
New Revision: 5424
Log:
Make ppc64-linux stack unwinding work.
Modified:
trunk/coregrind/m_stacktrace.c
Modified: trunk/coregrind/m_stacktrace.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_stacktrace.c 2005-12-23 23:08:04 UTC (rev 5423)
+++ trunk/coregrind/m_stacktrace.c 2005-12-23 23:33:51 UTC (rev 5424)
@@ -94,8 +94,9 @@
}=20
=20
/* Otherwise unwind the stack in a platform-specific way. Trying
- to merge the x86, amd64 and ppc32 logic into a single piece of
- code is just too confusing and difficult to performance-tune. */
+ to merge the x86, amd64, ppc32 and ppc64 logic into a single
+ piece of code is just too confusing and difficult to
+ performance-tune. */
=20
# if defined(VGP_x86_linux)
=20
@@ -251,13 +252,18 @@
ips[0] =3D ip;
i =3D 1;
=20
- if (fp_min <=3D fp && fp < fp_max-4+1) {
+ if (fp_min <=3D fp && fp < fp_max-VG_WORDSIZE+1) {
=20
/* initial FP is sane; keep going */
fp =3D (((UWord*)fp)[0]);
=20
while (True) {
=20
+ /* on ppc64-linux (ppc64-elf, really), the lr save slot is 2
+ words back from sp, whereas on ppc32-elf(?) it's only one
+ word back. */
+ const Int lr_offset =3D VG_WORDSIZE=3D=3D8 ? 2 : 1;
+
if (i >=3D n_ips)
break;
=20
@@ -269,7 +275,7 @@
if (i =3D=3D 1 && lr_is_first_RA)
ip =3D lr;
else
- ip =3D (((UWord*)fp)[1]);
+ ip =3D (((UWord*)fp)[lr_offset]);
=20
fp =3D (((UWord*)fp)[0]);
ips[i++] =3D ip;
|