]> granicus.if.org Git - gc/commitdiff
2009-07-02 jonas echterhoff <jonas@unity3d.com>
authorjonas <jonas@localhost>
Thu, 2 Jul 2009 07:59:30 +0000 (07:59 +0000)
committerguest <ivmai@mail.ru>
Fri, 29 Jul 2011 11:31:21 +0000 (15:31 +0400)
svn path=/trunk/mono/; revision=137261

ChangeLog
darwin_stop_world.c
include/private/darwin_stop_world.h
pthread_support.c

index 58a1fcfe798142b9dde94fa15b9408d37638767a..f7e78a27d601b91703bbe002825c36933322204e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-07-02  jonas echterhoff <jonas@unity3d.com>
+       
+       * darwin_stop_world.c: make debugger code compile on 
+       OS X.
+       
+       * pthread_support.c: give mach ports to the debugger instead of pthreads,
+       as those can be iterated over from another executable.
+
 2009-06-22  Neale Ferguson <neale@sinenomine.net>
 
        * include/private/gc_locks.h: Fix typo in 390 version of GC_compare_and_exchange
index d3b94feb258c402830b94e3d3a200251073f41df..f9ba57c02b6e8d000d458cc1c5e9c7664bc7d789 100644 (file)
@@ -2,6 +2,12 @@
 
 # if defined(GC_DARWIN_THREADS)
 
+#include "mono/utils/mono-compiler.h"
+
+#ifdef MONO_DEBUGGER_SUPPORTED
+#include "include/libgc-mono-debugger.h"
+#endif
+
 /* From "Inside Mac OS X - Mach-O Runtime Architecture" published by Apple
    Page 49:
    "The space beneath the stack pointer, where a new stack frame would normally
@@ -682,4 +688,17 @@ void GC_darwin_register_mach_handler_thread(mach_port_t thread) {
   GC_use_mach_handler_thread = 1;
 }
 
+#ifdef MONO_DEBUGGER_SUPPORTED
+GCThreadFunctions *gc_thread_vtable = NULL;
+
+void *
+GC_mono_debugger_get_stack_ptr (void)
+{
+       GC_thread me;
+
+       me = GC_lookup_thread (pthread_self ());
+       return &me->stop_info.stack_ptr;
+}
+#endif
+
 #endif
index f6f5314ee315a5410cade12e06a7045214bfda05..068e020f610349abd8233f3fd0aea1f9696caab7 100644 (file)
 
 struct thread_stop_info {
     mach_port_t mach_thread;
+
+    int        signal;
+    word last_stop_count;      /* GC_last_stop_count value when thread */
+                               /* last successfully handled a suspend  */
+                               /* signal.                              */
+    ptr_t stack_ptr;           /* Valid only when stopped.             */
 };
 
 struct GC_mach_thread {
index 11d2cd6ad71514caa514d0312522247a9eca5b16..46a5f1f469fee38c061a4d85f9ecedb7ab2a28d1 100644 (file)
@@ -1010,7 +1010,11 @@ void GC_thr_init()
       t -> flags = DETACHED | MAIN_THREAD;
 #ifdef MONO_DEBUGGER_SUPPORTED
       if (gc_thread_vtable && gc_thread_vtable->thread_created)
-        gc_thread_vtable->thread_created (pthread_self (), &t->stop_info.stack_ptr);
+#     ifdef GC_DARWIN_THREADS
+        gc_thread_vtable->thread_created (mach_thread_self (), &t->stop_info.stack_ptr);
+#     else
+         gc_thread_vtable->thread_created (pthread_self (), &t->stop_info.stack_ptr);
+#     endif
 #endif
 
     GC_stop_init();
@@ -1324,7 +1328,11 @@ void * GC_start_routine_head(void * arg, void *base_addr,
 #   endif /* IA64 */
 #ifdef MONO_DEBUGGER_SUPPORTED
     if (gc_thread_vtable && gc_thread_vtable->thread_created)
-       gc_thread_vtable->thread_created (my_pthread, &me->stop_info.stack_ptr);
+#      ifdef GC_DARWIN_THREADS
+       gc_thread_vtable->thread_created (mach_thread_self(), &me->stop_info.stack_ptr);
+#      else
+       gc_thread_vtable->thread_created (my_pthread, &me->stop_info.stack_ptr);
+#      endif
 #endif
     UNLOCK();