Lines Matching full:ex
71 struct __cxa_exception *ex, in saveLandingPad() argument
83 if (ex) in saveLandingPad()
85 ex->handlerSwitchValue = selector; in saveLandingPad()
86 ex->catchTemp = landingPad; in saveLandingPad()
95 struct __cxa_exception *ex, in loadLandingPad() argument
104 if (ex) in loadLandingPad()
106 *selector = ex->handlerSwitchValue; in loadLandingPad()
107 *landingPad = reinterpret_cast<dw_eh_ptr_t>(ex->catchTemp); in loadLandingPad()
114 static inline _Unwind_Reason_Code continueUnwinding(struct _Unwind_Exception *ex, in continueUnwinding() argument
118 if (__gnu_unwind_frame(ex, context) != _URC_OK) { return _URC_FAILURE; } in continueUnwinding()
283 static __cxa_exception *exceptionFromPointer(void *ex) in exceptionFromPointer() argument
285 return reinterpret_cast<__cxa_exception*>(static_cast<char*>(ex) - in exceptionFromPointer()
288 static __cxa_exception *realExceptionFromException(__cxa_exception *ex) in realExceptionFromException() argument
290 if (!isDependentException(ex->unwindHeader.exception_class)) { return ex; } in realExceptionFromException()
291 …return reinterpret_cast<__cxa_exception*>((reinterpret_cast<__cxa_dependent_exception*>(ex))->prim… in realExceptionFromException()
335 __cxa_exception *ex = globals->caughtExceptions; in terminate_with_diagnostics() local
337 if (ex != nullptr) { in terminate_with_diagnostics()
338 fprintf(stderr, "Terminating due to uncaught exception %p", static_cast<void*>(ex)); in terminate_with_diagnostics()
339 ex = realExceptionFromException(ex); in terminate_with_diagnostics()
343 dynamic_cast<const __class_type_info*>(ex->exceptionType); in terminate_with_diagnostics()
347 static_cast<std::exception*>(e_ti->cast_to(static_cast<void*>(ex+1), throw_ti)); in terminate_with_diagnostics()
356 const char *mangled = ex->exceptionType->name(); in terminate_with_diagnostics()
385 struct _Unwind_Exception *ex) in exception_cleanup() argument
391 __cxa_free_exception(static_cast<void*>(ex + 1)); in exception_cleanup()
394 struct _Unwind_Exception *ex) in dependent_exception_cleanup() argument
397 __cxa_free_dependent_exception(static_cast<void*>(ex + 1)); in dependent_exception_cleanup()
403 static void free_exception_list(__cxa_exception *ex) in free_exception_list() argument
405 if (0 != ex->nextException) in free_exception_list()
407 free_exception_list(ex->nextException); in free_exception_list()
411 __cxa_free_exception(ex+1); in free_exception_list()
703 __cxa_exception *ex = reinterpret_cast<__cxa_exception*>(thrown_exception) - 1; in __cxa_free_exception() local
705 if (0 != ex->exceptionDestructor) in __cxa_free_exception()
709 ex->exceptionDestructor(thrown_exception); in __cxa_free_exception()
718 free_exception(reinterpret_cast<char*>(ex)); in __cxa_free_exception()
739 __cxa_dependent_exception *ex = reinterpret_cast<__cxa_dependent_exception*>(thrown_exception) - 1; in __cxa_free_dependent_exception() local
740 assert(isDependentException(ex->unwindHeader.exception_class)); in __cxa_free_dependent_exception()
741 if (ex->primaryException) in __cxa_free_dependent_exception()
743 releaseException(realExceptionFromException(reinterpret_cast<__cxa_exception*>(ex))); in __cxa_free_dependent_exception()
745 free_exception(reinterpret_cast<char*>(ex)); in __cxa_free_dependent_exception()
780 static void throw_exception(__cxa_exception *ex) in throw_exception() argument
783 ex->unexpectedHandler = info->unexpectedHandler; in throw_exception()
784 if (0 == ex->unexpectedHandler) in throw_exception()
786 ex->unexpectedHandler = unexpectedHandler.load(); in throw_exception()
788 ex->terminateHandler = info->terminateHandler; in throw_exception()
789 if (0 == ex->terminateHandler) in throw_exception()
791 ex->terminateHandler = terminateHandler.load(); in throw_exception()
795 _Unwind_Reason_Code err = _Unwind_RaiseException(&ex->unwindHeader); in throw_exception()
799 report_failure(err, ex); in throw_exception()
804 __cxa_exception *ex = reinterpret_cast<__cxa_exception*>(object) - 1; in __cxa_init_primary_exception() local
806 ex->referenceCount = 0; in __cxa_init_primary_exception()
807 ex->exceptionType = tinfo; in __cxa_init_primary_exception()
809 ex->exceptionDestructor = dest; in __cxa_init_primary_exception()
811 ex->unwindHeader.exception_class = exception_class; in __cxa_init_primary_exception()
812 ex->unwindHeader.exception_cleanup = exception_cleanup; in __cxa_init_primary_exception()
814 return ex; in __cxa_init_primary_exception()
827 __cxa_exception *ex = __cxa_init_primary_exception(thrown_exception, tinfo, dest); in __cxa_throw() local
828 ex->referenceCount = 1; in __cxa_throw()
830 throw_exception(ex); in __cxa_throw()
838 …__cxa_dependent_exception *ex = reinterpret_cast<__cxa_dependent_exception*>(__cxa_allocate_depend… in __cxa_rethrow_primary_exception() local
840 ex->primaryException = thrown_exception; in __cxa_rethrow_primary_exception()
843 ex->exceptionType = original->exceptionType; in __cxa_rethrow_primary_exception()
844 ex->unwindHeader.exception_class = dependent_exception_class; in __cxa_rethrow_primary_exception()
845 ex->unwindHeader.exception_cleanup = dependent_exception_cleanup; in __cxa_rethrow_primary_exception()
847 throw_exception(reinterpret_cast<__cxa_exception*>(ex)); in __cxa_rethrow_primary_exception()
853 __cxa_exception *ex = globals->caughtExceptions; in __cxa_current_primary_exception() local
855 if (0 == ex) { return NULL; } in __cxa_current_primary_exception()
856 ex = realExceptionFromException(ex); in __cxa_current_primary_exception()
857 __sync_fetch_and_add(&ex->referenceCount, 1); in __cxa_current_primary_exception()
858 return ex + 1; in __cxa_current_primary_exception()
864 __cxa_exception *ex = static_cast<__cxa_exception*>(thrown_exception) - 1; in __cxa_increment_exception_refcount() local
865 if (isDependentException(ex->unwindHeader.exception_class)) { return; } in __cxa_increment_exception_refcount()
866 __sync_fetch_and_add(&ex->referenceCount, 1); in __cxa_increment_exception_refcount()
871 __cxa_exception *ex = static_cast<__cxa_exception*>(thrown_exception) - 1; in __cxa_decrement_exception_refcount() local
872 releaseException(ex); in __cxa_decrement_exception_refcount()
891 __cxa_exception *ex = globals->caughtExceptions; in __cxa_rethrow() local
893 if (0 == ex) in __cxa_rethrow()
903 _Unwind_Exception *e = reinterpret_cast<_Unwind_Exception*>(ex); in __cxa_rethrow()
905 report_failure(err, ex); in __cxa_rethrow()
909 assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!"); in __cxa_rethrow()
918 // ex->handlerCount will be decremented in __cxa_end_catch in enclosing in __cxa_rethrow()
924 ex->handlerCount = -ex->handlerCount; in __cxa_rethrow()
930 _Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(&ex->unwindHeader); in __cxa_rethrow()
931 report_failure(err, ex); in __cxa_rethrow()
961 * object. If ex is 0 then it is assumed to be a foreign exception and only
964 static bool check_type_signature(__cxa_exception *ex, in check_type_signature() argument
968 void *exception_ptr = static_cast<void*>(ex+1); in check_type_signature()
969 const std::type_info *ex_type = ex ? ex->exceptionType : 0; in check_type_signature()
971 bool is_ptr = ex ? ex_type->__is_pointer_p() : false; in check_type_signature()
982 if (ex) in check_type_signature()
989 if (0 == ex) { return false; } in check_type_signature()
1018 __cxa_exception *ex, in check_action_record() argument
1036 if (check_type_signature(ex, handler_type, adjustedPtr)) in check_action_record()
1042 else if (filter < 0 && 0 != ex) in check_action_record()
1051 if (check_type_signature(ex, handler_type, adjustedPtr)) in check_action_record()
1066 if (check_type_signature(ex, handler_type, adjustedPtr)) in check_action_record()
1089 __cxa_exception *ex) in pushCleanupException() argument
1093 if (ex) in pushCleanupException()
1095 ex->cleanupCount++; in pushCleanupException()
1096 if (ex->cleanupCount > 1) in pushCleanupException()
1101 ex->nextCleanup = info->currentCleanup; in pushCleanupException()
1121 __cxa_exception *ex = 0; variable
1132 ex = exceptionFromPointer(exceptionObject);
1133 realEx = realExceptionFromException(ex);
1181 action.action_record, realEx, &selector, ex->adjustedPtr);
1188 if (ex)
1190 saveLandingPad(context, exceptionObject, ex, selector, action.landing_pad);
1191 ex->languageSpecificData = reinterpret_cast<const char*>(lsda_addr);
1192 ex->actionRecord = reinterpret_cast<const char*>(action.action_record);
1193 // ex->adjustedPtr is set when finding the action record.
1212 action.action_record, realEx, &selector, ex->adjustedPtr);
1215 pushCleanupException(exceptionObject, ex);
1222 &selector, ex->adjustedPtr);
1224 else if (ex->catchTemp == 0)
1232 loadLandingPad(context, exceptionObject, ex, &selector, &action.landing_pad);
1233 ex->catchTemp = 0;
1234 ex->handlerSwitchValue = 0;
1270 __cxa_exception *ex = exceptionFromPointer(exceptionObject);
1272 if (ex->handlerCount == 0)
1277 ex->nextException = globals->caughtExceptions;
1278 globals->caughtExceptions = ex;
1281 if (ex->handlerCount < 0)
1301 ex->handlerCount = -ex->handlerCount + 1;
1305 ex->handlerCount++;
1309 return ex->adjustedPtr;
1340 __cxa_exception *ex = globals->caughtExceptions;
1342 assert(0 != ex && "Ending catch when no exception is on the stack!");
1359 if (ex->handlerCount < 0)
1377 ex->handlerCount++;
1382 ex->handlerCount--;
1385 if (ex->handlerCount == 0)
1387 globals->caughtExceptions = ex->nextException;
1390 releaseException(ex);
1401 __cxa_exception *ex = globals->caughtExceptions;
1402 return ex ? ex->exceptionType : 0;
1429 __cxa_exception *ex = exceptionFromPointer(exceptionObject);
1430 if (ex->unexpectedHandler)
1432 ex->unexpectedHandler();
1612 __cxa_exception *ex = exceptionFromPointer(exceptionObject);
1613 ex->cleanupCount--;
1614 if (ex->cleanupCount == 0)
1616 info->currentCleanup = ex->nextCleanup;
1617 ex->nextCleanup = 0;