From de4fcfb94863d7e852461619b5a5a2a57ab67716 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Fri, 19 May 2006 07:37:19 +0000 Subject: [PATCH] 2006-05-19 Martin Baulig * include/gc.h: Don't include "libgc-mono-debugger.h". * pthread_support.c, pthread_stop_world.c: Include it here. svn path=/trunk/mono/; revision=60857 --- ChangeLog | 6 ++++++ include/gc.h | 3 --- include/libgc-mono-debugger.h | 6 +----- pthread_stop_world.c | 20 ++++++++++++++++---- pthread_support.c | 10 +++++++--- 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc5b46cd..b960718d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-05-19 Martin Baulig + + * include/gc.h: Don't include "libgc-mono-debugger.h". + + * pthread_support.c, pthread_stop_world.c: Include it here. + 2006-05-17 Martin Baulig * pthread-support.c, pthread-stop-world.c: Put the debugger stuff diff --git a/include/gc.h b/include/gc.h index ae7b8d06..f7f3f01d 100644 --- a/include/gc.h +++ b/include/gc.h @@ -899,9 +899,6 @@ GC_API void (*GC_is_visible_print_proc) #endif #endif -#define _IN_LIBGC_GC_H -#include "libgc-mono-debugger.h" - # if defined(PCR) || defined(GC_SOLARIS_THREADS) || \ defined(GC_PTHREADS) || defined(GC_WIN32_THREADS) /* Any flavor of threads except SRC_M3. */ diff --git a/include/libgc-mono-debugger.h b/include/libgc-mono-debugger.h index f577a504..d1606d7c 100644 --- a/include/libgc-mono-debugger.h +++ b/include/libgc-mono-debugger.h @@ -1,9 +1,7 @@ #ifndef LIBGC_MONO_DEBUGGER_H #define LIBGC_MONO_DEBUGGER_H -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED - -#if defined(_IN_LIBGC_GC_H) || defined(_IN_THE_MONO_DEBUGGER) +#if defined(_IN_LIBGC) || defined(_IN_THE_MONO_DEBUGGER) typedef struct { @@ -27,5 +25,3 @@ GC_mono_debugger_add_all_threads (void); #endif -#endif - diff --git a/pthread_stop_world.c b/pthread_stop_world.c index 6c0ca18e..39e8d5d8 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -9,6 +9,18 @@ #include #include +/* 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 @@ -412,7 +424,7 @@ void GC_stop_world() /* We should have previously waited for it to become zero. */ # endif /* PARALLEL_MARK */ ++GC_stop_count; -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED +#ifdef MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->stop_world) gc_thread_vtable->stop_world (); else @@ -483,7 +495,7 @@ static void pthread_start_world() void GC_start_world() { -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED +#ifdef MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->start_world) gc_thread_vtable->start_world(); else @@ -537,7 +549,7 @@ static void pthread_stop_init() { /* We hold the allocation lock. */ void GC_stop_init() { -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED +#ifdef MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->initialize) gc_thread_vtable->initialize (); else @@ -545,7 +557,7 @@ void GC_stop_init() pthread_stop_init (); } -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED +#ifdef MONO_DEBUGGER_SUPPORTED GCThreadFunctions *gc_thread_vtable = NULL; diff --git a/pthread_support.c b/pthread_support.c index 4bad60f7..d0b004c5 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -191,6 +191,10 @@ static __thread MONO_TLS_FAST void* GC_thread_tls; static GC_bool keys_initialized; +#ifdef MONO_DEBUGGER_SUPPORTED +#include "include/libgc-mono-debugger.h" +#endif + /* Recover the contents of the freelist array fl into the global one gfl.*/ /* Note that the indexing scheme differs, in that gfl has finer size */ /* resolution, even if not all entries are used. */ @@ -650,7 +654,7 @@ void GC_delete_thread(pthread_t id) } else { prev -> next = p -> next; } -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED +#ifdef MONO_DEBUGGER_SUPPORTED if (gc_thread_vtable && gc_thread_vtable->thread_exited) gc_thread_vtable->thread_exited (id, &p->stop_info.stack_ptr); #endif @@ -931,7 +935,7 @@ void GC_thr_init() t -> stop_info.stack_ptr = (ptr_t)(&dummy); # endif t -> flags = DETACHED | MAIN_THREAD; -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED +#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); #endif @@ -1240,7 +1244,7 @@ void * GC_start_routine_head(void * arg, void *base_addr, /* This is also < 100% convincing. We should also read this */ /* from /proc, but the hook to do so isn't there yet. */ # endif /* IA64 */ -#ifdef LIBGC_MONO_DEBUGGER_SUPPORTED +#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); #endif -- 2.40.0