return above_threshold;
}
+static int
+mono_get_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset)
+{
+ SeqPoint sp;
+ if (mono_find_prev_seq_point_for_native_offset (domain, method, native_offset, NULL, &sp))
+ return sp.il_offset;
+ return -1;
+}
+
void
mono_exceptions_init (void)
{
cbs.mono_clear_abort_threshold = mini_clear_abort_threshold;
cbs.mono_above_abort_threshold = mini_above_abort_threshold;
mono_install_eh_callbacks (&cbs);
+ mono_install_get_seq_point (mono_get_seq_point_for_native_offset);
}
gpointer
#ifndef MONO_CROSS_COMPILE
+static void print_process_map ()
+{
+#ifdef __linux__
+ FILE *fp = fopen ("/proc/self/maps", "r");
+ char line [256];
+
+ if (fp == NULL) {
+ mono_runtime_printf_err ("no /proc/self/maps, not on linux?\n");
+ return;
+ }
+
+ mono_runtime_printf_err ("/proc/self/maps:");
+
+ while (fgets (line, sizeof (line), fp)) {
+ // strip newline
+ size_t len = strlen (line) - 1;
+ if (len >= 0 && line [len] == '\n')
+ line [len] = '\0';
+
+ mono_runtime_printf_err ("%s", line);
+ }
+
+ fclose (fp);
+#else
+ /* do nothing */
+#endif
+}
+
static gboolean handling_sigsegv = FALSE;
/*
mono_walk_stack (print_stack_frame_to_stderr, MONO_UNWIND_LOOKUP_IL_OFFSET, NULL);
}
+ print_process_map ();
+
#ifdef HAVE_BACKTRACE_SYMBOLS
{
void *array [256];
#if defined(PLATFORM_ANDROID)
/* SYS_fork is defined to be __NR_fork which is not defined in some ndk versions */
g_assert_not_reached ();
-#elif defined(SYS_fork)
+#elif !defined(PLATFORM_MACOSX) && defined(SYS_fork)
pid = (pid_t) syscall (SYS_fork);
#elif defined(PLATFORM_MACOSX) && HAVE_FORK
pid = (pid_t) fork ();
* this has changed on later versions of Android. Also, we don't want to
* set this on start-up as DUMPABLE has security implications. */
prctl (PR_SET_DUMPABLE, 1);
+
+ mono_runtime_printf_err ("\nNo native Android stacktrace (see debuggerd output).\n");
#endif
- mono_exception_native_unwind (ctx, info);
#endif
/*