Removed debugging printf statement.
[mono.git] / mono / profiler / mono-cov.c
index c0112577a47edad8710e3f90fd5a86b4ec959548..d7e186b9d9813aa279a0a9cbee501dffff34d8f7 100644 (file)
@@ -1,3 +1,9 @@
+/*
+ * 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>
@@ -26,7 +32,7 @@ struct _MonoProfiler {
 static void
 get_assembly (MonoAssembly* ass, MonoProfiler *prof)
 {
-       if (strcmp (prof->assembly_name, ass->aname.name) == 0)
+       if (strcmp (prof->assembly_name, mono_image_get_name (mono_assembly_get_image (ass))) == 0)
                prof->assembly = ass;
 }
 
@@ -55,7 +61,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);
@@ -80,16 +86,18 @@ cov_shutdown (MonoProfiler *prof)
                g_print ("Assembly '%s' was not loaded\n", prof->assembly_name);
                return;
        }
-       image = prof->assembly->image;
-       for (i = 1; i <= image->tables [MONO_TABLE_METHOD].rows; ++i) {
+       image = mono_assembly_get_image (prof->assembly);
+       for (i = 1; i <= mono_image_get_table_rows (image, MONO_TABLE_METHOD); ++i) {
+               MonoClass *klass;
                method = mono_get_method (image, i | MONO_TOKEN_METHOD_DEF, NULL);
                if (!method)
                        continue;
-               if ((method->flags & METHOD_ATTRIBUTE_ABSTRACT))
+               if ((mono_method_get_flags (method, NULL) & METHOD_ATTRIBUTE_ABSTRACT))
                        continue;
                /* FIXME: handle icalls, runtime calls and synchronized methods */
                if (prof->class_name && *prof->class_name) {
-                       if (!strstr (method->klass->name, prof->class_name) && !strstr (method->klass->name_space, prof->class_name))
+                       klass = mono_method_get_class (method);
+                       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);*/
@@ -99,7 +107,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);
        }
 }