[libcxxabi] r229133 - unwind: always export unw_local_addr_space

Saleem Abdulrasool compnerd at compnerd.org
Fri Feb 13 11:04:49 PST 2015


Author: compnerd
Date: Fri Feb 13 13:04:48 2015
New Revision: 229133

URL: http://llvm.org/viewvc/llvm-project?rev=229133&view=rev
Log:
unwind: always export unw_local_addr_space

It seems that the remote unwinder is entirely unused at this moment.
unw_local_addr_space was referencing sThisAddressSpace which use to be a static
in global namespace.  It has since then become a member variable of
LocalAddressSpace.  Update this definition and always export it (needed to
implement unw_get_proc_info_by_ip for ARM).

Modified:
    libcxxabi/trunk/include/libunwind.h
    libcxxabi/trunk/src/Unwind/libunwind.cpp

Modified: libcxxabi/trunk/include/libunwind.h
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/include/libunwind.h?rev=229133&r1=229132&r2=229133&view=diff
==============================================================================
--- libcxxabi/trunk/include/libunwind.h (original)
+++ libcxxabi/trunk/include/libunwind.h Fri Feb 13 13:04:48 2015
@@ -107,12 +107,13 @@ extern int unw_is_signal_frame(unw_curso
 extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL;
 //extern int       unw_get_save_loc(unw_cursor_t*, int, unw_save_loc_t*);
 
+extern unw_addr_space_t unw_local_addr_space;
+
 #ifdef UNW_REMOTE
 /*
  * Mac OS X "remote" API for unwinding other processes on same machine
  *
  */
-extern unw_addr_space_t unw_local_addr_space;
 extern unw_addr_space_t unw_create_addr_space_for_task(task_t);
 extern void unw_destroy_addr_space(unw_addr_space_t);
 extern int unw_init_remote_thread(unw_cursor_t *, unw_addr_space_t, thread_t *);

Modified: libcxxabi/trunk/src/Unwind/libunwind.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxxabi/trunk/src/Unwind/libunwind.cpp?rev=229133&r1=229132&r2=229133&view=diff
==============================================================================
--- libcxxabi/trunk/src/Unwind/libunwind.cpp (original)
+++ libcxxabi/trunk/src/Unwind/libunwind.cpp Fri Feb 13 13:04:48 2015
@@ -35,6 +35,9 @@ using namespace libunwind;
 /// internal object to represent this processes address space
 LocalAddressSpace LocalAddressSpace::sThisAddressSpace;
 
+_LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space =
+    (unw_addr_space_t)&LocalAddressSpace::sThisAddressSpace;
+
 /// record the registers and stack position of the caller
 extern int unw_getcontext(unw_context_t *);
 // note: unw_getcontext() implemented in assembly
@@ -70,16 +73,12 @@ _LIBUNWIND_EXPORT int unw_init_local(unw
 }
 
 #ifdef UNW_REMOTE
-
-_LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space =
-    (unw_addr_space_t) & sThisAddressSpace;
-
 /// 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,
                                              void *arg) {
   // special case: unw_init_remote(xx, unw_local_addr_space, xx)
-  if (as == (unw_addr_space_t) & sThisAddressSpace)
+  if (as == (unw_addr_space_t)&LocalAddressSpace::sThisAddressSpace)
     return unw_init_local(cursor, NULL); //FIXME
 
   // use "placement new" to allocate UnwindCursor in the cursor buffer





More information about the cfe-commits mailing list