[libcxxabi] r227236 - Merging r226820:

Hans Wennborg hans at hanshq.net
Tue Jan 27 12:38:30 PST 2015


Author: hans
Date: Tue Jan 27 14:38:30 2015
New Revision: 227236

URL: http://llvm.org/viewvc/llvm-project?rev=227236&view=rev
Log:
Merging r226820:
------------------------------------------------------------------------
r226820 | logan | 2015-01-22 05:28:39 -0800 (Thu, 22 Jan 2015) | 5 lines

Fix _Unwind_Backtrace for libc++abi built with libgcc.

Implement an undocumented _US_FORCE_UNWIND flag for force
unwinding.

------------------------------------------------------------------------

Modified:
    libcxxabi/branches/release_36/   (props changed)
    libcxxabi/branches/release_36/include/unwind.h
    libcxxabi/branches/release_36/src/cxa_personality.cpp

Propchange: libcxxabi/branches/release_36/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 27 14:38:30 2015
@@ -1 +1 @@
-/libcxxabi/trunk:226818-226819
+/libcxxabi/trunk:226818-226820

Modified: libcxxabi/branches/release_36/include/unwind.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/branches/release_36/include/unwind.h?rev=227236&r1=227235&r2=227236&view=diff
==============================================================================
--- libcxxabi/branches/release_36/include/unwind.h (original)
+++ libcxxabi/branches/release_36/include/unwind.h Tue Jan 27 14:38:30 2015
@@ -63,6 +63,8 @@ typedef uint32_t _Unwind_State;
 static const _Unwind_State _US_VIRTUAL_UNWIND_FRAME   = 0;
 static const _Unwind_State _US_UNWIND_FRAME_STARTING  = 1;
 static const _Unwind_State _US_UNWIND_FRAME_RESUME    = 2;
+/* Undocumented flag for force unwinding. */
+static const _Unwind_State _US_FORCE_UNWIND           = 8;
 
 typedef uint32_t _Unwind_EHT_Header;
 

Modified: libcxxabi/branches/release_36/src/cxa_personality.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/branches/release_36/src/cxa_personality.cpp?rev=227236&r1=227235&r2=227236&view=diff
==============================================================================
--- libcxxabi/branches/release_36/src/cxa_personality.cpp (original)
+++ libcxxabi/branches/release_36/src/cxa_personality.cpp Tue Jan 27 14:38:30 2015
@@ -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))
         {





More information about the cfe-commits mailing list