}
static void
-interp_walk_stack (MonoStackWalk func, gpointer user_data)
+interp_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data)
{
ThreadContext *context = TlsGetValue (thread_context_id);
- MonoInvocation *frame = context->current_frame;
+ MonoInvocation *frame;
int il_offset;
MonoMethodHeader *hd;
+ if (!context) return;
+
+ frame = context->current_frame;
+
while (frame) {
gboolean managed = FALSE;
MonoMethod *method = frame->runtime_method->method;
}
}
+MonoDelegate*
+mono_interp_ftnptr_to_delegate (MonoClass *klass, gpointer ftn)
+{
+ MonoDelegate *d;
+ MonoJitInfo *ji;
+ MonoDomain *domain = mono_domain_get ();
+
+ d = (MonoDelegate*)mono_object_new (domain, klass);
+
+ ji = mono_jit_info_table_find (domain, ftn);
+ if (ji == NULL)
+ mono_raise_exception (mono_get_exception_argument ("", "Function pointer was not created by a Delegate."));
+
+ /* FIXME: discard the wrapper and call the original method */
+ interp_delegate_ctor (domain, (MonoObject*)d, NULL, mono_interp_get_runtime_method (ji->method));
+
+ return d;
+}
+
/*
* From the spec:
* runtime specifies that the implementation of the method is automatically
context->env_frame = old_env_frame;
context->current_env = old_env;
context->managed_code = 1;
- return;
+ return sp;
}
context->env_frame = context->current_frame;
g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
g_log_set_fatal_mask (G_LOG_DOMAIN, G_LOG_LEVEL_ERROR);
- g_thread_init (NULL);
+ if (!g_thread_supported ())
+ g_thread_init (NULL);
thread_context_id = TlsAlloc ();
TlsSetValue (thread_context_id, NULL);
mono_runtime_install_cleanup (quit_function);
abort_requested = mono_thread_interruption_request_flag ();
- domain = mono_init (file);
+ domain = mono_init_from_assembly (file, file);
#ifdef __hpux /* generates very big stack frames */
mono_threads_set_default_stacksize(32*1024*1024);
#endif
mono_runtime_init (domain, NULL, NULL);
+ mono_thread_attach (domain);
return domain;
}
if (argc < 2)
usage ();
+ MONO_GC_PRE_INIT ();
+
for (i = 1; i < argc && argv [i][0] == '-'; i++){
if (strcmp (argv [i], "--trace") == 0)
global_tracing = 1;