[PATCH] Fix _Unwind_Backtrace for libc++abi built with libgcc.

Logan Chien tzuhsiang.chien at gmail.com
Sat Jan 17 00:05:58 PST 2015


Hi danalbert, rengolin, jroelofs,

Implement an undocumented _US_FORCE_UNWIND state for force
unwinding.

http://reviews.llvm.org/D7031

Files:
  src/cxa_personality.cpp

Index: src/cxa_personality.cpp
===================================================================
--- src/cxa_personality.cpp
+++ src/cxa_personality.cpp
@@ -1101,9 +1101,17 @@
     _Unwind_SetGR(context, REG_UCB, reinterpret_cast<uint32_t>(unwind_exception));
 #endif
 
+    // Check the undocumented force unwinding behavior
+    const unsigned _US_FORCE_UNWIND = 8u;
+    bool is_force_unwinding = static_cast<unsigned>(state) & _US_FORCE_UNWIND;
+    state = static_cast<_Unwind_State>(static_cast<unsigned>(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)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7031.18338.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150117/b784f6c3/attachment.bin>


More information about the cfe-commits mailing list