This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
[Q] Register mapping in Call Frame Instructions
- From: Bharadwaj Yadavalli <bharadwaj dot yadavalli at compaq dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 18 Jan 2002 12:58:36 -0500
- Subject: [Q] Register mapping in Call Frame Instructions
- Reply-to: Bharadwaj Yadavalli <bharadwaj dot yadavalli at compaq dot com>
I am trying to use the frame unwinding rules in call frame information
recorded in .eh_frame for virtual unwinding. For example consider the
following output of readelf -wf -wF <filename>
00000050 00000018 00000054 FDE cie=00000000 pc=08048480..080484a7
LOC CFA r5 ra
08048480 r4+4 u c-4
08048481 r4+8 c-8 c-4
08048483 r5+8 c-8 c-4
08048492 r5+8 c-8 c-4
on a Linux/i386 machine. I figured out from the gcc-2.95.3 sources that the
mapping of registers used to emit call frame instructions is as follows:
eax - r0
ecx - r1
edx - r2
ebx - r3
ebp - r4
esp - r5
esi - r6
edi - r7
Q1. Is this correct?
Q2. Is there a function call (in lbgcc??) that returns this mapping - as
opposed to rummaging thru' the arch. specific files of gcc - if I
wish to interpret the CFI in a portable manner?
Thanks,
Bharadwaj