Author: martin
Date: 2007-06-21 08:44:17 -0400 (Thu, 21 Jun 2007)
New Revision: 80451

Modified:
   branches/martin/debugger-dublin/runtime/mini/debug-debugger.c
   branches/martin/debugger-dublin/runtime/mini/debug-debugger.h
Log:
Add backwards compatibility.

Modified: branches/martin/debugger-dublin/runtime/mini/debug-debugger.c
===================================================================
--- branches/martin/debugger-dublin/runtime/mini/debug-debugger.c       
2007-06-21 12:42:16 UTC (rev 80450)
+++ branches/martin/debugger-dublin/runtime/mini/debug-debugger.c       
2007-06-21 12:44:17 UTC (rev 80451)
@@ -26,24 +26,32 @@
 #error "Some clown #defined MONO_DEBUGGER_SUPPORTED without USE_INCLUDED_GC - 
fix configure.in!"
 #endif
 
+static guint64 old_debugger_insert_breakpoint (guint64 method_arg, const gchar 
*string_arg);
+static guint64 old_debugger_remove_breakpoint (guint64 breakpoint);
 static guint64 debugger_compile_method (guint64 method_arg);
 static guint64 debugger_get_virtual_method (guint64 class_arg, guint64 
method_arg);
 static guint64 debugger_get_boxed_object (guint64 klass_arg, guint64 val_arg);
+static guint64 old_debugger_create_string (G_GNUC_UNUSED guint64 dummy, const 
gchar *string_arg);
+static guint64 debugger_class_get_static_field_data (guint64 klass);
+
+static guint64 old_debugger_lookup_class (guint64 image_argument, guint64 
token_arg);
+static guint64 old_debugger_lookup_assembly (G_GNUC_UNUSED guint64 dummy, 
const gchar *string_arg);
+
+static guint64 debugger_run_finally (guint64 argument1, guint64 argument2);
+static guint64 debugger_get_current_thread (void);
+static void debugger_attach (void);
+static void debugger_detach (void);
+static void debugger_initialize (void);
+
 static guint64 debugger_create_string (G_GNUC_UNUSED guint64 dummy, 
G_GNUC_UNUSED guint64 dummy2,
                                       const gchar *string_argument);
-static guint64 debugger_class_get_static_field_data (guint64 klass);
 static gint64 debugger_lookup_class (guint64 image_argument, G_GNUC_UNUSED 
guint64 dummy,
                                     gchar *full_name);
 static guint64 debugger_lookup_assembly (G_GNUC_UNUSED guint64 dummy, 
G_GNUC_UNUSED guint64 dummy2,
                                         const gchar *string_argument);
-static guint64 debugger_run_finally (guint64 argument1, guint64 argument2);
-static guint64 debugger_get_current_thread (void);
 static gint64 debugger_get_method_addr_or_bpt (guint64 method_argument, 
guint64 index);
 static void debugger_remove_method_breakpoint (G_GNUC_UNUSED guint64 dummy, 
guint64 index);
 static void debugger_runtime_class_init (guint64 klass_arg);
-static void debugger_attach (void);
-static void debugger_detach (void);
-static void debugger_initialize (void);
 
 static void (*mono_debugger_notification_function) (guint64 command, guint64 
data, guint64 data2);
 
@@ -109,23 +117,48 @@
        &debugger_compile_method,
        &debugger_get_virtual_method,
        &debugger_get_boxed_object,
+       &old_debugger_insert_breakpoint,
+       &old_debugger_remove_breakpoint,
        &mono_debugger_runtime_invoke,
-       &debugger_create_string,
+       &old_debugger_create_string,
        &debugger_class_get_static_field_data,
-       &debugger_lookup_class,
-       &debugger_lookup_assembly,
+       &old_debugger_lookup_class,
+       0,
+       &old_debugger_lookup_assembly,
        &debugger_run_finally,
        &debugger_get_current_thread,
-       &debugger_get_method_addr_or_bpt,
-       &debugger_remove_method_breakpoint,
-       &debugger_runtime_class_init,
        &debugger_attach,
        &debugger_detach,
        &debugger_initialize,
-       (void*)&mono_get_lmf_addr
+       (void*)&mono_get_lmf_addr,
+
+       &debugger_create_string,
+       &debugger_lookup_class,
+       &debugger_lookup_assembly,
+       &debugger_get_method_addr_or_bpt,
+       &debugger_remove_method_breakpoint,
+       &debugger_runtime_class_init
 };
 
 static guint64
+old_debugger_insert_breakpoint (guint64 method_argument, const gchar 
*string_argument)
+{
+       MonoMethodDesc *desc;
+
+       desc = mono_method_desc_new (string_argument, TRUE);
+       if (!desc)
+               return 0;
+
+       return (guint64) mono_debugger_insert_breakpoint_full (desc);
+}
+
+static guint64
+old_debugger_remove_breakpoint (guint64 breakpoint)
+{
+       return mono_debugger_remove_breakpoint (breakpoint);
+}
+
+static guint64
 debugger_compile_method (guint64 method_arg)
 {
        MonoMethod *method = (MonoMethod *) GUINT_TO_POINTER ((gsize) 
method_arg);
@@ -171,12 +204,43 @@
 }
 
 static guint64
+old_debugger_create_string (G_GNUC_UNUSED guint64 dummy, const gchar 
*string_arg)
+{
+       return (guint64) (gsize) mono_string_new_wrapper (string_arg);
+}
+
+static guint64
 debugger_create_string (G_GNUC_UNUSED guint64 dummy, G_GNUC_UNUSED guint64 
dummy2,
                        const gchar *string_argument)
 {
        return (guint64) (gsize) mono_string_new_wrapper (string_argument);
 }
 
+static guint64
+old_debugger_lookup_class (guint64 image_argument, guint64 token_argument)
+{
+       MonoImage *image = (MonoImage *) GUINT_TO_POINTER ((gsize) 
image_argument);
+       guint32 token = (guint32) token_argument;
+       MonoClass *klass;
+
+       klass = mono_class_get (image, token);
+       if (klass)
+               mono_class_init (klass);
+
+       return (guint64) (gsize) klass;
+}
+
+static guint64
+old_debugger_lookup_assembly (G_GNUC_UNUSED guint64 dummy, const gchar 
*string_arg)
+{
+       gint64 retval;
+
+       mono_debugger_lock ();
+       retval = mono_debugger_lookup_assembly (string_arg);
+       mono_debugger_unlock ();
+       return retval;
+}
+
 static gint64
 debugger_lookup_class (guint64 image_argument, G_GNUC_UNUSED guint64 dummy,
                       gchar *full_name)

Modified: branches/martin/debugger-dublin/runtime/mini/debug-debugger.h
===================================================================
--- branches/martin/debugger-dublin/runtime/mini/debug-debugger.h       
2007-06-21 12:42:16 UTC (rev 80450)
+++ branches/martin/debugger-dublin/runtime/mini/debug-debugger.h       
2007-06-21 12:44:17 UTC (rev 80451)
@@ -39,23 +39,30 @@
        guint64 (*compile_method) (guint64 method_argument);
        guint64 (*get_virtual_method) (guint64 object_argument, guint64 
method_argument);
        guint64 (*get_boxed_object_method) (guint64 klass_argument, guint64 
val_argument);
+       guint64 (*old_insert_breakpoint) (guint64 method_arg, const gchar 
*string_arg);
+       guint64 (*old_remove_breakpoint) (guint64 breakpoint);
        MonoInvokeFunc runtime_invoke;
+       guint64 (*old_create_string) (G_GNUC_UNUSED guint64 dummy, const gchar 
*string_arg);
+       guint64 (*class_get_static_field_data) (guint64 klass);
+       guint64 (*old_lookup_class) (guint64 image_argument, guint64 token_arg);
+       guint64 obsolete_dummy1;  /* `lookup_type' was already unused in 0.50 
"Dublin". */
+       guint64 (*old_lookup_assembly) (guint64 dummy_argument, const gchar 
*string_argument);
+       guint64 (*run_finally) (guint64 argument1, guint64 argument2);
+       guint64 (*get_current_thread) (void);
+       void (*attach) (void);
+       void (*detach) (void);
+       void (*initialize) (void);
+       void * (*get_lmf_addr) (void);
+
        guint64 (*create_string) (G_GNUC_UNUSED guint64 dummy1, G_GNUC_UNUSED 
guint64 dummy2,
                                  const gchar *string_argument);
-       guint64 (*class_get_static_field_data) (guint64 klass);
        gint64 (*lookup_class) (guint64 image_argument, G_GNUC_UNUSED guint64 
dummy,
                                gchar *full_name);
-       guint64 (*lookup_assembly) (G_GNUC_UNUSED guint64 dummy1, G_GNUC_UNUSED 
guint64 dummy2,
+       guint64 (*lookup_assembly) (G_GNUC_UNUSED guint64 dummy, G_GNUC_UNUSED 
guint64 dummy2,
                                    const gchar *string_argument);
-       guint64 (*run_finally) (guint64 argument1, guint64 argument2);
-       guint64 (*get_current_thread) (void);
        gint64 (*get_method_addr_or_bpt) (guint64 method_argument, guint64 
index);
        void (*remove_method_breakpoint) (G_GNUC_UNUSED guint64 dummy, guint64 
index);
        void (*runtime_class_init) (guint64 klass_arg);
-       void (*attach) (void);
-       void (*detach) (void);
-       void (*initialize) (void);
-       void * (*get_lmf_addr) (void);
 };
 
 struct _MonoDebuggerMetadataInfo {

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

Reply via email to