Marshall Clow | 2025361 | 2011-07-20 14:53:53 +0000 | [diff] [blame^] | 1 | #include <exception> // for std::unexpected_handler and std::terminate_handler |
| 2 | #include <cxxabi.h> |
| 3 | #include "unwind.h" |
| 4 | |
| 5 | namespace __cxxabiv1 { |
| 6 | |
| 7 | struct __cxa_exception { |
| 8 | #if __LP64__ |
| 9 | // This is a new field to support C++ 0x exception_ptr. |
| 10 | // For binary compatibility it is at the start of this |
| 11 | // struct which is prepended to the object thrown in |
| 12 | // __cxa_allocate_exception. |
| 13 | size_t referenceCount; |
| 14 | #endif |
| 15 | |
| 16 | // Manage the exception object itself. |
| 17 | std::type_info *exceptionType; |
| 18 | void (*exceptionDestructor)(void *); |
| 19 | std::unexpected_handler unexpectedHandler; |
| 20 | std::terminate_handler terminateHandler; |
| 21 | |
| 22 | __cxa_exception *nextException; |
| 23 | |
| 24 | int handlerCount; |
| 25 | |
| 26 | #ifdef __ARM_EABI_UNWINDER__ |
| 27 | __cxa_exception* nextPropagatingException; |
| 28 | int propagationCount; |
| 29 | #else |
| 30 | int handlerSwitchValue; |
| 31 | const unsigned char *actionRecord; |
| 32 | const unsigned char *languageSpecificData; |
| 33 | void *catchTemp; |
| 34 | void *adjustedPtr; |
| 35 | #endif |
| 36 | |
| 37 | #if !__LP64__ |
| 38 | // This is a new field to support C++ 0x exception_ptr. |
| 39 | // For binary compatibility it is placed where the compiler |
| 40 | // previously adding padded to 64-bit align unwindHeader. |
| 41 | size_t referenceCount; |
| 42 | #endif |
| 43 | |
| 44 | _Unwind_Exception unwindHeader; |
| 45 | }; |
| 46 | |
| 47 | struct __cxa_dependent_exception { |
| 48 | #if __LP64__ |
| 49 | void* primaryException; |
| 50 | #endif |
| 51 | |
| 52 | // Unused dummy data (should be set to null) |
| 53 | std::type_info *exceptionType; |
| 54 | void (*exceptionDestructor)(void *); |
| 55 | |
| 56 | std::unexpected_handler unexpectedHandler; |
| 57 | std::terminate_handler terminateHandler; |
| 58 | |
| 59 | __cxa_exception *nextException; |
| 60 | |
| 61 | int handlerCount; |
| 62 | |
| 63 | #ifdef __ARM_EABI_UNWINDER__ |
| 64 | __cxa_exception* nextPropagatingException; |
| 65 | int propagationCount; |
| 66 | #else |
| 67 | int handlerSwitchValue; |
| 68 | const unsigned char *actionRecord; |
| 69 | const unsigned char *languageSpecificData; |
| 70 | void * catchTemp; |
| 71 | void *adjustedPtr; |
| 72 | #endif |
| 73 | |
| 74 | #if !__LP64__ |
| 75 | void* primaryException; |
| 76 | #endif |
| 77 | |
| 78 | _Unwind_Exception unwindHeader; |
| 79 | }; |
| 80 | |
| 81 | struct __cxa_eh_globals { |
| 82 | __cxa_exception * caughtExceptions; |
| 83 | unsigned int uncaughtExceptions; |
| 84 | #ifdef __ARM_EABI_UNWINDER__ |
| 85 | __cxa_exception* propagatingExceptions; |
| 86 | #endif |
| 87 | }; |
| 88 | |
| 89 | extern "C" __cxa_eh_globals * __cxa_get_globals () throw(); |
| 90 | extern "C" __cxa_eh_globals * __cxa_get_globals_fast () throw(); |
| 91 | |
| 92 | extern "C" void * __cxa_allocate_dependent_exception () throw(); |
| 93 | extern "C" void __cxa_free_dependent_exception (void * dependent_exception) throw(); |
| 94 | |
| 95 | } |