Hello,

Please have a look at this patch. The code in question was added
in http://reviews.llvm.org/rL208466 for ARM EHABI support, but
I'm not able to find why it is needed with the libc++abi
libunwind.
diff --git a/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/cxa_personality.cpp b/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/cxa_personality.cpp
index 4c9f7e8..7a45f70 100644
--- a/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/cxa_personality.cpp
+++ b/sources/cxx-stl/llvm-libc++abi/libcxxabi/src/cxa_personality.cpp
@@ -902,10 +902,6 @@ static _Unwind_Reason_Code continue_unwind(_Unwind_Context* context,
     return _URC_CONTINUE_UNWIND;
 }
 
-// ARM register names
-static const uint32_t REG_UCB = 12;  // Register to save _Unwind_Control_Block
-static const uint32_t REG_SP = 13;
-
 static void save_results_to_barrier_cache(_Unwind_Exception* unwind_exception,
                                           const scan_results& results)
 {
@@ -968,11 +964,6 @@ __gxx_personality_v0(_Unwind_State state,
 #else
     lsda = (const uint8_t*)_Unwind_GetLanguageSpecificData(context);
 #endif
-    
-
-    // Copy the address of _Unwind_Control_Block to r12 so that _Unwind_GetLangauageSpecificData()
-    // and _Unwind_GetRegionStart() can return correct address.
-    _Unwind_SetGR(context, REG_UCB, reinterpret_cast<uint32_t>(unwind_exception));
 
     scan_results results;
     switch (state) {
@@ -981,7 +972,7 @@ __gxx_personality_v0(_Unwind_State state,
         scan_eh_tab(results, _UA_SEARCH_PHASE, native_exception, unwind_exception, context, lsda);
         if (results.reason == _URC_HANDLER_FOUND)
         {
-            unwind_exception->barrier_cache.sp = _Unwind_GetGR(context, REG_SP);
+            unwind_exception->barrier_cache.sp = _Unwind_GetGR(context, UNW_ARM_SP);
             if (native_exception)
                 save_results_to_barrier_cache(unwind_exception, results);
             return _URC_HANDLER_FOUND;
@@ -993,7 +984,7 @@ __gxx_personality_v0(_Unwind_State state,
 
     case _US_UNWIND_FRAME_STARTING:
         // Phase 2 search
-        if (unwind_exception->barrier_cache.sp == _Unwind_GetGR(context, REG_SP))
+        if (unwind_exception->barrier_cache.sp == _Unwind_GetGR(context, UNW_ARM_SP))
         {
             // Found a catching handler in phase 1
             if (native_exception)
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to