00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __UNWIND_CXX_H
00025 #define __UNWIND_CXX_H 1
00026
00027
00028
00029 #include <typeinfo>
00030 #include <exception>
00031 #include <cstddef>
00032 #include "unwind.h"
00033
00034 namespace __cxxabiv1
00035 {
00036
00037
00038
00039
00040
00041 struct __cxa_exception
00042 {
00043
00044 std::type_info *exceptionType;
00045 void (*exceptionDestructor)(void *);
00046
00047
00048
00049 std::unexpected_handler unexpectedHandler;
00050 std::terminate_handler terminateHandler;
00051
00052
00053 __cxa_exception *nextException;
00054
00055
00056
00057 int handlerCount;
00058
00059
00060
00061 int handlerSwitchValue;
00062 const unsigned char *actionRecord;
00063 const unsigned char *languageSpecificData;
00064 void *catchTemp;
00065 void *adjustedPtr;
00066
00067
00068 _Unwind_Exception unwindHeader;
00069 };
00070
00071
00072 struct __cxa_eh_globals
00073 {
00074 __cxa_exception *caughtExceptions;
00075 unsigned int uncaughtExceptions;
00076 };
00077
00078
00079
00080
00081
00082
00083 extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
00084 extern "C" __cxa_eh_globals *__cxa_get_globals_fast () throw();
00085
00086
00087 extern "C" void *__cxa_allocate_exception(std::size_t thrown_size) throw();
00088
00089
00090 extern "C" void __cxa_free_exception(void *thrown_exception) throw();
00091
00092
00093 extern "C" void __cxa_throw (void *thrown_exception,
00094 std::type_info *tinfo,
00095 void (*dest) (void *))
00096 __attribute__((noreturn));
00097
00098
00099 extern "C" void *__cxa_begin_catch (_Unwind_Exception *) throw();
00100 extern "C" void __cxa_end_catch ();
00101 extern "C" void __cxa_rethrow () __attribute__((noreturn));
00102
00103
00104 extern "C" void __cxa_bad_cast ();
00105 extern "C" void __cxa_bad_typeid ();
00106
00107
00108
00109
00110
00111
00112 extern "C" void __cxa_call_unexpected (_Unwind_Exception *)
00113 __attribute__((noreturn));
00114
00115
00116
00117 extern void __terminate(std::terminate_handler) __attribute__((noreturn));
00118 extern void __unexpected(std::unexpected_handler) __attribute__((noreturn));
00119
00120
00121 extern std::terminate_handler __terminate_handler;
00122 extern std::unexpected_handler __unexpected_handler;
00123
00124
00125
00126
00127 const _Unwind_Exception_Class __gxx_exception_class
00128 = ((((((((_Unwind_Exception_Class) 'G'
00129 << 8 | (_Unwind_Exception_Class) 'N')
00130 << 8 | (_Unwind_Exception_Class) 'U')
00131 << 8 | (_Unwind_Exception_Class) 'C')
00132 << 8 | (_Unwind_Exception_Class) 'C')
00133 << 8 | (_Unwind_Exception_Class) '+')
00134 << 8 | (_Unwind_Exception_Class) '+')
00135 << 8 | (_Unwind_Exception_Class) '\0');
00136
00137
00138 extern "C" _Unwind_Reason_Code __gxx_personality_v0
00139 (int, _Unwind_Action, _Unwind_Exception_Class,
00140 struct _Unwind_Exception *, struct _Unwind_Context *);
00141
00142
00143 extern "C" _Unwind_Reason_Code __gxx_personality_sj0
00144 (int, _Unwind_Action, _Unwind_Exception_Class,
00145 struct _Unwind_Exception *, struct _Unwind_Context *);
00146
00147
00148 static inline __cxa_exception *
00149 __get_exception_header_from_obj (void *ptr)
00150 {
00151 return reinterpret_cast<__cxa_exception *>(ptr) - 1;
00152 }
00153
00154
00155 static inline __cxa_exception *
00156 __get_exception_header_from_ue (_Unwind_Exception *exc)
00157 {
00158 return reinterpret_cast<__cxa_exception *>(exc + 1) - 1;
00159 }
00160
00161 }
00162
00163 #endif // __UNWIND_CXX_H