Daily bump.
[official-gcc.git] / libgcc / config / darwin10-unwind-find-enc-func.c
blobb08396c5f1b510436c09d164025943a1c46c4266
1 #include "libgcc_tm.h"
3 /* This shim is special, it needs to be built for Mac OSX 10.6
4 regardless of the current system version.
5 We must also build it to use the unwinder layout that was
6 present for 10.6 (and not update that).
7 So we copy the referenced structures from unwind-dw2-fde.h
8 to avoid pulling in newer system headers and/or changed
9 layouts. */
10 struct dwarf_eh_bases
12 void *tbase;
13 void *dbase;
14 void *func;
17 typedef int sword __attribute__ ((mode (SI)));
18 typedef unsigned int uword __attribute__ ((mode (SI)));
20 /* The first few fields of an FDE. */
21 struct dwarf_fde
23 uword length;
24 sword CIE_delta;
25 unsigned char pc_begin[];
26 } __attribute__ ((packed, aligned (__alignof__ (void *))));
28 typedef struct dwarf_fde fde;
30 extern const fde * _Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
32 void *
33 _darwin10_Unwind_FindEnclosingFunction (void *pc)
35 struct dwarf_eh_bases bases;
36 const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
37 if (fde)
38 return bases.func;
39 return (void *) 0;