Author: martin
Date: 2007-06-21 09:00:04 -0400 (Thu, 21 Jun 2007)
New Revision: 80458

Added:
   trunk/mono/mono/mini/debug-mini.h
Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/mono-debug-debugger.c
   trunk/mono/mono/metadata/mono-debug-debugger.h
   trunk/mono/mono/metadata/mono-debug.c
   trunk/mono/mono/metadata/mono-debug.h
   trunk/mono/mono/mini/ChangeLog
   trunk/mono/mono/mini/Makefile.am
   trunk/mono/mono/mini/debug-mini.c
Log:
2007-06-21  Martin Baulig  <[EMAIL PROTECTED]>

        * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.

        * mono-debug-debugger.h
        (MonoDebuggerBreakpointInfo): Removed.
        (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
        (mono_debugger_remove_breakpoint): Likewise.
        (mono_debugger_breakpoint_callback): Likewise.
        (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2007-06-21 12:59:36 UTC (rev 80457)
+++ trunk/mono/mono/metadata/ChangeLog  2007-06-21 13:00:04 UTC (rev 80458)
@@ -1,3 +1,14 @@
+2007-06-21  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
+
+       * mono-debug-debugger.h
+       (MonoDebuggerBreakpointInfo): Removed.
+       (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
+       (mono_debugger_remove_breakpoint): Likewise.
+       (mono_debugger_breakpoint_callback): Likewise.
+       (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
+
 2007-06-21  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * metadata.c (mono_metadata_lookup_generic_class): The fully open

Modified: trunk/mono/mono/metadata/mono-debug-debugger.c
===================================================================
--- trunk/mono/mono/metadata/mono-debug-debugger.c      2007-06-21 12:59:36 UTC 
(rev 80457)
+++ trunk/mono/mono/metadata/mono-debug-debugger.c      2007-06-21 13:00:04 UTC 
(rev 80458)
@@ -93,12 +93,6 @@
 }
 
 void
-mono_debugger_start_add_type (MonoDebugHandle *symfile, MonoClass *klass)
-{
-       must_reload_symtabs = TRUE;
-}
-
-void
 mono_debugger_event (MonoDebuggerEvent event, guint64 data, guint64 arg)
 {
        if (mono_debugger_event_handler)
@@ -112,95 +106,6 @@
        mono_debugger_event_handler = NULL;
 }
 
-/*
- * Debugger breakpoint interface.
- *
- * This interface is used to insert breakpoints on methods which are not yet 
JITed.
- * The debugging code keeps a list of all such breakpoints and automatically 
inserts the
- * breakpoint when the method is JITed.
- */
-
-static GPtrArray *breakpoints = NULL;
-
-int
-mono_debugger_insert_breakpoint_full (MonoMethodDesc *desc)
-{
-       static int last_breakpoint_id = 0;
-       MonoDebuggerBreakpointInfo *info;
-
-       info = g_new0 (MonoDebuggerBreakpointInfo, 1);
-       info->desc = desc;
-       info->index = ++last_breakpoint_id;
-
-       if (!breakpoints)
-               breakpoints = g_ptr_array_new ();
-
-       g_ptr_array_add (breakpoints, info);
-
-       return info->index;
-}
-
-int
-mono_debugger_remove_breakpoint (int breakpoint_id)
-{
-       int i;
-
-       if (!breakpoints)
-               return 0;
-
-       for (i = 0; i < breakpoints->len; i++) {
-               MonoDebuggerBreakpointInfo *info = g_ptr_array_index 
(breakpoints, i);
-
-               if (info->index != breakpoint_id)
-                       continue;
-
-               mono_method_desc_free (info->desc);
-               g_ptr_array_remove (breakpoints, info);
-               g_free (info);
-               return 1;
-       }
-
-       return 0;
-}
-
-int
-mono_debugger_insert_breakpoint (const gchar *method_name, gboolean 
include_namespace)
-{
-       MonoMethodDesc *desc;
-
-       desc = mono_method_desc_new (method_name, include_namespace);
-       if (!desc)
-               return 0;
-
-       return mono_debugger_insert_breakpoint_full (desc);
-}
-
-int
-mono_debugger_method_has_breakpoint (MonoMethod *method)
-{
-       int i;
-
-       if (!breakpoints || (method->wrapper_type != MONO_WRAPPER_NONE))
-               return 0;
-
-       for (i = 0; i < breakpoints->len; i++) {
-               MonoDebuggerBreakpointInfo *info = g_ptr_array_index 
(breakpoints, i);
-
-               if (!mono_method_desc_full_match (info->desc, method))
-                       continue;
-
-               return info->index;
-       }
-
-       return 0;
-}
-
-void
-mono_debugger_breakpoint_callback (MonoMethod *method, guint32 index)
-{
-       mono_debugger_event (MONO_DEBUGGER_EVENT_JIT_BREAKPOINT, (guint64) 
(gsize) method, index);
-}
-
 gboolean
 mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject 
*exc)
 {
@@ -387,3 +292,9 @@
        goto again;
 }
 
+void
+mono_debugger_add_type (MonoDebugHandle *symfile, MonoClass *klass)
+{
+       must_reload_symtabs = TRUE;
+
+}

Modified: trunk/mono/mono/metadata/mono-debug-debugger.h
===================================================================
--- trunk/mono/mono/metadata/mono-debug-debugger.h      2007-06-21 12:59:36 UTC 
(rev 80457)
+++ trunk/mono/mono/metadata/mono-debug-debugger.h      2007-06-21 13:00:04 UTC 
(rev 80458)
@@ -13,8 +13,6 @@
 #include <mono/utils/mono-codeman.h>
 #include <mono/io-layer/io-layer.h>
 
-typedef struct _MonoDebuggerBreakpointInfo     MonoDebuggerBreakpointInfo;
-
 typedef enum {
        MONO_DEBUGGER_EVENT_INITIALIZE_MANAGED_CODE     = 1,
        MONO_DEBUGGER_EVENT_ADD_MODULE,
@@ -36,33 +34,24 @@
        MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE
 } MonoDebuggerEvent;
 
-struct _MonoDebuggerBreakpointInfo {
-       guint32 index;
-       MonoMethodDesc *desc;
-};
-
 extern void (*mono_debugger_event_handler) (MonoDebuggerEvent event, guint64 
data, guint64 arg);
 
-void            mono_debugger_initialize                  (gboolean 
use_debugger);
-void            mono_debugger_cleanup                     (void);
+void            mono_debugger_initialize                    (gboolean 
use_debugger);
+void            mono_debugger_cleanup                       (void);
 
-void            mono_debugger_lock                        (void);
-void            mono_debugger_unlock                      (void);
-void            mono_debugger_event                       (MonoDebuggerEvent 
event, guint64 data, guint64 arg);
+void            mono_debugger_lock                          (void);
+void            mono_debugger_unlock                        (void);
+void            mono_debugger_event                         (MonoDebuggerEvent 
event, guint64 data, guint64 arg);
 
-void            mono_debugger_add_symbol_file             (MonoDebugHandle 
*handle);
-void            mono_debugger_start_add_type              (MonoDebugHandle 
*symfile, MonoClass *klass);
+void            mono_debugger_add_symbol_file               (MonoDebugHandle 
*handle);
+void            mono_debugger_add_type                      (MonoDebugHandle 
*symfile, MonoClass *klass);
 
-int             mono_debugger_insert_breakpoint_full      (MonoMethodDesc 
*desc);
-int             mono_debugger_remove_breakpoint           (int breakpoint_id);
-void            mono_debugger_breakpoint_callback         (MonoMethod *method, 
guint32 idx);
+MonoObject     *mono_debugger_runtime_invoke                (MonoMethod 
*method, void *obj,
+                                                            void **params, 
MonoObject **exc);
 
-MonoObject     *mono_debugger_runtime_invoke              (MonoMethod *method, 
void *obj,
-                                                          void **params, 
MonoObject **exc);
+gboolean        mono_debugger_lookup_type                   (const gchar 
*type_name);
+gint32          mono_debugger_lookup_assembly               (const gchar 
*name);
 
-gboolean        mono_debugger_lookup_type                 (const gchar 
*type_name);
-gint32          mono_debugger_lookup_assembly             (const gchar *name);
-
 void *
 mono_vtable_get_static_field_data (MonoVTable *vt);
 

Modified: trunk/mono/mono/metadata/mono-debug.c
===================================================================
--- trunk/mono/mono/metadata/mono-debug.c       2007-06-21 12:59:36 UTC (rev 
80457)
+++ trunk/mono/mono/metadata/mono-debug.c       2007-06-21 13:00:04 UTC (rev 
80458)
@@ -812,7 +812,7 @@
        if (max_size > BUFSIZ)
                g_free (oldptr);
 
-       mono_debugger_start_add_type (handle, klass);
+       mono_debugger_add_type (handle, klass);
 }
 
 static MonoDebugMethodJitInfo *

Modified: trunk/mono/mono/metadata/mono-debug.h
===================================================================
--- trunk/mono/mono/metadata/mono-debug.h       2007-06-21 12:59:36 UTC (rev 
80457)
+++ trunk/mono/mono/metadata/mono-debug.h       2007-06-21 13:00:04 UTC (rev 
80458)
@@ -186,7 +186,7 @@
        guint32 end_scope;
 };
 
-#define MONO_DEBUGGER_VERSION                          58
+#define MONO_DEBUGGER_VERSION                          59
 #define MONO_DEBUGGER_MAGIC                            0x7aff65af4253d427ULL
 
 extern MonoSymbolTable *mono_symbol_table;

Modified: trunk/mono/mono/mini/ChangeLog
===================================================================
--- trunk/mono/mono/mini/ChangeLog      2007-06-21 12:59:36 UTC (rev 80457)
+++ trunk/mono/mono/mini/ChangeLog      2007-06-21 13:00:04 UTC (rev 80458)
@@ -1,3 +1,13 @@
+2007-06-21  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * debug-mini.h: New file.
+
+       * debug-mini.c
+       (mono_debugger_insert_breakpoint_full): Moved here from
+       ../metadata/mono-debug-debugger.c.
+       (mono_debugger_remove_breakpoint): Likewise.
+       (mono_debugger_breakpoint_callback): Likewise.
+
 2007-06-15  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * jit-icalls.c (mono_helper_compile_generic_method): Update to

Modified: trunk/mono/mono/mini/Makefile.am
===================================================================
--- trunk/mono/mono/mini/Makefile.am    2007-06-21 12:59:36 UTC (rev 80457)
+++ trunk/mono/mono/mini/Makefile.am    2007-06-21 13:00:04 UTC (rev 80458)
@@ -218,6 +218,7 @@
        simple-mini-ops.h \
        driver.c        \
        debug-mini.c    \
+       debug-mini.h    \
        linear-scan.c   \
        aot-compiler.c          \
        aot-runtime.c           \

Modified: trunk/mono/mono/mini/debug-mini.c
===================================================================
--- trunk/mono/mono/mini/debug-mini.c   2007-06-21 12:59:36 UTC (rev 80457)
+++ trunk/mono/mono/mini/debug-mini.c   2007-06-21 13:00:04 UTC (rev 80458)
@@ -15,11 +15,17 @@
 #include <mono/metadata/mono-debug.h>
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/mono-debug-debugger.h>
+#include "debug-mini.h"
 
 #ifdef HAVE_VALGRIND_H
 #include <valgrind/valgrind.h>
 #endif
 
+typedef struct {
+       guint32 index;
+       MonoMethodDesc *desc;
+} MiniDebugBreakpointInfo;
+
 typedef struct
 {
        MonoDebugMethodJitInfo *jit;
@@ -195,6 +201,7 @@
        MonoDebugMethodJitInfo *jit;
        MonoMethodHeader *header;
        MonoMethodSignature *sig;
+       MonoDebugMethodAddress *debug_info;
        MonoMethod *method;
        int i;
 
@@ -236,7 +243,7 @@
        for (i = 0; i < jit->num_line_numbers; i++)
                jit->line_numbers [i] = g_array_index (info->line_numbers, 
MonoDebugLineNumberEntry, i);
 
-       mono_debug_add_method (method, jit, cfg->domain);
+       debug_info = mono_debug_add_method (method, jit, cfg->domain);
 
        mono_debug_add_vg_method (method, jit);
 
@@ -603,6 +610,7 @@
        jit = mono_debug_find_method (minfo, domain);
        if (!jit)
                return;
+
        if (only_arguments) {
                char **names;
                names = g_new (char *, jit->num_params);
@@ -620,3 +628,91 @@
        }
 }
 
+/*
+ * Debugger breakpoint interface.
+ *
+ * This interface is used to insert breakpoints on methods which are not yet 
JITed.
+ * The debugging code keeps a list of all such breakpoints and automatically 
inserts the
+ * breakpoint when the method is JITed.
+ */
+
+static GPtrArray *breakpoints = NULL;
+
+int
+mono_debugger_insert_breakpoint_full (MonoMethodDesc *desc)
+{
+       static int last_breakpoint_id = 0;
+       MiniDebugBreakpointInfo *info;
+
+       info = g_new0 (MiniDebugBreakpointInfo, 1);
+       info->desc = desc;
+       info->index = ++last_breakpoint_id;
+
+       if (!breakpoints)
+               breakpoints = g_ptr_array_new ();
+
+       g_ptr_array_add (breakpoints, info);
+
+       return info->index;
+}
+
+int
+mono_debugger_remove_breakpoint (int breakpoint_id)
+{
+       int i;
+
+       if (!breakpoints)
+               return 0;
+
+       for (i = 0; i < breakpoints->len; i++) {
+               MiniDebugBreakpointInfo *info = g_ptr_array_index (breakpoints, 
i);
+
+               if (info->index != breakpoint_id)
+                       continue;
+
+               mono_method_desc_free (info->desc);
+               g_ptr_array_remove (breakpoints, info);
+               g_free (info);
+               return 1;
+       }
+
+       return 0;
+}
+
+int
+mono_debugger_insert_breakpoint (const gchar *method_name, gboolean 
include_namespace)
+{
+       MonoMethodDesc *desc;
+
+       desc = mono_method_desc_new (method_name, include_namespace);
+       if (!desc)
+               return 0;
+
+       return mono_debugger_insert_breakpoint_full (desc);
+}
+
+int
+mono_debugger_method_has_breakpoint (MonoMethod *method)
+{
+       int i;
+
+       if (!breakpoints || (method->wrapper_type != MONO_WRAPPER_NONE))
+               return 0;
+
+       for (i = 0; i < breakpoints->len; i++) {
+               MiniDebugBreakpointInfo *info = g_ptr_array_index (breakpoints, 
i);
+
+               if (!mono_method_desc_full_match (info->desc, method))
+                       continue;
+
+               return info->index;
+       }
+
+       return 0;
+}
+
+void
+mono_debugger_breakpoint_callback (MonoMethod *method, guint32 index)
+{
+       mono_debugger_event (MONO_DEBUGGER_EVENT_JIT_BREAKPOINT, (guint64) 
(gsize) method, index);
+}

Added: trunk/mono/mono/mini/debug-mini.h
===================================================================
--- trunk/mono/mono/mini/debug-mini.h   2007-06-21 12:59:36 UTC (rev 80457)
+++ trunk/mono/mono/mini/debug-mini.h   2007-06-21 13:00:04 UTC (rev 80458)
@@ -0,0 +1,11 @@
+#ifndef __DEBUG_MINI_H__
+#define __DEBUG_MINI_H__
+
+#include <mono/metadata/class-internals.h>
+#include <mono/metadata/mono-debug-debugger.h>
+
+int             mono_debugger_insert_breakpoint_full      (MonoMethodDesc 
*desc);
+int             mono_debugger_remove_breakpoint           (int breakpoint_id);
+void            mono_debugger_breakpoint_callback         (MonoMethod *method, 
guint32 idx);
+
+#endif

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

Reply via email to