X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmetadata%2Fpedump.c;h=2615373e1223cdeb1f892e92aaae3507ad4ea57a;hb=9f92e1c7fd7b2553fb4567b51426209506797af8;hp=ee7af61a57a81ff7d451ae04addf5cc6d6beecc5;hpb=cd474ecbbf2ec950b5c3b83eb7b3618961a40ff4;p=mono.git diff --git a/mono/metadata/pedump.c b/mono/metadata/pedump.c index ee7af61a57a..2615373e122 100644 --- a/mono/metadata/pedump.c +++ b/mono/metadata/pedump.c @@ -27,6 +27,7 @@ #include #include "mono/utils/mono-digest.h" #include +#include #include #include #ifdef HAVE_UNISTD_H @@ -359,11 +360,13 @@ dump_verify_info (MonoImage *image, int flags) for (i = 0; i < m->rows; ++i) { MonoMethod *method; + MonoError error; mono_loader_clear_error (); - method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i+1), NULL); + method = mono_get_method_checked (image, MONO_TOKEN_METHOD_DEF | (i+1), NULL, NULL, &error); if (!method) { - g_print ("Warning: Cannot lookup method with token 0x%08x\n", i + 1); + g_print ("Warning: Cannot lookup method with token 0x%08x due to %s\n", i + 1, mono_error_get_message (&error)); + mono_error_cleanup (&error); continue; } errors = mono_method_verify (method, flags); @@ -454,6 +457,7 @@ verify_image_file (const char *fname) assembly->in_gac = FALSE; assembly->image = image; image->assembly = assembly; + mono_assembly_fill_assembly_name (image, &assembly->aname); /*Finish initializing the runtime*/ mono_install_assembly_load_hook (pedump_assembly_load_hook, NULL); @@ -472,10 +476,12 @@ verify_image_file (const char *fname) table = &image->tables [MONO_TABLE_TYPEDEF]; for (i = 1; i <= table->rows; ++i) { + MonoError error; guint32 token = i | MONO_TOKEN_TYPE_DEF; - MonoClass *class = mono_class_get (image, token); + MonoClass *class = mono_class_get_checked (image, token, &error); if (!class) { - printf ("Could not load class with token %x\n", token); + printf ("Could not load class with token %x due to %s\n", token, mono_error_get_message (&error)); + mono_error_cleanup (&error); continue; } mono_class_init (class); @@ -652,6 +658,7 @@ main (int argc, char *argv []) #ifndef DISABLE_PERFCOUNTERS mono_perfcounters_init (); #endif + mono_counters_init (); mono_metadata_init (); mono_images_init (); mono_assemblies_init ();