#include <mono/metadata/marshal.h>
#include "mono/utils/mono-digest.h"
#include <mono/utils/mono-mmap.h>
+#include <mono/utils/mono-counters.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
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);
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);
#ifndef DISABLE_PERFCOUNTERS
mono_perfcounters_init ();
#endif
+ mono_counters_init ();
mono_metadata_init ();
mono_images_init ();
mono_assemblies_init ();