+2003-01-26 Martin Baulig <martin@ximian.com>
+
+ * debug.c (mono_debug_init): Take a boolean argument which
+ specifies whether we're running in the Mono Debugger.
+
2003-01-24 Martin Baulig <martin@ximian.com>
* debug.c (mono_debug_io_layer): Disable this on Windows.
static void mono_debug_close_assembly (AssemblyDebugInfo* info);
static AssemblyDebugInfo *mono_debug_open_image (MonoDebugHandle* debug, MonoImage *image);
+static int running_in_the_mono_debugger = FALSE;
void (*mono_debugger_event_handler) (MonoDebuggerEvent event, gpointer data, gpointer data2) = NULL;
#ifndef PLATFORM_WIN32
}
void
-mono_debug_init (void)
+mono_debug_init (int in_the_debugger)
{
if (mono_debug_initialized)
return;
InitializeCriticalSection (&debugger_lock_mutex);
mono_debug_initialized = TRUE;
+ running_in_the_mono_debugger = in_the_debugger;
}
gpointer
g_assert (!mono_debug_handle);
- mono_debug_init ();
-
debug = g_new0 (MonoDebugHandle, 1);
debug->name = g_strdup (assembly->image->name);
debug->format = format;
info->filename = replace_suffix (image->name, "dbg");
if (g_file_test (info->filename, G_FILE_TEST_EXISTS))
info->symfile = mono_debug_open_mono_symbol_file (info->image, info->filename, TRUE);
- else if (mono_debugger_event_handler != NULL)
+ else if (running_in_the_mono_debugger)
info->symfile = mono_debug_create_mono_symbol_file (info->image);
mono_debugger_symbol_file_table_generation++;
break;
if (!desc)
return 0;
- return mono_insert_breakpoint_full (desc, mono_debugger_event_handler != NULL);
+ return mono_insert_breakpoint_full (desc, running_in_the_mono_debugger);
}
int
gpointer mono_debug_create_notification_function (gpointer *notification_address);
-void mono_debug_init (void);
+void mono_debug_init (int running_in_the_mono_debugger);
void mono_debug_lock (void);
void mono_debug_unlock (void);
int mono_debug_update_symbol_file_table (void);
args = g_strsplit (main_args->debug_args ?
main_args->debug_args : "", ",", -1);
+ mono_debug_init (FALSE);
debug = mono_debug_open (assembly, mono_debug_format, (const char **) args);
g_strfreev (args);
}