X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fdebug-helpers.c;h=712b8023a039a25ff8f7d784e8525f7d0bdfc2a1;hb=94d44cb64a97e7252140bf7dd8e77071eda8480d;hp=810c29c4a698aa86aef4d38cce265980e001c17b;hpb=6da0f83778e884c9a824ff46b6fa98f32eb729cc;p=mono.git diff --git a/mono/metadata/debug-helpers.c b/mono/metadata/debug-helpers.c index 810c29c4a69..712b8023a03 100644 --- a/mono/metadata/debug-helpers.c +++ b/mono/metadata/debug-helpers.c @@ -23,17 +23,27 @@ static const char *wrapper_type_names [] = { "runtime-invoke", "native-to-managed", "managed-to-native", + "managed-to-managed", "remoting-invoke", "remoting-invoke-with-check", + "xdomain-invoke", + "xdomain-dispatch", "ldfld", "stfld", + "ldfld-remote", + "stfld-remote", "synchronized", "dynamic-method", "isinst", "cancast", "proxy_isinst", "stelemref", - "unknown" + "unbox", + "ldflda", + "write-barrier", + "unknown", + "cominterop-invoke", + "cominterop" }; static void @@ -45,7 +55,7 @@ append_class_name (GString *res, MonoClass *class, gboolean include_namespace) } if (class->nested_in) { append_class_name (res, class->nested_in, include_namespace); - g_string_append_c (res, '+'); + g_string_append_c (res, '/'); } if (include_namespace && *(class->name_space)) g_string_sprintfa (res, "%s.", class->name_space); @@ -108,7 +118,11 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace) { append_class_name (res, type->data.klass, include_namespace); break; case MONO_TYPE_GENERICINST: - mono_type_get_desc (res, type->data.generic_inst->generic_type, include_namespace); + mono_type_get_desc (res, &type->data.generic_class->container_class->byval_arg, include_namespace); + break; + case MONO_TYPE_VAR: + case MONO_TYPE_MVAR: + g_string_append (res, type->data.generic_param->name); break; default: break; @@ -150,15 +164,17 @@ mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace) /** * mono_method_desc_new: + * @name: the method name. + * @include_namespace: whether the name includes a namespace or not. * - * Creates a method description for `name', which conforms to the following + * Creates a method description for @name, which conforms to the following * specification: * * [namespace.]classname:methodname[(args...)] * * in all the loaded assemblies. * - * Returns a parsed representation of the method description. + * Returns: a parsed representation of the method description. */ MonoMethodDesc* mono_method_desc_new (const char *name, gboolean include_namespace) @@ -231,8 +247,9 @@ mono_method_desc_from_method (MonoMethod *method) /** * mono_method_desc_free: + * @desc: method description to be released * - * Releases the MonoMethodDesc object `desc'. + * Releases the MonoMethodDesc object @desc. */ void mono_method_desc_free (MonoMethodDesc *desc) @@ -255,9 +272,9 @@ mono_method_desc_match (MonoMethodDesc *desc, MonoMethod *method) return FALSE; if (!desc->args) return TRUE; - if (desc->num_args != method->signature->param_count) + if (desc->num_args != mono_method_signature (method)->param_count) return FALSE; - sig = mono_signature_get_desc (method->signature, desc->include_namespace); + sig = mono_signature_get_desc (mono_method_signature (method), desc->include_namespace); if (strcmp (sig, desc->args)) { g_free (sig); return FALSE; @@ -279,13 +296,12 @@ mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method) MonoMethod* mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass) { - int i; - - mono_class_init (klass); - for (i = 0; i < klass->method.count; ++i) { - if (mono_method_desc_match (desc, klass->methods [i])) - return klass->methods [i]; - } + MonoMethod* m; + gpointer iter = NULL; + + while ((m = mono_class_get_methods (klass, &iter))) + if (mono_method_desc_match (desc, m)) + return m; return NULL; } @@ -293,8 +309,8 @@ MonoMethod* mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image) { MonoClass *klass; - MonoTableInfo *tdef; - MonoTableInfo *methods; + const MonoTableInfo *tdef; + const MonoTableInfo *methods; MonoMethod *method; int i; @@ -323,13 +339,15 @@ mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image) static const unsigned char* dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned char *ip, const unsigned char *end) { - MonoMethodHeader *header = ((MonoMethodNormal*)method)->header; + MonoMethodHeader *header = mono_method_get_header (method); const MonoOpcode *opcode; - guint32 i, label, token; + guint32 label, token; gint32 sval; + int i; char *tmp; + const unsigned char* il_code = mono_method_header_get_code (header, NULL, NULL); - label = ip - header->code; + label = ip - il_code; if (dh->indenter) { tmp = dh->indenter (dh, method, label); g_string_append (str, tmp); @@ -377,7 +395,7 @@ dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned cha sval = read32 (ip); ip += 4; if (dh->label_target) - g_string_sprintfa (str, dh->label_target, ip + sval - header->code); + g_string_sprintfa (str, dh->label_target, ip + sval - il_code); else g_string_sprintfa (str, "%d", sval); break; @@ -385,7 +403,7 @@ dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned cha sval = *(const signed char*)ip; ip ++; if (dh->label_target) - g_string_sprintfa (str, dh->label_target, ip + sval - header->code); + g_string_sprintfa (str, dh->label_target, ip + sval - il_code); else g_string_sprintfa (str, "%d", sval); break; @@ -400,7 +418,7 @@ dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned cha g_string_append (str, ", "); label = read32 (ip); if (dh->label_target) - g_string_sprintfa (str, dh->label_target, end + label - header->code); + g_string_sprintfa (str, dh->label_target, end + label - il_code); else g_string_sprintfa (str, "%d", label); ip += 4; @@ -500,12 +518,10 @@ mono_method_full_name (MonoMethod *method, gboolean signature) { char *res; char wrapper [64]; - char *nspace; - - nspace = method->klass->name_space; + const char *nspace = method->klass->name_space; if (signature) { - char *tmpsig = mono_signature_get_desc (method->signature, TRUE); + char *tmpsig = mono_signature_get_desc (mono_method_signature (method), TRUE); if (method->wrapper_type != MONO_WRAPPER_NONE) sprintf (wrapper, "(wrapper %s) ", wrapper_type_to_str (method->wrapper_type)); @@ -524,5 +540,3 @@ mono_method_full_name (MonoMethod *method, gboolean signature) return res; } - -