X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftrace.c;h=e5e36100f09575d94edbd0d24c29028a82ba949d;hb=580ccb1ffb8e5c2e3fa0555e342d916764f42930;hp=765bc111c09bb22e86740bdc03f19ff6b4bf29fb;hpb=0a7461e32c3b99563c515a0079923a4471e44240;p=mono.git diff --git a/mono/mini/trace.c b/mono/mini/trace.c index 765bc111c09..e5e36100f09 100644 --- a/mono/mini/trace.c +++ b/mono/mini/trace.c @@ -1,5 +1,6 @@ -/* - * trace.c: Tracing facilities for the Mono Runtime. +/** + * \file + * Tracing facilities for the Mono Runtime. * * Author: * Paolo Molaro (lupus@ximian.com) @@ -7,6 +8,7 @@ * * (C) 2002 Ximian, Inc. * Copyright 2011 Xamarin, Inc (http://www.xamarin.com) + * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ #include @@ -100,17 +102,21 @@ mono_trace_eval (MonoMethod *method) switch (op->op){ case MONO_TRACEOP_ALL: - inc = 1; break; + inc = 1; + break; case MONO_TRACEOP_PROGRAM: if (trace_spec.assembly && (method->klass->image == mono_assembly_get_image (trace_spec.assembly))) - inc = 1; break; + inc = 1; + break; case MONO_TRACEOP_WRAPPER: if ((method->wrapper_type == MONO_WRAPPER_NATIVE_TO_MANAGED) || (method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE)) - inc = 1; break; + inc = 1; + break; case MONO_TRACEOP_METHOD: if (mono_method_desc_full_match ((MonoMethodDesc *) op->data, method)) - inc = 1; break; + inc = 1; + break; case MONO_TRACEOP_CLASS: if (strcmp (method->klass->name_space, op->data) == 0) if (strcmp (method->klass->name, op->data2) == 0) @@ -118,18 +124,21 @@ mono_trace_eval (MonoMethod *method) break; case MONO_TRACEOP_ASSEMBLY: if (strcmp (mono_image_get_name (method->klass->image), op->data) == 0) - inc = 1; break; + inc = 1; + break; case MONO_TRACEOP_NAMESPACE: if (strcmp (method->klass->name_space, op->data) == 0) inc = 1; + break; case MONO_TRACEOP_EXCEPTION: break; } - if (op->exclude){ + if (op->exclude) { if (inc) include = 0; - } else if (inc) + } else if (inc) { include = 1; + } } return include; } @@ -158,9 +167,10 @@ static void get_string (void) } if (value != NULL) g_free (value); - value = (char *)g_malloc (input - start + 1); - strncpy (value, start, input-start); - value [input-start] = 0; + size_t len = input - start; + value = (char *)g_malloc (len + 1); + memcpy (value, start, len); + value [len] = 0; } enum Token { @@ -533,7 +543,7 @@ mono_trace_enter_method (MonoMethod *method, char *ebp) g_free (as); } else if (klass == mono_defaults.int32_class) { printf ("[INT32:%p:%d], ", o, *(gint32 *)((char *)o + sizeof (MonoObject))); - } else if (klass == mono_defaults.monotype_class) { + } else if (klass == mono_defaults.runtimetype_class) { printf ("[TYPE:%s], ", mono_type_full_name (((MonoReflectionType*)o)->type)); } else printf ("[%s.%s:%p], ", klass->name_space, klass->name, o);