diff options
author | Logan Chien <tzuhsiang.chien@gmail.com> | 2015-01-22 13:28:39 +0000 |
---|---|---|
committer | Logan Chien <tzuhsiang.chien@gmail.com> | 2015-01-22 13:28:39 +0000 |
commit | f20383cada3162f3ea2437d62e8b9e47c632eaf3 (patch) | |
tree | dd487032bef29946558bf1241f926af0dc898194 /src/cxa_personality.cpp | |
parent | 083506f224853c0e5c0d972ef60d25d42d769d6a (diff) | |
download | libcxxabi-f20383cada3162f3ea2437d62e8b9e47c632eaf3.tar.gz |
Fix _Unwind_Backtrace for libc++abi built with libgcc.
Implement an undocumented _US_FORCE_UNWIND flag for force
unwinding.
git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@226820 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/cxa_personality.cpp')
-rw-r--r-- | src/cxa_personality.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cxa_personality.cpp b/src/cxa_personality.cpp index a67fb5c..3385ea3 100644 --- a/src/cxa_personality.cpp +++ b/src/cxa_personality.cpp @@ -1101,9 +1101,16 @@ __gxx_personality_v0(_Unwind_State state, _Unwind_SetGR(context, REG_UCB, reinterpret_cast<uint32_t>(unwind_exception)); #endif + // Check the undocumented force unwinding behavior + bool is_force_unwinding = state & _US_FORCE_UNWIND; + state &= ~_US_FORCE_UNWIND; + scan_results results; switch (state) { case _US_VIRTUAL_UNWIND_FRAME: + if (is_force_unwinding) + return continue_unwind(unwind_exception, context); + // Phase 1 search: All we're looking for in phase 1 is a handler that halts unwinding scan_eh_tab(results, _UA_SEARCH_PHASE, native_exception, unwind_exception, context); if (results.reason == _URC_HANDLER_FOUND) @@ -1119,6 +1126,11 @@ __gxx_personality_v0(_Unwind_State state, return results.reason; case _US_UNWIND_FRAME_STARTING: + // TODO: Support force unwinding in the phase 2 search. + // NOTE: In order to call the cleanup functions, _Unwind_ForcedUnwind() + // will call this personality function with (_US_FORCE_UNWIND | + // _US_UNWIND_FRAME_STARTING). + // Phase 2 search if (unwind_exception->barrier_cache.sp == _Unwind_GetGR(context, REG_SP)) { |