[Q] Register mapping in Call Frame Instructions

Bharadwaj Yadavalli bharadwaj.yadavalli@compaq.com
Fri Jan 18 12:00:00 GMT 2002


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



More information about the Gcc mailing list