* Structs are not being labeled as `valuetype' classes
*
* How are fields with literals mapped to constants?
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include <stdio.h>
#include <mono/metadata/assembly.h>
#include <mono/metadata/appdomain.h>
#include <mono/utils/bsearch.h>
+#include <mono/utils/mono-counters.h>
static void setup_filter (MonoImage *image);
static gboolean should_include_type (int idx);
*
* Disassembles the @file file.
*/
-static void
+static int
disassemble_file (const char *file)
{
MonoImageOpenStatus status;
img = mono_image_open (file, &status);
if (!img) {
fprintf (stderr, "Error while trying to process %s\n", file);
- return;
+ return 1;
} else {
/* FIXME: is this call necessary? */
mono_assembly_load_from_full (img, file, &status, FALSE);
}
mono_image_close (img);
+ return 0;
}
typedef struct {
exit (1);
}
+static void
+thread_state_init (MonoThreadUnwindState *ctx)
+{
+}
+
int
main (int argc, char *argv [])
{
+ MonoThreadInfoRuntimeCallbacks ticallbacks;
+
GList *input_files = NULL, *l;
int i, j;
if (input_files == NULL)
usage ();
+ CHECKED_MONO_INIT ();
+ mono_counters_init ();
+ memset (&ticallbacks, 0, sizeof (ticallbacks));
+ ticallbacks.thread_state_init = thread_state_init;
+#ifndef HOST_WIN32
+ mono_w32handle_init ();
+#endif
+ mono_threads_runtime_init (&ticallbacks);
+
mono_install_assembly_load_hook (monodis_assembly_load_hook, NULL);
mono_install_assembly_search_hook (monodis_assembly_search_hook, NULL);
mono_install_assembly_preload_hook (monodis_preload, GUINT_TO_POINTER (FALSE));
- disassemble_file (filename);
+ return disassemble_file (filename);
} else {
mono_init (argv [0]);
+ i = 0;
for (l = input_files; l; l = l->next)
- disassemble_file ((const char *)l->data);
+ if (disassemble_file ((const char *)l->data) == 1) i = 1;
+ return i;
}
return 0;