Author: benm
Date: 2005-05-05 11:50:38 -0400 (Thu, 05 May 2005)
New Revision: 44089

Modified:
   branches/mono-1-1-7/mono/mono/metadata/ChangeLog
   branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.c
   branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.h
   branches/mono-1-1-7/mono/mono/metadata/mono-debug.c
Log:
Thu May 5 17:14:27 CEST 2005 Paolo Molaro <[EMAIL PROTECTED]>

        * mono-debug.c: unlock properly: the interface with the debugger will 
likely
        need to change.

Thu May 5 16:24:43 CEST 2005 Paolo Molaro <[EMAIL PROTECTED]>

        * mono-debug-debugger.c, mono-debug-debugger.h, mono-debug.c: remove 
thread
        unsafe code in the debugger lock/unlock functions and always init the 
debugger
        lock since it's use also when the debugger is not connected.

2005-05-05  Zoltan Varga  <[EMAIL PROTECTED]>

        * assembly.c (mono_assembly_load_reference): Fix warning.



Modified: branches/mono-1-1-7/mono/mono/metadata/ChangeLog
===================================================================
--- branches/mono-1-1-7/mono/mono/metadata/ChangeLog    2005-05-05 15:27:46 UTC 
(rev 44088)
+++ branches/mono-1-1-7/mono/mono/metadata/ChangeLog    2005-05-05 15:50:38 UTC 
(rev 44089)
@@ -1,3 +1,18 @@
+Thu May 5 17:14:27 CEST 2005 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * mono-debug.c: unlock properly: the interface with the debugger will 
likely
+       need to change.
+
+Thu May 5 16:24:43 CEST 2005 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * mono-debug-debugger.c, mono-debug-debugger.h, mono-debug.c: remove 
thread
+       unsafe code in the debugger lock/unlock functions and always init the 
debugger
+       lock since it's use also when the debugger is not connected.
+
+2005-05-05  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * assembly.c (mono_assembly_load_reference): Fix warning.
+
 2005-05-04 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * threadpool.c: changed the default number of threads per cpu. From now

Modified: branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.c
===================================================================
--- branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.c        
2005-05-05 15:27:46 UTC (rev 44088)
+++ branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.c        
2005-05-05 15:50:38 UTC (rev 44089)
@@ -18,7 +18,7 @@
 static guint32 debugger_lock_level = 0;
 static CRITICAL_SECTION debugger_lock_mutex;
 static gboolean must_reload_symtabs = FALSE;
-static gboolean mono_debugger_initialized = FALSE;
+static gboolean mono_debugger_use_debugger = FALSE;
 static MonoObject *last_exception = NULL;
 
 struct _MonoDebuggerMetadataInfo {
@@ -68,11 +68,6 @@
 void
 mono_debugger_lock (void)
 {
-       if (!mono_debugger_initialized) {
-               debugger_lock_level++;
-               return;
-       }
-
        EnterCriticalSection (&debugger_lock_mutex);
        debugger_lock_level++;
 }
@@ -82,13 +77,8 @@
 {
        g_assert (debugger_lock_level > 0);
 
-       if (!mono_debugger_initialized) {
-               debugger_lock_level--;
-               return;
-       }
-
        if (debugger_lock_level == 1) {
-               if (must_reload_symtabs) {
+               if (must_reload_symtabs && mono_debugger_use_debugger) {
                        mono_debugger_event 
(MONO_DEBUGGER_EVENT_RELOAD_SYMTABS, 0, 0);
                        must_reload_symtabs = FALSE;
                }
@@ -99,20 +89,20 @@
 }
 
 void
-mono_debugger_initialize (void)
+mono_debugger_initialize (gboolean use_debugger)
 {
        MONO_GC_REGISTER_ROOT (last_exception);
        
-       g_assert (!mono_debugger_initialized);
+       g_assert (!mono_debugger_use_debugger);
 
        InitializeCriticalSection (&debugger_lock_mutex);
-       mono_debugger_initialized = TRUE;
+       mono_debugger_use_debugger = use_debugger;
 }
 
 void
 mono_debugger_add_symbol_file (MonoDebugHandle *handle)
 {
-       g_assert (mono_debugger_initialized);
+       g_assert (mono_debugger_use_debugger);
 
        mono_debugger_lock ();
        mono_debugger_event (MONO_DEBUGGER_EVENT_ADD_MODULE, GPOINTER_TO_UINT 
(handle), 0);
@@ -313,7 +303,7 @@
 gboolean
 mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject 
*exc)
 {
-       if (!mono_debugger_initialized)
+       if (!mono_debugger_use_debugger)
                return FALSE;
 
        // Prevent the object from being finalized.
@@ -328,7 +318,7 @@
 {
        MonoDebuggerExceptionInfo info;
 
-       if (!mono_debugger_initialized)
+       if (!mono_debugger_use_debugger)
                return;
 
        // Prevent the object from being finalized.
@@ -347,7 +337,7 @@
 {
        MonoDebuggerExceptionInfo info;
 
-       if (!mono_debugger_initialized)
+       if (!mono_debugger_use_debugger)
                return FALSE;
 
        // Prevent the object from being finalized.

Modified: branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.h
===================================================================
--- branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.h        
2005-05-05 15:27:46 UTC (rev 44088)
+++ branches/mono-1-1-7/mono/mono/metadata/mono-debug-debugger.h        
2005-05-05 15:50:38 UTC (rev 44089)
@@ -71,7 +71,7 @@
 
 extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 
data, guint64 arg);
 
-void            mono_debugger_initialize                  (void);
+void            mono_debugger_initialize                  (gboolean 
use_debugger);
 void            mono_debugger_cleanup                     (void);
 
 void            mono_debugger_lock                        (void);

Modified: branches/mono-1-1-7/mono/mono/metadata/mono-debug.c
===================================================================
--- branches/mono-1-1-7/mono/mono/metadata/mono-debug.c 2005-05-05 15:27:46 UTC 
(rev 44088)
+++ branches/mono-1-1-7/mono/mono/metadata/mono-debug.c 2005-05-05 15:50:38 UTC 
(rev 44089)
@@ -74,8 +74,7 @@
        mono_debug_format = format;
        in_the_mono_debugger = format == MONO_DEBUG_FORMAT_DEBUGGER;
 
-       if (in_the_mono_debugger)
-               mono_debugger_initialize ();
+       mono_debugger_initialize (in_the_mono_debugger);
 
        mono_debugger_lock ();
 
@@ -91,6 +90,8 @@
        mono_debugger_start_class_init_func = mono_debug_start_add_type;
        mono_debugger_class_init_func = mono_debug_add_type;
        mono_install_assembly_load_hook (mono_debug_add_assembly, NULL);
+
+       mono_debugger_unlock ();
 }
 
 void

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to