[libcxxabi] r192248 - [unwind] Fix unw_init_remote_thread() use to void* instead of thread_t for parameter to match other implementations

Nick Kledzik kledzik at apple.com
Tue Oct 8 15:59:34 PDT 2013


Author: kledzik
Date: Tue Oct  8 17:59:34 2013
New Revision: 192248

URL: http://llvm.org/viewvc/llvm-project?rev=192248&view=rev
Log:
[unwind] Fix unw_init_remote_thread() use to void* instead of thread_t for parameter to match other implementations

Modified:
    libcxxabi/trunk/src/Unwind/UnwindCursor.hpp
    libcxxabi/trunk/src/Unwind/libunwind.cpp

Modified: libcxxabi/trunk/src/Unwind/UnwindCursor.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/UnwindCursor.hpp?rev=192248&r1=192247&r2=192248&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/UnwindCursor.hpp (original)
+++ libcxxabi/trunk/src/Unwind/UnwindCursor.hpp Tue Oct  8 17:59:34 2013
@@ -17,6 +17,10 @@
 #include <stdlib.h>
 #include <pthread.h>
 
+#if __APPLE__
+  #include <mach-o/dyld.h>
+#endif
+
 #include "libunwind.h"
 
 #include "AddressSpace.hpp"
@@ -382,7 +386,7 @@ class UnwindCursor : public AbstractUnwi
   typedef typename A::pint_t pint_t;
 public:
                       UnwindCursor(unw_context_t *context, A &as);
-                      UnwindCursor(A &as, thread_t thread);
+                      UnwindCursor(A &as, void *threadArg);
   virtual             ~UnwindCursor() {}
   virtual bool        validReg(int);
   virtual unw_word_t  getReg(int);
@@ -522,13 +526,14 @@ UnwindCursor<A, R>::UnwindCursor(unw_con
 }
 
 template <typename A, typename R>
-UnwindCursor<A, R>::UnwindCursor(A &as, thread_t )
+UnwindCursor<A, R>::UnwindCursor(A &as, void *)
     : _addressSpace(as), _unwindInfoMissing(false), _isSignalFrame(false) {
   bzero(&_info, sizeof(_info));
   // FIXME
-  // fill in _registers from thread
+  // fill in _registers from thread arg
 }
 
+
 template <typename A, typename R>
 bool UnwindCursor<A, R>::validReg(int regNum) {
   return _registers.validRegister(regNum);

Modified: libcxxabi/trunk/src/Unwind/libunwind.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/libunwind.cpp?rev=192248&r1=192247&r2=192248&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/libunwind.cpp (original)
+++ libcxxabi/trunk/src/Unwind/libunwind.cpp Tue Oct  8 17:59:34 2013
@@ -65,7 +65,7 @@ _LIBUNWIND_EXPORT unw_addr_space_t unw_l
 /// Create a cursor into a thread in another process.
 _LIBUNWIND_EXPORT int unw_init_remote_thread(unw_cursor_t *cursor,
                                              unw_addr_space_t as,
-                                             thread_t thread) {
+                                             void *arg) {
   // special case: unw_init_remote(xx, unw_local_addr_space, xx)
   if (as == (unw_addr_space_t) & sThisAddressSpace)
     return unw_init_local(cursor, NULL); //FIXME
@@ -75,17 +75,17 @@ _LIBUNWIND_EXPORT int unw_init_remote_th
   case CPU_TYPE_I386:
     new ((void *)cursor)
         UnwindCursor<OtherAddressSpace<Pointer32<LittleEndian> >,
-                     Registers_x86>(((unw_addr_space_i386 *)as)->oas, thread);
+                     Registers_x86>(((unw_addr_space_i386 *)as)->oas, arg);
     break;
   case CPU_TYPE_X86_64:
     new ((void *)cursor) UnwindCursor<
         OtherAddressSpace<Pointer64<LittleEndian> >, Registers_x86_64>(
-        ((unw_addr_space_x86_64 *)as)->oas, thread);
+        ((unw_addr_space_x86_64 *)as)->oas, arg);
     break;
   case CPU_TYPE_POWERPC:
     new ((void *)cursor)
         UnwindCursor<OtherAddressSpace<Pointer32<BigEndian> >, Registers_ppc>(
-            ((unw_addr_space_ppc *)as)->oas, thread);
+            ((unw_addr_space_ppc *)as)->oas, arg);
     break;
   default:
     return UNW_EUNSPEC;





More information about the cfe-commits mailing list