2006-05-23 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Tue, 23 May 2006 07:20:03 +0000 (07:20 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 23 May 2006 07:20:03 +0000 (07:20 -0000)
* debug-debugger.c: Revert Paolo's change.  Add comment and #error
check at the top of the file.

svn path=/trunk/mono/; revision=60973

mono/mini/ChangeLog
mono/mini/debug-debugger.c

index 4fe74ab5ffd07f69cb94ef78f8dd3ba0e56c910a..47e3530058d720f9e8a6aef7659dbe0849838756 100644 (file)
@@ -1,3 +1,7 @@
+2006-05-23  Martin Baulig  <martin@ximian.com>
+
+       * debug-debugger.c: Revert Paolo's change.  Add comment and #error
+       check at the top of the file.
 
 Sun May 21 12:22:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
 
index 18852f2e21ee1d0c9b6cca2ec3fd2c2413eaeb1b..b34daa2bd4612fd9b79641bcf94ab0ee9a768788 100644 (file)
@@ -3,6 +3,7 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/mono-debug.h>
+#include <mono/metadata/mono-config.h>
 #define _IN_THE_MONO_DEBUGGER
 #include "debug-debugger.h"
 #include <libgc/include/libgc-mono-debugger.h>
 #include <locale.h>
 #include <string.h>
 
+/*
+ * This file is only compiled on platforms where the debugger is supported - see the conditional
+ * definition of `debugger_sources' in Makefile.am.
+ *
+ * configure.in checks whether we're using the included libgc and disables the debugger if not.
+ */
+
+#if !defined(MONO_DEBUGGER_SUPPORTED)
+#error "Some clown tried to compile debug-debugger.c on an unsupported platform - fix Makefile.am!"
+#elif !defined(USE_INCLUDED_LIBGC)
+#error "Some clown #defined MONO_DEBUGGER_SUPPORTED without USE_INCLUDED_GC - fix configure.in!"
+#endif
+
 static MonoMethod *debugger_main_method;
 
 static guint64 debugger_insert_breakpoint (guint64 method_argument, const gchar *string_argument);
@@ -248,7 +262,6 @@ debugger_get_current_thread (void)
        return (guint64) (gsize) mono_thread_current ();
 }
 
-#if defined(MONO_DEBUGGER_SUPPORTED) && defined(WITH_INCLUDED_LIBGC)
 static void
 debugger_gc_thread_created (pthread_t thread, void *stack_ptr)
 {
@@ -299,20 +312,6 @@ debugger_finalize_threads (void)
        gc_thread_vtable = NULL;
 }
 
-#else
-
-static void
-debugger_init_threads (void)
-{
-}
-
-static void
-debugger_finalize_threads (void)
-{
-}
-
-#endif
-
 static void
 debugger_attach (void)
 {
@@ -322,9 +321,7 @@ debugger_attach (void)
        mono_debugger_notification_function (MONO_DEBUGGER_EVENT_INITIALIZE_MANAGED_CODE, 0, 0);
 
        debugger_init_threads ();
-#if defined(MONO_DEBUGGER_SUPPORTED) && defined(WITH_INCLUDED_LIBGC)
        GC_mono_debugger_add_all_threads ();
-#endif
 }
 
 static void