2003-02-02 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Sun, 2 Feb 2003 21:16:23 +0000 (21:16 -0000)
committerMartin Baulig <martin@novell.com>
Sun, 2 Feb 2003 21:16:23 +0000 (21:16 -0000)
* jit.c (mono_jit_compile_method): Call mono_debug_add_wrapper()
to add the interncall to the symbol file.

* debug.c (mono_debug_add_wrapper): New public function.

svn path=/trunk/mono/; revision=11126

mono/jit/ChangeLog
mono/jit/debug.c
mono/jit/debug.h
mono/jit/jit.c

index 7d1f219cc3de761d2bdc5573552ef88b9205839f..c83df40af94bd574eb58ab98555897fb5da7d8d9 100644 (file)
@@ -1,3 +1,10 @@
+2003-02-02  Martin Baulig  <martin@ximian.com>
+
+       * jit.c (mono_jit_compile_method): Call mono_debug_add_wrapper()
+       to add the interncall to the symbol file.
+
+       * debug.c (mono_debug_add_wrapper): New public function.
+
 2003-02-02  Martin Baulig  <martin@ximian.com>
 
        * debug.c (debug_update_il_offsets): Set the prologue end address
index 02be760c83adcb2f75ee9e91f5587bd3089b29a5..5e2e6340474fac69fde9dda9ac0a6e70f033d9bb 100644 (file)
@@ -1167,6 +1167,49 @@ mono_debug_add_method (MonoFlowGraph *cfg)
        mono_debug_unlock ();
 }
 
+void
+mono_debug_add_wrapper (MonoMethod *method)
+{
+       MonoClass *klass = method->klass;
+       AssemblyDebugInfo* info;
+       MonoDebugMethodInfo *minfo;
+       MonoDebugMethodJitInfo *jit;
+
+       if (!mono_debug_handle)
+               return;
+
+       if (!(method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL))
+               return;
+
+       mono_class_init (klass);
+
+       info = mono_debug_get_image (mono_debug_handle, klass->image);
+       g_assert (info);
+
+       minfo = lookup_method (method);
+       if (!minfo || minfo->jit)
+               return;
+
+       mono_debug_lock ();
+
+       mono_debug_handle->dirty = TRUE;
+
+       minfo->jit = jit = g_new0 (MonoDebugMethodJitInfo, 1);
+       jit->code_start = method->info;
+       jit->code_size = 10;
+       jit->prologue_end = 0;
+       jit->epilogue_begin = 10;
+       jit->num_params = 0;
+       jit->wrapper_addr = method->addr;
+
+       if (info->symfile) {
+               mono_debug_symfile_add_method (info->symfile, method);
+               mono_debugger_event (MONO_DEBUGGER_EVENT_METHOD_ADDED, info->symfile, method);
+       }
+
+       mono_debug_unlock ();
+}
+
 gchar *
 mono_debug_source_location_from_address (MonoMethod *method, guint32 address, guint32 *line_number)
 {
index f302540ff2cdb6c8b2a6da725f41b1553f29ade3..b2e1c3988a7b08432ed33b52005a78d2a597eeba 100644 (file)
@@ -71,6 +71,8 @@ void           mono_debug_cleanup (void);
 
 void           mono_debug_add_method (MonoFlowGraph *cfg);
 
+void           mono_debug_add_wrapper (MonoMethod *method);
+
 void           mono_debug_add_type (MonoClass *klass);
 
 gchar *        mono_debug_source_location_from_address (MonoMethod *method, guint32 address,
index 9c87deac16e815978d11ca5eb5ddeec179f17086..3934379d3e8dd01ae16ce0020660bc31ac4919ec 100644 (file)
@@ -3830,7 +3830,11 @@ mono_jit_compile_method (MonoMethod *method)
 #ifdef MONO_USE_EXC_TABLES
                        }
 #endif
+
+                       if (mono_debug_format != MONO_DEBUG_FORMAT_NONE) 
+                               mono_debug_add_wrapper (method);
                }
+
                return method->info;
        }