2003-01-26 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Sat, 25 Jan 2003 23:30:04 +0000 (23:30 -0000)
committerMartin Baulig <martin@novell.com>
Sat, 25 Jan 2003 23:30:04 +0000 (23:30 -0000)
* debug.c (mono_debug_init): Take a boolean argument which
specifies whether we're running in the Mono Debugger.

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

mono/jit/ChangeLog
mono/jit/debug.c
mono/jit/debug.h
mono/jit/mono.c

index dff1f164ed4ec4269589e8c237b31140e6bc8dca..2f7e8fe37948b888816c30bb1245b2815f6f24e1 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 393ed09329c1e26788847f149e20686d5b64bddb..d3048fbc3073eaaace1ca0ab04013e2cd3ae6e95 100644 (file)
@@ -54,6 +54,7 @@ static void mono_debug_add_assembly (MonoAssembly *assembly, gpointer user_data)
 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
@@ -74,13 +75,14 @@ mono_debugger_event (MonoDebuggerEvent event, gpointer data, gpointer data2)
 }
 
 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
@@ -164,8 +166,6 @@ mono_debug_open (MonoAssembly *assembly, MonoDebugFormat format, const char **ar
 
        g_assert (!mono_debug_handle);
 
-       mono_debug_init ();
-
        debug = g_new0 (MonoDebugHandle, 1);
        debug->name = g_strdup (assembly->image->name);
        debug->format = format;
@@ -761,7 +761,7 @@ mono_debug_open_image (MonoDebugHandle* debug, MonoImage *image)
                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;
@@ -1350,7 +1350,7 @@ mono_insert_breakpoint (const gchar *method_name, gboolean include_namespace)
        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
index a58a552f2d5eb159123f7ef578200c51f5d85896..f302540ff2cdb6c8b2a6da725f41b1553f29ade3 100644 (file)
@@ -94,7 +94,7 @@ void           mono_debugger_event (MonoDebuggerEvent event, gpointer data, gpoi
 
 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);
index 44c06374aa8ca9702d307fd0adf4ac022cba2ed3..7232af5bc8b349679754b4291a78d9948062ce46 100644 (file)
@@ -219,6 +219,7 @@ static void main_thread_handler (gpointer user_data)
 
                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);
        }