Author: martin
Date: 2007-06-06 09:21:24 -0400 (Wed, 06 Jun 2007)
New Revision: 78733
Modified:
branches/martin/debugger-dublin/runtime/metadata/mono-debug.c
branches/martin/debugger-dublin/runtime/metadata/mono-debug.h
branches/martin/debugger-dublin/runtime/mini/debug-debugger.c
branches/martin/debugger-dublin/runtime/mini/debug-mini.c
Log:
We're passing a 'make check' again.
Modified: branches/martin/debugger-dublin/runtime/metadata/mono-debug.c
===================================================================
--- branches/martin/debugger-dublin/runtime/metadata/mono-debug.c
2007-06-06 13:09:14 UTC (rev 78732)
+++ branches/martin/debugger-dublin/runtime/metadata/mono-debug.c
2007-06-06 13:21:24 UTC (rev 78733)
@@ -815,22 +815,27 @@
mono_debugger_add_type (handle, klass);
}
-static MonoDebugMethodAddress *
+static MonoDebugMethodJitInfo *
find_method (MonoDebugMethodInfo *minfo, MonoDomain *domain)
{
MethodHashEntry lookup;
+ MonoDebugMethodAddress *address;
lookup.symfile_id = minfo->handle->index;
lookup.domain_id = mono_domain_get_id (domain);
lookup.method_id = minfo->index;
- return g_hash_table_lookup (method_hash, &lookup);
+ address = g_hash_table_lookup (method_hash, &lookup);
+ if (!address)
+ return NULL;
+
+ return mono_debug_read_method (address);
}
-MonoDebugMethodAddress *
+MonoDebugMethodJitInfo *
mono_debug_find_method (MonoDebugMethodInfo *minfo, MonoDomain *domain)
{
- MonoDebugMethodAddress *res;
+ MonoDebugMethodJitInfo *res;
mono_debugger_lock ();
res = find_method (minfo, domain);
mono_debugger_unlock ();
Modified: branches/martin/debugger-dublin/runtime/metadata/mono-debug.h
===================================================================
--- branches/martin/debugger-dublin/runtime/metadata/mono-debug.h
2007-06-06 13:09:14 UTC (rev 78732)
+++ branches/martin/debugger-dublin/runtime/metadata/mono-debug.h
2007-06-06 13:21:24 UTC (rev 78733)
@@ -208,7 +208,7 @@
MonoDebugMethodInfo *mono_debug_lookup_method (MonoMethod *method);
-MonoDebugMethodAddress *
+MonoDebugMethodJitInfo*
mono_debug_find_method (MonoDebugMethodInfo *minfo, MonoDomain *domain);
/*
Modified: branches/martin/debugger-dublin/runtime/mini/debug-debugger.c
===================================================================
--- branches/martin/debugger-dublin/runtime/mini/debug-debugger.c
2007-06-06 13:09:14 UTC (rev 78732)
+++ branches/martin/debugger-dublin/runtime/mini/debug-debugger.c
2007-06-06 13:21:24 UTC (rev 78733)
@@ -236,6 +236,8 @@
gchar *name_space, *name, *pos;
MonoClass *klass;
+ g_message (G_STRLOC ": %p - %p", image, full_name);
+ g_message (G_STRLOC ": %p - %s", image, full_name);
pos = strrchr (full_name, '.');
if (pos) {
name_space = full_name;
@@ -287,27 +289,43 @@
{
MonoMethod *method = GUINT_TO_POINTER ((gsize) method_argument);
MonoDomain *domain = mono_get_root_domain ();
- MonoDebugMethodInfo *minfo;
- MonoDebugMethodAddress *address;
+ MonoJitInfo *info;
- mono_debugger_lock ();
- minfo = mono_debug_lookup_method (method);
- g_message (G_STRLOC ": %p - %p", method, minfo);
- if (!minfo) {
- mono_debugger_unlock ();
- return -1;
- }
+ g_message (G_STRLOC ": %p - %p - %s.%s.%s", method, domain,
+ method->klass->name_space, method->klass->name,
method->name);
- address = mono_debug_find_method (minfo, domain);
- g_message (G_STRLOC ": %p", address);
+ mono_domain_lock (domain);
- if (address) {
- mono_debugger_unlock ();
- return (gint64) (gssize) address;
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_RUNTIME) {
+ const char *name = method->name;
+ MonoMethod *nm = NULL;
+
+ if (method->klass->parent ==
mono_defaults.multicastdelegate_class) {
+ if (*name == 'I' && (strcmp (name, "Invoke") == 0))
+ nm = mono_marshal_get_delegate_invoke (method);
+ else if (*name == 'B' && (strcmp (name, "BeginInvoke")
== 0))
+ nm = mono_marshal_get_delegate_begin_invoke
(method);
+ else if (*name == 'E' && (strcmp (name, "EndInvoke") ==
0))
+ nm = mono_marshal_get_delegate_end_invoke
(method);
+ }
+
+ if (!nm) {
+ mono_domain_unlock (domain);
+ return -1;
+ }
+
+ method = nm;
}
+ if ((info = g_hash_table_lookup (domain->jit_code_hash, method))) {
+ mono_domain_unlock (domain);
+ g_message (G_STRLOC ": %p - %p", method, info->code_start);
+ return (gint64) (gssize) info->code_start;
+ }
+
+ g_message (G_STRLOC ": %p - %Ld", method, index);
mono_debugger_insert_method_breakpoint (method, index);
- mono_debugger_unlock ();
+ mono_domain_unlock (domain);
return 0;
}
Modified: branches/martin/debugger-dublin/runtime/mini/debug-mini.c
===================================================================
--- branches/martin/debugger-dublin/runtime/mini/debug-mini.c 2007-06-06
13:09:14 UTC (rev 78732)
+++ branches/martin/debugger-dublin/runtime/mini/debug-mini.c 2007-06-06
13:21:24 UTC (rev 78733)
@@ -36,7 +36,7 @@
} MiniDebugMethodInfo;
static void
-mono_debugger_check_breakpoints (MonoMethod *method, MonoDebugMethodAddress
*debug_info);
+mono_debugger_check_breakpoints (MonoMethod *method, gpointer address);
static inline void
record_line_number (MiniDebugMethodInfo *info, guint32 address, guint32 offset)
@@ -254,7 +254,7 @@
if (info->breakpoint_id)
mono_debugger_breakpoint_callback (method, info->breakpoint_id);
- mono_debugger_check_breakpoints (method, debug_info);
+ mono_debugger_check_breakpoints (method, jit->code_start);
mono_debug_free_method_jit_info (jit);
g_array_free (info->line_numbers, TRUE);
@@ -604,7 +604,6 @@
MonoJitInfo *ji = mono_jit_info_table_find (domain, ip);
MonoDebugMethodInfo *minfo;
MonoDebugMethodJitInfo *jit;
- MonoDebugMethodAddress *address;
int i;
if (!ji)
@@ -614,11 +613,7 @@
if (!minfo)
return;
- address = mono_debug_find_method (minfo, domain);
- if (!address)
- return;
-
- jit = mono_debug_read_method (address);
+ jit = mono_debug_find_method (minfo, domain);
if (!jit)
return;
@@ -688,7 +683,7 @@
}
static void
-mono_debugger_check_breakpoints (MonoMethod *method, MonoDebugMethodAddress
*debug_info)
+mono_debugger_check_breakpoints (MonoMethod *method, gpointer address)
{
MiniDebugBreakpointInfo *info;
gboolean first = TRUE;
@@ -706,11 +701,11 @@
if (first) {
mono_debugger_event (
MONO_DEBUGGER_EVENT_METHOD_COMPILED, (guint64)
(gsize) method,
- (guint64) (gsize) debug_info);
+ (guint64) (gsize) address);
first = FALSE;
}
mono_debugger_event (MONO_DEBUGGER_EVENT_JIT_BREAKPOINT,
- (guint64) (gsize) debug_info, info->index);
+ (guint64) (gsize) address, info->index);
}
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches