forked from OSchip/llvm-project
libcxx: Switch to use __gnu_unwind_frame() for libunwind.
As a step to fix libunwind unw_step(), a new function __gnu_unwind_frame() has been introduced to libunwind, and it is required to use this function so that some libunwind internal data structure can be updated properly. llvm-svn: 238561
This commit is contained in:
parent
7fab97f364
commit
bbb4b1ca25
|
@ -1019,9 +1019,8 @@ __gxx_personality_v0
|
|||
}
|
||||
#else
|
||||
|
||||
#if !LIBCXXABI_USE_LLVM_UNWINDER
|
||||
extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*, _Unwind_Context*);
|
||||
#endif
|
||||
extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*,
|
||||
_Unwind_Context*);
|
||||
|
||||
// Helper function to unwind one frame.
|
||||
// ARM EHABI 7.3 and 7.4: If the personality function returns _URC_CONTINUE_UNWIND, the
|
||||
|
@ -1030,37 +1029,8 @@ extern "C" _Unwind_Reason_Code __gnu_unwind_frame(_Unwind_Exception*, _Unwind_Co
|
|||
static _Unwind_Reason_Code continue_unwind(_Unwind_Exception* unwind_exception,
|
||||
_Unwind_Context* context)
|
||||
{
|
||||
#if LIBCXXABI_USE_LLVM_UNWINDER
|
||||
// ARM EHABI # 6.2, # 9.2
|
||||
//
|
||||
// +---- ehtp
|
||||
// v
|
||||
// +--------------------------------------+
|
||||
// | +--------+--------+--------+-------+ |
|
||||
// | |0| prel31 to __gxx_personality_v0 | |
|
||||
// | +--------+--------+--------+-------+ |
|
||||
// | | N | unwind opcodes | | <-- unwind_opcodes
|
||||
// | +--------+--------+--------+-------+ |
|
||||
// | | Word 2 unwind opcodes | |
|
||||
// | +--------+--------+--------+-------+ |
|
||||
// | ... |
|
||||
// | +--------+--------+--------+-------+ |
|
||||
// | | Word N unwind opcodes | |
|
||||
// | +--------+--------+--------+-------+ |
|
||||
// | | LSDA | | <-- lsda
|
||||
// | | ... | |
|
||||
// | +--------+--------+--------+-------+ |
|
||||
// +--------------------------------------+
|
||||
|
||||
uint32_t *unwind_opcodes = unwind_exception->pr_cache.ehtp + 1;
|
||||
size_t opcode_words = ((*unwind_opcodes >> 24) & 0xff) + 1;
|
||||
if (_Unwind_VRS_Interpret(context, unwind_opcodes, 1, opcode_words * 4) !=
|
||||
_URC_CONTINUE_UNWIND)
|
||||
return _URC_FAILURE;
|
||||
#else
|
||||
if (__gnu_unwind_frame(unwind_exception, context) != _URC_OK)
|
||||
return _URC_FAILURE;
|
||||
#endif
|
||||
return _URC_CONTINUE_UNWIND;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue