gpointer
mono_get_throw_exception_by_name (void)
{
+#ifdef MONO_ARCH_HAVE_THROW_EXCEPTION_BY_NAME
+
gpointer code = NULL;
#ifdef MONO_ARCH_HAVE_FULL_AOT_TRAMPOLINES
guint32 code_size;
throw_exception_by_name_func = code;
+#else
+
+ throw_exception_by_name_func = NULL;
+
+ g_assert_not_reached ();
+#endif
+
return throw_exception_by_name_func;
}
* A version of mono_find_jit_info which returns all data in the StackFrameInfo
* structure.
*/
-static gboolean
+gboolean
mono_find_jit_info_ext (MonoDomain *domain, MonoJitTlsData *jit_tls,
MonoJitInfo *prev_ji, MonoContext *ctx,
MonoContext *new_ctx, char **trace, MonoLMF **lmf,
return ji;
}
+ /* maybe it is shared code, so we also search in the root domain */
+ if (domain != mono_get_root_domain ()) {
+ ji = mono_jit_info_table_find (mono_get_root_domain (), addr);
+ if (ji) {
+ if (out_domain)
+ *out_domain = mono_get_root_domain ();
+ return ji;
+ }
+ }
+
for (l = t->appdomain_refs; l; l = l->next) {
if (l->data != domain) {
ji = mono_jit_info_table_find ((MonoDomain*)l->data, addr);
handling_sigsegv = TRUE;
/* !jit_tls means the thread was not registered with the runtime */
- if (jit_tls) {
+ if (jit_tls && mono_thread_internal_current ()) {
fprintf (stderr, "Stacktrace:\n\n");
mono_jit_walk_stack (print_stack_frame, TRUE, stderr);
abort ();
}
-/*
- * mono_print_thread_dump:
- *
- * Print information about the current thread to stdout.
- * SIGCTX can be NULL, allowing this to be called from gdb.
- */
-void
-mono_print_thread_dump (void *sigctx)
+static void
+mono_print_thread_dump_internal (void *sigctx, MonoContext *start_ctx)
{
MonoInternalThread *thread = mono_thread_internal_current ();
#if defined(__i386__) || defined(__x86_64__)
#endif
#ifdef MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX
- if (!sigctx)
+ if (start_ctx) {
+ memcpy (&ctx, start_ctx, sizeof (MonoContext));
+ } else if (!sigctx)
MONO_INIT_CONTEXT_FROM_FUNC (&ctx, mono_print_thread_dump);
else
mono_arch_sigctx_to_monoctx (sigctx, &ctx);
fflush (stdout);
}
+/*
+ * mono_print_thread_dump:
+ *
+ * Print information about the current thread to stdout.
+ * SIGCTX can be NULL, allowing this to be called from gdb.
+ */
+void
+mono_print_thread_dump (void *sigctx)
+{
+ mono_print_thread_dump_internal (sigctx, NULL);
+}
+
+void
+mono_print_thread_dump_from_ctx (MonoContext *ctx)
+{
+ mono_print_thread_dump_internal (NULL, ctx);
+}
+
/*
* mono_resume_unwind:
*