+static void
+dump_verify_info (MonoImage *image, int flags)
+{
+ GSList *errors, *tmp;
+ int count = 0;
+ const char* desc [] = {
+ "Ok", "Error", "Warning", NULL, "CLS"
+ };
+
+ errors = mono_image_verify_tables (image, flags);
+
+ for (tmp = errors; tmp; tmp = tmp->next) {
+ MonoVerifyInfo *info = tmp->data;
+ g_print ("%s: %s\n", desc [info->status], info->message);
+ if (info->status == MONO_VERIFY_ERROR)
+ count++;
+ }
+ mono_free_verify_list (errors);
+
+ if (flags & (MONO_VERIFY_ALL + 1)) { /* verify code */
+ int i;
+ MonoTableInfo *m = &image->tables [MONO_TABLE_METHOD];
+
+ for (i = 0; i < m->rows; ++i) {
+ MonoMethod *method;
+
+ method = mono_get_method (image, MONO_TOKEN_METHOD_DEF | (i+1), NULL);
+ errors = mono_method_verify (method, flags);
+ if (errors) {
+ char *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);
+ }
+
+ for (tmp = errors; tmp; tmp = tmp->next) {
+ MonoVerifyInfo *info = tmp->data;
+ g_print ("%s: %s\n", desc [info->status], info->message);
+ if (info->status == MONO_VERIFY_ERROR)
+ count++;
+ }
+ mono_free_verify_list (errors);
+ }
+ }
+
+ if (count)
+ g_print ("Error count: %d\n", count);