This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
powerpc64 dwarf2 frame unwinding
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Thu, 29 Jan 2004 14:13:46 +1030
- Subject: powerpc64 dwarf2 frame unwinding
On the gcc-3.4 branch, powerpc64-linux frame unwinding is currently
broken. I've been looking into why.
The basic problem is that rs6000/linux64.h defines
MD_FALLBACK_FRAME_STATE_FOR using
(FS)->retaddr_column = CR0_REGNO;
The problem with this is that the cr regs are 4 bytes (well, really they
are 4 bits, but gcc treats them as 32 bit), as the following dump of
dwarf_reg_size_table shows.
10017cf0 08080808 08080808 08080808 08080808 ................
10017d00 08080808 08080808 08080808 08080808 ................
10017d10 08080808 08080808 08080808 08080808 ................
10017d20 08080808 08080808 08080808 08080808 ................
10017d30 08080808 04040404 04040404 04101010 ................
10017d40 10101010 10101010 10101010 10101010 ................
10017d50 10101010 10101010 10101010 10080808 ................
10017d60 08000000 00000000 00000000 00000000 ................
We thus hit an abort in unwind-dw2.c:_Unwind_GetGR, since the size
needs to be 8 on powerpc64.
if (size == sizeof(_Unwind_Ptr))
return * (_Unwind_Ptr *) ptr;
if (size == sizeof(_Unwind_Word))
return * (_Unwind_Word *) ptr;
abort ();
Question: Why was CR0_REGNO chosen? More importantly, what's the right
fix? I'm thinking that using ap in MD_FALLBACK_FRAME_STATE_FOR instead
of cr0 should be OK.
--
Alan Modra
IBM OzLabs - Linux Technology Centre