2007-04-25 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / pedump.c
index c288a990dab89a9b451f325e4bcdbfad683ea5af..b52f5d79dbcc50893b9980dadc5a27b7f3bf29e0 100644 (file)
@@ -13,7 +13,6 @@
 #include "image.h"
 #include <glib.h>
 #include "cil-coff.h"
-#include "private.h"
 #include "mono-endian.h"
 #include "verify.h"
 #include <mono/metadata/class.h>
@@ -23,6 +22,7 @@
 #include <mono/metadata/assembly.h>
 #include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/rawbuffer.h>
+#include <mono/metadata/class-internals.h>
 #include "mono/utils/mono-digest.h"
 
 gboolean dump_data = TRUE;
@@ -257,7 +257,7 @@ dsh (const char *label, MonoImage *meta, MonoStreamHeader *sh)
 {
        printf ("%s: 0x%08x - 0x%08x [%d == 0x%08x]\n",
                label,
-               sh->data - meta->raw_metadata, sh->data + sh->size - meta->raw_metadata,
+               (int)(sh->data - meta->raw_metadata), (int)(sh->data + sh->size - meta->raw_metadata),
                sh->size, sh->size);
 }
 
@@ -280,7 +280,7 @@ dump_metadata (MonoImage *meta)
        dump_metadata_ptrs (meta);
 
        printf ("Rows:\n");
-       for (table = 0; table < 64; table++){
+       for (table = 0; table < MONO_TABLE_NUM; table++){
                if (meta->tables [table].rows == 0)
                        continue;
                printf ("Table %s: %d records (%d bytes, at %p)\n",
@@ -349,8 +349,9 @@ dump_verify_info (MonoImage *image, int flags)
                        errors = mono_method_verify (method, flags);
                        if (errors) {
                                char *sig;
-                               sig = mono_signature_get_desc (method->signature, FALSE);
-                               g_print ("In method: %s.%s::%s(%s)\n", method->klass->name_space, method->klass->name, method->name, sig);
+                               MonoClass *klass = mono_method_get_class (method);
+                               sig = mono_signature_get_desc (mono_method_signature (method), FALSE);
+                               g_print ("In method: %s.%s::%s(%s)\n", mono_class_get_namespace (klass), mono_class_get_name (klass), mono_method_get_name (method), sig);
                                g_free (sig);
                        }