NULL
};
-#ifdef __native_client_codegen__
-extern gint8 nacl_align_byte;
-#endif
#ifdef __native_client__
extern char *nacl_mono_path;
#endif
if (verbose >= 2)
g_print ("Running '%s' ...\n", method->name);
#ifdef MONO_USE_AOT_COMPILER
- if ((func = (TestMethod)mono_aot_get_method (mono_get_root_domain (), method)))
- ;
- else
-#endif
+ MonoError error;
+ func = (TestMethod)mono_aot_get_method_checked (mono_get_root_domain (), method, &error);
+ mono_error_cleanup (&error);
+ if (!func)
func = (TestMethod)(gpointer)cfg->native_code;
+#else
+ func = (TestMethod)(gpointer)cfg->native_code;
+#endif
func = (TestMethod)mono_create_ftnptr (mono_get_root_domain (), func);
result = func ();
if (result != expected) {
static void
jit_info_table_test (MonoDomain *domain)
{
+ MonoError error;
int i;
g_print ("testing jit_info_table\n");
sleep (2);
*/
- for (i = 0; i < num_threads; ++i)
- mono_thread_create (domain, test_thread_func, &thread_datas [i]);
+ for (i = 0; i < num_threads; ++i) {
+ mono_thread_create_checked (domain, test_thread_func, &thread_datas [i], &error);
+ mono_error_assert_ok (&error);
+ }
}
#endif
static void
compile_all_methods (MonoAssembly *ass, int verbose, guint32 opts, guint32 recompilation_times)
{
+ MonoError error;
CompileAllThreadArgs args;
args.ass = ass;
* Need to create a mono thread since compilation might trigger
* running of managed code.
*/
- mono_thread_create (mono_domain_get (), compile_all_methods_thread_main, &args);
+ mono_thread_create_checked (mono_domain_get (), compile_all_methods_thread_main, &args, &error);
+ mono_error_assert_ok (&error);
mono_thread_manage ();
}
method = mono_get_method_checked (image, entry, NULL, NULL, &error);
if (method == NULL){
- g_print ("The entry point method of assembly '%s' could not be loaded due to %s\n", agent, &error);
+ g_print ("The entry point method of assembly '%s' could not be loaded due to %s\n", agent, mono_error_get_message (&error));
mono_error_cleanup (&error);
g_free (agent);
return 1;
mono_thread_set_main (mono_thread_current ());
if (args) {
- main_args = (MonoArray*)mono_array_new (domain, mono_defaults.string_class, 1);
- mono_array_set (main_args, MonoString*, 0, mono_string_new (domain, args));
+ main_args = (MonoArray*)mono_array_new_checked (domain, mono_defaults.string_class, 1, &error);
+ if (main_args)
+ mono_array_set (main_args, MonoString*, 0, mono_string_new (domain, args));
} else {
- main_args = (MonoArray*)mono_array_new (domain, mono_defaults.string_class, 0);
+ main_args = (MonoArray*)mono_array_new_checked (domain, mono_defaults.string_class, 0, &error);
}
-
- g_free (agent);
+ if (!main_args) {
+ g_print ("Could not allocate array for main args of assembly '%s' due to %s\n", agent, mono_error_get_message (&error));
+ mono_error_cleanup (&error);
+ g_free (agent);
+ return 1;
+ }
+
pa [0] = main_args;
/* Pass NULL as 'exc' so unhandled exceptions abort the runtime */
mono_runtime_invoke_checked (method, NULL, pa, &error);
- mono_error_raise_exception (&error); /* FIXME don't raise here */
+ if (!is_ok (&error)) {
+ g_print ("The entry point method of assembly '%s' could not execute due to %s\n", agent, mono_error_get_message (&error));
+ mono_error_cleanup (&error);
+ g_free (agent);
+ return 1;
+ }
+ g_free (agent);
return 0;
}
" --trace[=EXPR] Enable tracing, use --help-trace for details\n"
" --jitmap Output a jit method map to /tmp/perf-PID.map\n"
" --help-devel Shows more options available to developers\n"
-#ifdef __native_client_codegen__
- " --nacl-align-mask-off Turn off Native Client 32-byte alignment mask (for debug only)\n"
-#endif
"\n"
"Runtime:\n"
" --config FILE Loads FILE as the Mono config\n"
gc_descr = mono_gc_get_description ();
g_print ("\tGC: %s\n", gc_descr);
g_free (gc_descr);
- if (mini_verbose) {
- const char *cerror;
- const char *clibpath;
- mono_init ("mono");
- cerror = mono_check_corlib_version ();
- clibpath = mono_defaults.corlib? mono_image_get_filename (mono_defaults.corlib): "unknown";
- if (cerror) {
- g_print ("The currently installed mscorlib doesn't match this runtime version.\n");
- g_print ("The error is: %s\n", cerror);
- g_print ("mscorlib.dll loaded at: %s\n", clibpath);
- return 1;
- }
- }
return 0;
} else if (strcmp (argv [i], "--help") == 0 || strcmp (argv [i], "-h") == 0) {
mini_usage ();
#endif
} else if (strcmp (argv [i], "--nollvm") == 0){
mono_use_llvm = FALSE;
-#ifdef __native_client_codegen__
- } else if (strcmp (argv [i], "--nacl-align-mask-off") == 0){
- nacl_align_byte = -1; /* 0xff */
-#endif
#ifdef __native_client__
} else if (strcmp (argv [i], "--nacl-mono-path") == 0){
nacl_mono_path = g_strdup(argv[++i]);
}
#ifdef __native_client_codegen__
- if (g_getenv ("MONO_NACL_ALIGN_MASK_OFF"))
- {
- nacl_align_byte = -1; /* 0xff */
- }
if (!nacl_null_checks_off) {
MonoDebugOptions *opt = mini_get_debug_options ();
opt->explicit_null_checks = TRUE;
}
#endif
-#ifdef DISABLE_HW_TRAPS
+#if defined(DISABLE_HW_TRAPS) || defined(MONO_ARCH_DISABLE_HW_TRAPS)
// Signal handlers not available
{
MonoDebugOptions *opt = mini_get_debug_options ();
* We only set the native name of the thread since MS.NET leaves the
* managed thread name for the main thread as null.
*/
- mono_thread_info_set_name (mono_native_thread_id_get (), "Main");
+ mono_native_thread_set_name (mono_native_thread_id_get (), "Main");
if (enable_profile) {
mono_profiler_load (profile_options);
- mono_profiler_thread_name (mono_native_thread_id_get (), "Main");
+ mono_profiler_thread_name (MONO_NATIVE_THREAD_ID_TO_UINT (mono_native_thread_id_get ()), "Main");
}
mono_attach_parse_options (attach_options);