Author: martin
Date: 2005-04-22 11:35:53 -0400 (Fri, 22 Apr 2005)
New Revision: 43446

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/mono-debug.c
   trunk/mono/mono/metadata/mono-debug.h
   trunk/mono/mono/mini/debug-mini.c
Log:
2005-04-22  Martin Baulig  <[EMAIL PROTECTED]>

        * mono-debug.h (MonoDebugMethodJitInfo): Added
        `MonoDebugMethodJitInfo *jit'.

        * mono-debug.c (mono_debug_read_method): Cache the
        MonoDebugMethodJitInfo in `address->jit'.
        (mono_debug_free_method_jit_info): New public method.



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2005-04-22 15:08:46 UTC (rev 43445)
+++ trunk/mono/mono/metadata/ChangeLog  2005-04-22 15:35:53 UTC (rev 43446)
@@ -1,5 +1,14 @@
 2005-04-22  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * mono-debug.h (MonoDebugMethodJitInfo): Added
+       `MonoDebugMethodJitInfo *jit'.
+
+       * mono-debug.c (mono_debug_read_method): Cache the
+       MonoDebugMethodJitInfo in `address->jit'.
+       (mono_debug_free_method_jit_info): New public method.
+
+2005-04-22  Martin Baulig  <[EMAIL PROTECTED]>
+
        * class.c (mono_class_is_assignable_from): Disallow
        type parameter -> interface.
 

Modified: trunk/mono/mono/metadata/mono-debug.c
===================================================================
--- trunk/mono/mono/metadata/mono-debug.c       2005-04-22 15:08:46 UTC (rev 
43445)
+++ trunk/mono/mono/metadata/mono-debug.c       2005-04-22 15:35:53 UTC (rev 
43446)
@@ -543,7 +543,10 @@
        guint32 i, il_offset = 0, native_offset = 0;
        guint8 *ptr;
 
-       jit = g_new0 (MonoDebugMethodJitInfo, 1);
+       if (address->jit)
+               return address->jit;
+
+       jit = address->jit = g_new0 (MonoDebugMethodJitInfo, 1);
        jit->code_start = address->code_start;
        jit->code_size = address->code_size;
        jit->wrapper_addr = address->wrapper_addr;
@@ -603,6 +606,19 @@
        return jit;
 }
 
+void
+mono_debug_free_method_jit_info (MonoDebugMethodJitInfo *jit)
+{
+       if (jit->address)
+               jit->address->jit = NULL;
+
+       g_free (jit->line_numbers);
+       g_free (jit->this_var);
+       g_free (jit->params);
+       g_free (jit->locals);
+       g_free (jit);
+}
+
 /*
  * This is called via the `mono_debugger_class_init_func' from 
mono_class_init() each time
  * a new class is initialized.

Modified: trunk/mono/mono/metadata/mono-debug.h
===================================================================
--- trunk/mono/mono/metadata/mono-debug.h       2005-04-22 15:08:46 UTC (rev 
43445)
+++ trunk/mono/mono/metadata/mono-debug.h       2005-04-22 15:35:53 UTC (rev 
43446)
@@ -107,6 +107,7 @@
 };
 
 struct _MonoDebugMethodJitInfo {
+       MonoDebugMethodAddress *address;
        const guint8 *code_start;
        guint32 code_size;
        guint32 prologue_end;
@@ -131,6 +132,7 @@
        const guint8 *code_start;
        guint32 code_size;
        const guint8 *wrapper_addr;
+       MonoDebugMethodJitInfo *jit;
        guint8 data [MONO_ZERO_LEN_ARRAY];
 };
 
@@ -165,7 +167,7 @@
        guint32 end_scope;
 };
 
-#define MONO_DEBUGGER_VERSION                          48
+#define MONO_DEBUGGER_VERSION                          49
 #define MONO_DEBUGGER_MAGIC                            0x7aff65af4253d427ULL
 
 extern MonoSymbolTable *mono_symbol_table;
@@ -180,6 +182,7 @@
 MonoDebugMethodAddress *mono_debug_add_method (MonoMethod *method, 
MonoDebugMethodJitInfo *jit,
                                               MonoDomain *domain);
 MonoDebugMethodJitInfo *mono_debug_read_method (MonoDebugMethodAddress 
*address);
+void mono_debug_free_method_jit_info (MonoDebugMethodJitInfo *jit);
 gchar *mono_debug_source_location_from_address (MonoMethod *method, guint32 
address,
                                                guint32 *line_number, 
MonoDomain *domain);
 gchar *mono_debug_source_location_from_il_offset (MonoMethod *method, guint32 
offset,

Modified: trunk/mono/mono/mini/debug-mini.c
===================================================================
--- trunk/mono/mono/mini/debug-mini.c   2005-04-22 15:08:46 UTC (rev 43445)
+++ trunk/mono/mono/mini/debug-mini.c   2005-04-22 15:35:53 UTC (rev 43446)
@@ -189,16 +189,6 @@
 #endif /* VALGRIND_ADD_LINE_INFO */
 }
 
-static void
-free_jit_debug_info (MonoDebugMethodJitInfo *jit)
-{
-       g_free (jit->line_numbers);
-       g_free (jit->this_var);
-       g_free (jit->params);
-       g_free (jit->locals);
-       g_free (jit);
-}
-
 void
 mono_debug_close_method (MonoCompile *cfg)
 {
@@ -254,7 +244,7 @@
        if (info->breakpoint_id)
                mono_debugger_breakpoint_callback (method, info->breakpoint_id);
 
-       free_jit_debug_info (jit);
+       mono_debug_free_method_jit_info (jit);
        g_array_free (info->line_numbers, TRUE);
        g_free (info);
 }
@@ -529,7 +519,7 @@
 
        mono_debug_add_vg_method (method, jit);
 
-       free_jit_debug_info (jit);
+       mono_debug_free_method_jit_info (jit);
 }
 
 MonoDomain *

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

Reply via email to