#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);
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)
{
gc_thread_vtable = NULL;
}
-#else
-
-static void
-debugger_init_threads (void)
-{
-}
-
-static void
-debugger_finalize_threads (void)
-{
-}
-
-#endif
-
static void
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