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 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00035
00036
00037
00038
00039 typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
00040 typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
00041 #if defined(__ia64__) && defined(__hpux__)
00042 typedef unsigned _Unwind_Ptr __attribute__((__mode__(__word__)));
00043 #else
00044 typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
00045 #endif
00046 typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
00047
00048
00049
00050
00051
00052 typedef unsigned _Unwind_Exception_Class __attribute__((__mode__(__DI__)));
00053
00054
00055
00056 typedef enum
00057 {
00058 _URC_NO_REASON = 0,
00059 _URC_FOREIGN_EXCEPTION_CAUGHT = 1,
00060 _URC_FATAL_PHASE2_ERROR = 2,
00061 _URC_FATAL_PHASE1_ERROR = 3,
00062 _URC_NORMAL_STOP = 4,
00063 _URC_END_OF_STACK = 5,
00064 _URC_HANDLER_FOUND = 6,
00065 _URC_INSTALL_CONTEXT = 7,
00066 _URC_CONTINUE_UNWIND = 8
00067 } _Unwind_Reason_Code;
00068
00069
00070
00071
00072
00073
00074
00075
00076 struct _Unwind_Exception;
00077
00078 typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
00079 struct _Unwind_Exception *);
00080
00081 struct _Unwind_Exception
00082 {
00083 _Unwind_Exception_Class exception_class;
00084 _Unwind_Exception_Cleanup_Fn exception_cleanup;
00085 _Unwind_Word private_1;
00086 _Unwind_Word private_2;
00087
00088
00089
00090
00091 } __attribute__((__aligned__));
00092
00093
00094
00095
00096 typedef int _Unwind_Action;
00097
00098 #define _UA_SEARCH_PHASE 1
00099 #define _UA_CLEANUP_PHASE 2
00100 #define _UA_HANDLER_FRAME 4
00101 #define _UA_FORCE_UNWIND 8
00102 #define _UA_END_OF_STACK 16
00103
00104
00105
00106
00107
00108 struct _Unwind_Context;
00109
00110
00111 extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
00112
00113
00114
00115 typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
00116 (int, _Unwind_Action, _Unwind_Exception_Class,
00117 struct _Unwind_Exception *, struct _Unwind_Context *, void *);
00118
00119 extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
00120 _Unwind_Stop_Fn,
00121 void *);
00122
00123
00124 extern void _Unwind_DeleteException (struct _Unwind_Exception *);
00125
00126
00127
00128 extern void _Unwind_Resume (struct _Unwind_Exception *);
00129
00130
00131
00132 extern _Unwind_Reason_Code _Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
00133
00134
00135
00136
00137 typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn)
00138 (struct _Unwind_Context *, void *);
00139
00140 extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
00141
00142
00143
00144
00145
00146
00147 extern _Unwind_Word _Unwind_GetGR (struct _Unwind_Context *, int);
00148 extern void _Unwind_SetGR (struct _Unwind_Context *, int, _Unwind_Word);
00149
00150 extern _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
00151 extern void _Unwind_SetIP (struct _Unwind_Context *, _Unwind_Ptr);
00152
00153
00154 extern _Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
00155
00156 extern void *_Unwind_GetLanguageSpecificData (struct _Unwind_Context *);
00157
00158 extern _Unwind_Ptr _Unwind_GetRegionStart (struct _Unwind_Context *);
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175 typedef _Unwind_Reason_Code (*_Unwind_Personality_Fn)
00176 (int, _Unwind_Action, _Unwind_Exception_Class,
00177 struct _Unwind_Exception *, struct _Unwind_Context *);
00178
00179
00180
00181
00182 struct SjLj_Function_Context;
00183 extern void _Unwind_SjLj_Register (struct SjLj_Function_Context *);
00184 extern void _Unwind_SjLj_Unregister (struct SjLj_Function_Context *);
00185
00186 extern _Unwind_Reason_Code _Unwind_SjLj_RaiseException
00187 (struct _Unwind_Exception *);
00188 extern _Unwind_Reason_Code _Unwind_SjLj_ForcedUnwind
00189 (struct _Unwind_Exception *, _Unwind_Stop_Fn, void *);
00190 extern void _Unwind_SjLj_Resume (struct _Unwind_Exception *);
00191 extern _Unwind_Reason_Code _Unwind_SjLj_Resume_or_Rethrow (struct _Unwind_Exception *);
00192
00193
00194
00195
00196
00197 #ifdef __ia64__
00198 #include <stdlib.h>
00199
00200 static inline _Unwind_Ptr
00201 _Unwind_GetDataRelBase (struct _Unwind_Context *_C)
00202 {
00203
00204 return _Unwind_GetGR (_C, 1);
00205 }
00206
00207 static inline _Unwind_Ptr
00208 _Unwind_GetTextRelBase (struct _Unwind_Context *_C)
00209 {
00210 abort ();
00211 return 0;
00212 }
00213
00214
00215 extern _Unwind_Word _Unwind_GetBSP (struct _Unwind_Context *);
00216 #else
00217 extern _Unwind_Ptr _Unwind_GetDataRelBase (struct _Unwind_Context *);
00218 extern _Unwind_Ptr _Unwind_GetTextRelBase (struct _Unwind_Context *);
00219 #endif
00220
00221
00222
00223 extern void * _Unwind_FindEnclosingFunction (void *pc);
00224
00225 #ifdef __cplusplus
00226 }
00227 #endif