diff options
Diffstat (limited to 'src/Unwind-EHABI.cpp')
-rw-r--r-- | src/Unwind-EHABI.cpp | 221 |
1 files changed, 101 insertions, 120 deletions
diff --git a/src/Unwind-EHABI.cpp b/src/Unwind-EHABI.cpp index bc3df41..109b272 100644 --- a/src/Unwind-EHABI.cpp +++ b/src/Unwind-EHABI.cpp @@ -12,7 +12,7 @@ #include "Unwind-EHABI.h" -#if _LIBUNWIND_ARM_EHABI +#if defined(_LIBUNWIND_ARM_EHABI) #include <stdbool.h> #include <stdint.h> @@ -245,11 +245,9 @@ decode_eht_entry(const uint32_t* data, size_t* off, size_t* len) { return data; } -_Unwind_Reason_Code _Unwind_VRS_Interpret( - _Unwind_Context* context, - const uint32_t* data, - size_t offset, - size_t len) { +_LIBUNWIND_EXPORT _Unwind_Reason_Code +_Unwind_VRS_Interpret(_Unwind_Context *context, const uint32_t *data, + size_t offset, size_t len) { bool wrotePC = false; bool finish = false; while (offset < len && !finish) { @@ -351,6 +349,7 @@ _Unwind_Reason_Code _Unwind_VRS_Interpret( } case 0xc0: { switch (byte) { +#if defined(__ARM_WMMX) case 0xc0: case 0xc1: case 0xc2: @@ -378,6 +377,7 @@ _Unwind_Reason_Code _Unwind_VRS_Interpret( _Unwind_VRS_Pop(context, _UVRSC_WMMXC, v, _UVRSD_DOUBLE); break; } +#endif case 0xc8: case 0xc9: { uint8_t v = getByte(data, offset++); @@ -416,63 +416,42 @@ _Unwind_Reason_Code _Unwind_VRS_Interpret( return _URC_CONTINUE_UNWIND; } -extern "C" _Unwind_Reason_Code __aeabi_unwind_cpp_pr0( - _Unwind_State state, - _Unwind_Control_Block *ucbp, - _Unwind_Context *context) { +extern "C" _LIBUNWIND_EXPORT _Unwind_Reason_Code +__aeabi_unwind_cpp_pr0(_Unwind_State state, _Unwind_Control_Block *ucbp, + _Unwind_Context *context) { return unwindOneFrame(state, ucbp, context); } -extern "C" _Unwind_Reason_Code __aeabi_unwind_cpp_pr1( - _Unwind_State state, - _Unwind_Control_Block *ucbp, - _Unwind_Context *context) { +extern "C" _LIBUNWIND_EXPORT _Unwind_Reason_Code +__aeabi_unwind_cpp_pr1(_Unwind_State state, _Unwind_Control_Block *ucbp, + _Unwind_Context *context) { return unwindOneFrame(state, ucbp, context); } -extern "C" _Unwind_Reason_Code __aeabi_unwind_cpp_pr2( - _Unwind_State state, - _Unwind_Control_Block *ucbp, - _Unwind_Context *context) { +extern "C" _LIBUNWIND_EXPORT _Unwind_Reason_Code +__aeabi_unwind_cpp_pr2(_Unwind_State state, _Unwind_Control_Block *ucbp, + _Unwind_Context *context) { return unwindOneFrame(state, ucbp, context); } static _Unwind_Reason_Code -unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) { +unwind_phase1(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object) { // EHABI #7.3 discusses preserving the VRS in a "temporary VRS" during // phase 1 and then restoring it to the "primary VRS" for phase 2. The // effect is phase 2 doesn't see any of the VRS manipulations from phase 1. // In this implementation, the phases don't share the VRS backing store. // Instead, they are passed the original |uc| and they create a new VRS // from scratch thus achieving the same effect. - unw_cursor_t cursor1; - unw_init_local(&cursor1, uc); + unw_init_local(cursor, uc); // Walk each frame looking for a place to stop. for (bool handlerNotFound = true; handlerNotFound;) { -#if !_LIBUNWIND_ARM_EHABI - // Ask libuwind to get next frame (skip over first which is - // _Unwind_RaiseException). - int stepResult = unw_step(&cursor1); - if (stepResult == 0) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", - static_cast<void *>(exception_object)); - return _URC_END_OF_STACK; - } else if (stepResult < 0) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_step failed => " - "_URC_FATAL_PHASE1_ERROR\n", - static_cast<void *>(exception_object)); - return _URC_FATAL_PHASE1_ERROR; - } -#endif - // See if frame has code to run (has personality routine). unw_proc_info_t frameInfo; - if (unw_get_proc_info(&cursor1, &frameInfo) != UNW_ESUCCESS) { + if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase1(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE1_ERROR", static_cast<void *>(exception_object)); return _URC_FATAL_PHASE1_ERROR; } @@ -482,15 +461,15 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) { char functionBuf[512]; const char *functionName = functionBuf; unw_word_t offset; - if ((unw_get_proc_name(&cursor1, functionBuf, sizeof(functionBuf), + if ((unw_get_proc_name(cursor, functionBuf, sizeof(functionBuf), &offset) != UNW_ESUCCESS) || (frameInfo.start_ip + offset > frameInfo.end_ip)) functionName = ".anonymous."; unw_word_t pc; - unw_get_reg(&cursor1, UNW_REG_IP, &pc); + unw_get_reg(cursor, UNW_REG_IP, &pc); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): pc=0x%llX, start_ip=0x%llX, func=%s, " - "lsda=0x%llX, personality=0x%llX\n", + "lsda=0x%llX, personality=0x%llX", static_cast<void *>(exception_object), (long long)pc, (long long)frameInfo.start_ip, functionName, (long long)frameInfo.lsda, (long long)frameInfo.handler); @@ -502,10 +481,10 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) { __personality_routine p = (__personality_routine)(long)(frameInfo.handler); _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): calling personality function %p\n", + "unwind_phase1(ex_ojb=%p): calling personality function %p", static_cast<void *>(exception_object), reinterpret_cast<void *>(reinterpret_cast<uintptr_t>(p))); - struct _Unwind_Context *context = (struct _Unwind_Context *)(&cursor1); + struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor); exception_object->pr_cache.fnstart = frameInfo.start_ip; exception_object->pr_cache.ehtp = (_Unwind_EHT_Header *)frameInfo.unwind_info; @@ -514,7 +493,7 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) { (*p)(_US_VIRTUAL_UNWIND_FRAME, exception_object, context); _LIBUNWIND_TRACE_UNWINDING( "unwind_phase1(ex_ojb=%p): personality result %d start_ip %x ehtp %p " - "additional %x\n", + "additional %x", static_cast<void *>(exception_object), personalityResult, exception_object->pr_cache.fnstart, static_cast<void *>(exception_object->pr_cache.ehtp), @@ -526,13 +505,13 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) { handlerNotFound = false; // p should have initialized barrier_cache. EHABI #7.3.5 _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND \n", + "unwind_phase1(ex_ojb=%p): _URC_HANDLER_FOUND", static_cast<void *>(exception_object)); return _URC_NO_REASON; case _URC_CONTINUE_UNWIND: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase1(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast<void *>(exception_object)); // continue unwinding break; @@ -544,7 +523,7 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) { default: // something went wrong _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR\n", + "unwind_phase1(ex_ojb=%p): _URC_FATAL_PHASE1_ERROR", static_cast<void *>(exception_object)); return _URC_FATAL_PHASE1_ERROR; } @@ -553,20 +532,19 @@ unwind_phase1(unw_context_t *uc, _Unwind_Exception *exception_object) { return _URC_NO_REASON; } -static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, +static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *exception_object, bool resume) { // See comment at the start of unwind_phase1 regarding VRS integrity. - unw_cursor_t cursor2; - unw_init_local(&cursor2, uc); + unw_init_local(cursor, uc); - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)\n", + _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p)", static_cast<void *>(exception_object)); int frame_count = 0; // Walk each frame until we reach where search phase said to stop. while (true) { - // Ask libuwind to get next frame (skip over first which is + // Ask libunwind to get next frame (skip over first which is // _Unwind_RaiseException or _Unwind_Resume). // // Resume only ever makes sense for 1 frame. @@ -580,33 +558,18 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, // for. After this, continue unwinding as if normal. // // See #7.4.6 for details. - unw_set_reg(&cursor2, UNW_REG_IP, + unw_set_reg(cursor, UNW_REG_IP, exception_object->unwinder_cache.reserved2); resume = false; } -#if !_LIBUNWIND_ARM_EHABI - int stepResult = unw_step(&cursor2); - if (stepResult == 0) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step() reached " - "bottom => _URC_END_OF_STACK\n", - static_cast<void *>(exception_object)); - return _URC_END_OF_STACK; - } else if (stepResult < 0) { - _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_step failed => " - "_URC_FATAL_PHASE1_ERROR\n", - static_cast<void *>(exception_object)); - return _URC_FATAL_PHASE2_ERROR; - } -#endif - // Get info about this frame. unw_word_t sp; unw_proc_info_t frameInfo; - unw_get_reg(&cursor2, UNW_REG_SP, &sp); - if (unw_get_proc_info(&cursor2, &frameInfo) != UNW_ESUCCESS) { + unw_get_reg(cursor, UNW_REG_SP, &sp); + if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE2_ERROR", static_cast<void *>(exception_object)); return _URC_FATAL_PHASE2_ERROR; } @@ -616,13 +579,13 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, char functionBuf[512]; const char *functionName = functionBuf; unw_word_t offset; - if ((unw_get_proc_name(&cursor2, functionBuf, sizeof(functionBuf), + if ((unw_get_proc_name(cursor, functionBuf, sizeof(functionBuf), &offset) != UNW_ESUCCESS) || (frameInfo.start_ip + offset > frameInfo.end_ip)) functionName = ".anonymous."; _LIBUNWIND_TRACE_UNWINDING( "unwind_phase2(ex_ojb=%p): start_ip=0x%llX, func=%s, sp=0x%llX, " - "lsda=0x%llX, personality=0x%llX\n", + "lsda=0x%llX, personality=0x%llX", static_cast<void *>(exception_object), (long long)frameInfo.start_ip, functionName, (long long)sp, (long long)frameInfo.lsda, (long long)frameInfo.handler); @@ -632,7 +595,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, if (frameInfo.handler != 0) { __personality_routine p = (__personality_routine)(long)(frameInfo.handler); - struct _Unwind_Context *context = (struct _Unwind_Context *)(&cursor2); + struct _Unwind_Context *context = (struct _Unwind_Context *)(cursor); // EHABI #7.2 exception_object->pr_cache.fnstart = frameInfo.start_ip; exception_object->pr_cache.ehtp = @@ -644,7 +607,7 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, case _URC_CONTINUE_UNWIND: // Continue unwinding _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND\n", + "unwind_phase2(ex_ojb=%p): _URC_CONTINUE_UNWIND", static_cast<void *>(exception_object)); // EHABI #7.2 if (sp == exception_object->barrier_cache.sp) { @@ -655,16 +618,16 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, break; case _URC_INSTALL_CONTEXT: _LIBUNWIND_TRACE_UNWINDING( - "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT\n", + "unwind_phase2(ex_ojb=%p): _URC_INSTALL_CONTEXT", static_cast<void *>(exception_object)); // Personality routine says to transfer control to landing pad. // We may get control back if landing pad calls _Unwind_Resume(). if (_LIBUNWIND_TRACING_UNWINDING) { unw_word_t pc; - unw_get_reg(&cursor2, UNW_REG_IP, &pc); - unw_get_reg(&cursor2, UNW_REG_SP, &sp); + unw_get_reg(cursor, UNW_REG_IP, &pc); + unw_get_reg(cursor, UNW_REG_SP, &sp); _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): re-entering " - "user code with ip=0x%llX, sp=0x%llX\n", + "user code with ip=0x%llX, sp=0x%llX", static_cast<void *>(exception_object), (long long)pc, (long long)sp); } @@ -673,10 +636,10 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, // EHABI #7.4.1 says we need to preserve pc for when _Unwind_Resume // is called back, to find this same frame. unw_word_t pc; - unw_get_reg(&cursor2, UNW_REG_IP, &pc); + unw_get_reg(cursor, UNW_REG_IP, &pc); exception_object->unwinder_cache.reserved2 = (uint32_t)pc; } - unw_resume(&cursor2); + unw_resume(cursor); // unw_resume() only returns if there was an error. return _URC_FATAL_PHASE2_ERROR; @@ -702,9 +665,10 @@ static _Unwind_Reason_Code unwind_phase2(unw_context_t *uc, /// Called by __cxa_throw. Only returns if there is a fatal error. _LIBUNWIND_EXPORT _Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_RaiseException(ex_obj=%p)", static_cast<void *>(exception_object)); unw_context_t uc; + unw_cursor_t cursor; unw_getcontext(&uc); // This field for is for compatibility with GCC to say this isn't a forced @@ -712,12 +676,12 @@ _Unwind_RaiseException(_Unwind_Exception *exception_object) { exception_object->unwinder_cache.reserved1 = 0; // phase 1: the search phase - _Unwind_Reason_Code phase1 = unwind_phase1(&uc, exception_object); + _Unwind_Reason_Code phase1 = unwind_phase1(&uc, &cursor, exception_object); if (phase1 != _URC_NO_REASON) return phase1; // phase 2: the clean up phase - return unwind_phase2(&uc, exception_object, false); + return unwind_phase2(&uc, &cursor, exception_object, false); } _LIBUNWIND_EXPORT void _Unwind_Complete(_Unwind_Exception* exception_object) { @@ -739,15 +703,16 @@ _LIBUNWIND_EXPORT void _Unwind_Complete(_Unwind_Exception* exception_object) { /// in turn calls _Unwind_Resume_or_Rethrow(). _LIBUNWIND_EXPORT void _Unwind_Resume(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_Resume(ex_obj=%p)", static_cast<void *>(exception_object)); unw_context_t uc; + unw_cursor_t cursor; unw_getcontext(&uc); // _Unwind_RaiseException on EHABI will always set the reserved1 field to 0, // which is in the same position as private_1 below. // TODO(ajwong): Who wronte the above? Why is it true? - unwind_phase2(&uc, exception_object, true); + unwind_phase2(&uc, &cursor, exception_object, true); // Clients assume _Unwind_Resume() does not return, so all we can do is abort. _LIBUNWIND_ABORT("_Unwind_Resume() can't return"); @@ -762,7 +727,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.lsda; _LIBUNWIND_TRACE_API( - "_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx\n", + "_Unwind_GetLanguageSpecificData(context=%p) => 0x%llx", static_cast<void *>(context), (long long)result); return result; } @@ -785,12 +750,12 @@ static uint64_t ValueAsBitPattern(_Unwind_VRS_DataRepresentation representation, return value; } -_Unwind_VRS_Result +_LIBUNWIND_EXPORT _Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, uint32_t regno, _Unwind_VRS_DataRepresentation representation, void *valuep) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Set(context=%p, regclass=%d, reg=%d, " - "rep=%d, value=0x%llX)\n", + "rep=%d, value=0x%llX)", static_cast<void *>(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep)); @@ -803,13 +768,6 @@ _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, *(unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; - case _UVRSC_WMMXC: - if (representation != _UVRSD_UINT32 || regno > 3) - return _UVRSR_FAILED; - return unw_set_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), - *(unw_word_t *)valuep) == UNW_ESUCCESS - ? _UVRSR_OK - : _UVRSR_FAILED; case _UVRSC_VFP: if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; @@ -826,6 +784,14 @@ _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, *(unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#if defined(__ARM_WMMX) + case _UVRSC_WMMXC: + if (representation != _UVRSD_UINT32 || regno > 3) + return _UVRSR_FAILED; + return unw_set_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), + *(unw_word_t *)valuep) == UNW_ESUCCESS + ? _UVRSR_OK + : _UVRSR_FAILED; case _UVRSC_WMMXD: if (representation != _UVRSD_DOUBLE || regno > 31) return _UVRSR_FAILED; @@ -833,6 +799,11 @@ _Unwind_VRS_Set(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, *(unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#else + case _UVRSC_WMMXC: + case _UVRSC_WMMXD: + break; +#endif } _LIBUNWIND_ABORT("unsupported register class"); } @@ -851,13 +822,6 @@ _Unwind_VRS_Get_Internal(_Unwind_Context *context, (unw_word_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; - case _UVRSC_WMMXC: - if (representation != _UVRSD_UINT32 || regno > 3) - return _UVRSR_FAILED; - return unw_get_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), - (unw_word_t *)valuep) == UNW_ESUCCESS - ? _UVRSR_OK - : _UVRSR_FAILED; case _UVRSC_VFP: if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; @@ -874,6 +838,14 @@ _Unwind_VRS_Get_Internal(_Unwind_Context *context, (unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#if defined(__ARM_WMMX) + case _UVRSC_WMMXC: + if (representation != _UVRSD_UINT32 || regno > 3) + return _UVRSR_FAILED; + return unw_get_reg(cursor, (unw_regnum_t)(UNW_ARM_WC0 + regno), + (unw_word_t *)valuep) == UNW_ESUCCESS + ? _UVRSR_OK + : _UVRSR_FAILED; case _UVRSC_WMMXD: if (representation != _UVRSD_DOUBLE || regno > 31) return _UVRSR_FAILED; @@ -881,21 +853,24 @@ _Unwind_VRS_Get_Internal(_Unwind_Context *context, (unw_fpreg_t *)valuep) == UNW_ESUCCESS ? _UVRSR_OK : _UVRSR_FAILED; +#else + case _UVRSC_WMMXC: + case _UVRSC_WMMXD: + break; +#endif } _LIBUNWIND_ABORT("unsupported register class"); } -_Unwind_VRS_Result _Unwind_VRS_Get( - _Unwind_Context *context, - _Unwind_VRS_RegClass regclass, - uint32_t regno, - _Unwind_VRS_DataRepresentation representation, - void *valuep) { +_LIBUNWIND_EXPORT _Unwind_VRS_Result +_Unwind_VRS_Get(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, + uint32_t regno, _Unwind_VRS_DataRepresentation representation, + void *valuep) { _Unwind_VRS_Result result = _Unwind_VRS_Get_Internal(context, regclass, regno, representation, valuep); _LIBUNWIND_TRACE_API("_Unwind_VRS_Get(context=%p, regclass=%d, reg=%d, " - "rep=%d, value=0x%llX, result = %d)\n", + "rep=%d, value=0x%llX, result = %d)", static_cast<void *>(context), regclass, regno, representation, ValueAsBitPattern(representation, valuep), result); @@ -907,12 +882,15 @@ _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, uint32_t discriminator, _Unwind_VRS_DataRepresentation representation) { _LIBUNWIND_TRACE_API("_Unwind_VRS_Pop(context=%p, regclass=%d, " - "discriminator=%d, representation=%d)\n", + "discriminator=%d, representation=%d)", static_cast<void *>(context), regclass, discriminator, representation); switch (regclass) { - case _UVRSC_CORE: - case _UVRSC_WMMXC: { + case _UVRSC_WMMXC: +#if !defined(__ARM_WMMX) + break; +#endif + case _UVRSC_CORE: { if (representation != _UVRSD_UINT32) return _UVRSR_FAILED; // When popping SP from the stack, we don't want to override it from the @@ -940,8 +918,11 @@ _Unwind_VRS_Pop(_Unwind_Context *context, _Unwind_VRS_RegClass regclass, } return _UVRSR_OK; } - case _UVRSC_VFP: - case _UVRSC_WMMXD: { + case _UVRSC_WMMXD: +#if !defined(__ARM_WMMX) + break; +#endif + case _UVRSC_VFP: { if (representation != _UVRSD_VFPX && representation != _UVRSD_DOUBLE) return _UVRSR_FAILED; uint32_t first = discriminator >> 16; @@ -980,7 +961,7 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context) { uintptr_t result = 0; if (unw_get_proc_info(cursor, &frameInfo) == UNW_ESUCCESS) result = (uintptr_t)frameInfo.start_ip; - _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX\n", + _LIBUNWIND_TRACE_API("_Unwind_GetRegionStart(context=%p) => 0x%llX", static_cast<void *>(context), (long long)result); return result; } @@ -990,7 +971,7 @@ _Unwind_GetRegionStart(struct _Unwind_Context *context) { // is caught. _LIBUNWIND_EXPORT void _Unwind_DeleteException(_Unwind_Exception *exception_object) { - _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)\n", + _LIBUNWIND_TRACE_API("_Unwind_DeleteException(ex_obj=%p)", static_cast<void *>(exception_object)); if (exception_object->exception_cleanup != NULL) (*exception_object->exception_cleanup)(_URC_FOREIGN_EXCEPTION_CAUGHT, @@ -1006,4 +987,4 @@ __gnu_unwind_frame(_Unwind_Exception *exception_object, return _URC_OK; } -#endif // _LIBUNWIND_ARM_EHABI +#endif // defined(_LIBUNWIND_ARM_EHABI) |