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