Thu Feb 25 11:59:22 CET 2010 Paolo Molaro <lupus@ximian.com>
[mono.git] / mono / profiler / mono-cov.c
index 5fbe51f1ec79d6373ee7d2f1ccab346f74456579..12f1c64360784074766e3695669328ec28bd5f91 100644 (file)
@@ -1,9 +1,16 @@
+/*
+ * mono-co.c: Coverage profiler
+ *
+
+ * Copyright 2008-2009 Novell, Inc (http://www.novell.com)
+ */
 #include <mono/metadata/profiler.h>
 #include <mono/metadata/tokentype.h>
 #include <mono/metadata/tabledefs.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/assembly.h>
 #include <string.h>
+#include <glib.h>
 
 /*
  * Coverage profiler. Compile with:
@@ -55,7 +62,7 @@ check_partial_coverage (MonoProfiler *prof, MonoMethod *method)
        mono_profiler_coverage_get (prof, method, coverage_callback);
        if (prof->bb_coverage) {
                char *name = mono_method_full_name (method, TRUE);
-               g_print ("Partial coverage: %s\n", name + 3);
+               g_print ("Partial coverage: %s\n", name);
                g_free (name);
                for (tmp = prof->bb_coverage; tmp; tmp = tmp->next) {
                        g_print ("\t%s\n", (char*)tmp->data);
@@ -91,7 +98,7 @@ cov_shutdown (MonoProfiler *prof)
                /* FIXME: handle icalls, runtime calls and synchronized methods */
                if (prof->class_name && *prof->class_name) {
                        klass = mono_method_get_class (method);
-                       if (!strstr (klass->name, prof->class_name) && !strstr (klass->name_space, prof->class_name))
+                       if (!strstr (mono_class_get_name (klass), prof->class_name) && !strstr (mono_class_get_namespace (klass), prof->class_name))
                                continue;
                }
                /*g_print ("check %s::%s, %p\n", method->klass->name, method->name, method);*/
@@ -101,7 +108,7 @@ cov_shutdown (MonoProfiler *prof)
                        continue;
                }
                name = mono_method_full_name (method, TRUE);
-               g_print ("Not covered: %s\n", name + 3);
+               g_print ("Not covered: %s\n", name);
                g_free (name);
        }
 }
@@ -118,6 +125,9 @@ cov_method_leave (MonoProfiler *prof, MonoMethod *method)
 {
 }
 
+void
+mono_profiler_startup (const char *desc);
+
 /* the entry point */
 void
 mono_profiler_startup (const char *desc)