00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef GCC_UNWIND_DW2_FDE_H
00033 #define GCC_UNWIND_DW2_FDE_H
00034
00035 #ifndef HIDE_EXPORTS
00036 #pragma GCC visibility push(default)
00037 #endif
00038
00039 struct fde_vector
00040 {
00041 const void *orig_data;
00042 size_t count;
00043 const struct dwarf_fde *array[];
00044 };
00045
00046 struct object
00047 {
00048 void *pc_begin;
00049 void *tbase;
00050 void *dbase;
00051 union {
00052 const struct dwarf_fde *single;
00053 struct dwarf_fde **array;
00054 struct fde_vector *sort;
00055 } u;
00056
00057 union {
00058 struct {
00059 unsigned long sorted : 1;
00060 unsigned long from_array : 1;
00061 unsigned long mixed_encoding : 1;
00062 unsigned long encoding : 8;
00063
00064
00065 unsigned long count : 21;
00066 } b;
00067 size_t i;
00068 } s;
00069
00070 #ifdef DWARF2_OBJECT_END_PTR_EXTENSION
00071 char *fde_end;
00072 #endif
00073
00074 struct object *next;
00075 };
00076
00077
00078
00079
00080
00081 struct old_object
00082 {
00083 void *pc_begin;
00084 void *pc_end;
00085 struct dwarf_fde *fde_begin;
00086 struct dwarf_fde **fde_array;
00087 size_t count;
00088 struct old_object *next;
00089 };
00090
00091 struct dwarf_eh_bases
00092 {
00093 void *tbase;
00094 void *dbase;
00095 void *func;
00096 };
00097
00098
00099 extern void __register_frame_info_bases (const void *, struct object *,
00100 void *, void *);
00101 extern void __register_frame_info (const void *, struct object *);
00102 extern void __register_frame (void *);
00103 extern void __register_frame_info_table_bases (void *, struct object *,
00104 void *, void *);
00105 extern void __register_frame_info_table (void *, struct object *);
00106 extern void __register_frame_table (void *);
00107 extern void *__deregister_frame_info (const void *);
00108 extern void *__deregister_frame_info_bases (const void *);
00109 extern void __deregister_frame (void *);
00110
00111
00112 typedef int sword __attribute__ ((mode (SI)));
00113 typedef unsigned int uword __attribute__ ((mode (SI)));
00114 typedef unsigned int uaddr __attribute__ ((mode (pointer)));
00115 typedef int saddr __attribute__ ((mode (pointer)));
00116 typedef unsigned char ubyte;
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 struct dwarf_cie
00141 {
00142 uword length;
00143 sword CIE_id;
00144 ubyte version;
00145 unsigned char augmentation[];
00146 } __attribute__ ((packed, aligned (__alignof__ (void *))));
00147
00148
00149 struct dwarf_fde
00150 {
00151 uword length;
00152 sword CIE_delta;
00153 unsigned char pc_begin[];
00154 } __attribute__ ((packed, aligned (__alignof__ (void *))));
00155
00156 typedef struct dwarf_fde fde;
00157
00158
00159
00160 static inline const struct dwarf_cie *
00161 get_cie (const struct dwarf_fde *f)
00162 {
00163 return (void *)&f->CIE_delta - f->CIE_delta;
00164 }
00165
00166 static inline const fde *
00167 next_fde (const fde *f)
00168 {
00169 return (const fde *) ((char *) f + f->length + sizeof (f->length));
00170 }
00171
00172 extern const fde * _Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
00173
00174 static inline int
00175 last_fde (struct object *obj __attribute__ ((__unused__)), const fde *f)
00176 {
00177 #ifdef DWARF2_OBJECT_END_PTR_EXTENSION
00178 return (char *)f == obj->fde_end || f->length == 0;
00179 #else
00180 return f->length == 0;
00181 #endif
00182 }
00183
00184 #ifndef HIDE_EXPORTS
00185 #pragma GCC visibility pop
00186 #endif
00187
00188 #endif