#include <errno.h>
#include <unistd.h>
+/* work around a dlopen issue (bug #75390), undefs to avoid warnings with redefinitions */
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#include "mono/utils/mono-compiler.h"
+
+#ifdef MONO_DEBUGGER_SUPPORTED
+#include "include/libgc-mono-debugger.h"
+#endif
+
#if DEBUG_THREADS
#ifndef NSIG
/* We should have previously waited for it to become zero. */
# endif /* PARALLEL_MARK */
++GC_stop_count;
+#ifdef MONO_DEBUGGER_SUPPORTED
if (gc_thread_vtable && gc_thread_vtable->stop_world)
gc_thread_vtable->stop_world ();
else
+#endif
pthread_stop_world ();
# ifdef PARALLEL_MARK
GC_release_mark_lock();
void GC_start_world()
{
+#ifdef MONO_DEBUGGER_SUPPORTED
if (gc_thread_vtable && gc_thread_vtable->start_world)
gc_thread_vtable->start_world();
else
+#endif
pthread_start_world ();
}
/* We hold the allocation lock. */
void GC_stop_init()
{
+#ifdef MONO_DEBUGGER_SUPPORTED
if (gc_thread_vtable && gc_thread_vtable->initialize)
gc_thread_vtable->initialize ();
else
+#endif
pthread_stop_init ();
}
+#ifdef MONO_DEBUGGER_SUPPORTED
+
GCThreadFunctions *gc_thread_vtable = NULL;
-void
-GC_mono_debugger_add_all_threads (void)
+void *
+GC_mono_debugger_get_stack_ptr (void)
{
- GC_thread p;
- int i;
+ GC_thread me;
- if (gc_thread_vtable && gc_thread_vtable->thread_created) {
- for (i = 0; i < THREAD_TABLE_SZ; i++) {
- for (p = GC_threads[i]; p != 0; p = p -> next) {
- gc_thread_vtable->thread_created (p->id, &p->stop_info.stack_ptr);
- }
- }
- }
+ me = GC_lookup_thread (pthread_self ());
+ return &me->stop_info.stack_ptr;
}
+#endif
#endif