2009-05-12 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / debug-debugger.c
index 052b35698142cc5e849013bd5777717d17a6f5d0..b76d4d52a2ca5b57ca2dc56ed692967c7cb07a12 100644 (file)
@@ -308,7 +308,7 @@ debugger_insert_source_breakpoint (guint64 image_argument, guint64 token, guint6
        mono_debugger_lock ();
 
        klass = mono_debugger_register_class_init_callback (image, class_name, token, index);
-       if (!klass) {
+       if (!klass || !klass->inited || !klass->methods) {
                mono_debugger_unlock ();
                return 0;
        }
@@ -340,7 +340,7 @@ debugger_insert_source_breakpoint (guint64 image_argument, guint64 token, guint6
                        method = nm;
                }
 
-               info = mono_debugger_insert_method_breakpoint (method, index);
+               info = mono_debug_lookup_method_addresses (method);
                mono_debugger_unlock ();
                return (guint64) (gsize) info;
        }
@@ -354,6 +354,7 @@ debugger_remove_breakpoint (guint64 index, G_GNUC_UNUSED guint64 dummy)
 {
        mono_debugger_lock ();
        mono_debugger_remove_method_breakpoint (index);
+       mono_debugger_remove_class_init_callback (index);
        mono_debugger_unlock ();
 }