Author: martin
Date: 2007-04-04 08:34:13 -0400 (Wed, 04 Apr 2007)
New Revision: 75383
Modified:
trunk/mono/mono/metadata/ChangeLog
trunk/mono/mono/metadata/debug-helpers.c
Log:
2007-04-04 Martin Baulig <[EMAIL PROTECTED]>
* debug-helpers.c
(mono_method_desc_full_match): Add support for nested classes.
Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog 2007-04-04 11:22:45 UTC (rev 75382)
+++ trunk/mono/mono/metadata/ChangeLog 2007-04-04 12:34:13 UTC (rev 75383)
@@ -1,3 +1,8 @@
+2007-04-04 Martin Baulig <[EMAIL PROTECTED]>
+
+ * debug-helpers.c
+ (mono_method_desc_full_match): Add support for nested classes.
+
2007-04-02 Zoltan Varga <[EMAIL PROTECTED]>
* marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
Modified: trunk/mono/mono/metadata/debug-helpers.c
===================================================================
--- trunk/mono/mono/metadata/debug-helpers.c 2007-04-04 11:22:45 UTC (rev
75382)
+++ trunk/mono/mono/metadata/debug-helpers.c 2007-04-04 12:34:13 UTC (rev
75383)
@@ -298,13 +298,50 @@
return TRUE;
}
+static const char *
+my_strrchr (const char *str, char ch, int *len)
+{
+ int pos;
+
+ for (pos = (*len)-1; pos >= 0; pos--) {
+ if (str [pos] != ch)
+ continue;
+
+ *len = pos;
+ return str + pos;
+ }
+
+ return NULL;
+}
+
+static gboolean
+match_class (MonoMethodDesc *desc, int pos, MonoClass *klass)
+{
+ const char *p;
+
+ p = my_strrchr (desc->klass, '/', &pos);
+ if (!p) {
+ if (strncmp (desc->klass, klass->name, pos))
+ return FALSE;
+ if (desc->namespace && strcmp (desc->namespace,
klass->name_space))
+ return FALSE;
+ return TRUE;
+ }
+
+ if (strcmp (p+1, klass->name))
+ return FALSE;
+ if (!klass->nested_in)
+ return FALSE;
+
+ return match_class (desc, pos, klass->nested_in);
+}
+
gboolean
mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method)
{
- if (strcmp (desc->klass, method->klass->name))
+ if (!match_class (desc, strlen (desc->klass), method->klass))
return FALSE;
- if (desc->namespace && strcmp (desc->namespace,
method->klass->name_space))
- return FALSE;
+
return mono_method_desc_match (desc, method);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches