#include <mono/utils/mono-logger-internal.h>
#include "mini.h"
-#include "debug-mini.h"
#include "trace.h"
#include "debugger-agent.h"
MonoContext initial_ctx;
MonoMethod *method;
int frame_count = 0;
- gint32 filter_idx, first_filter_idx;
+ gint32 filter_idx, first_filter_idx = 0;
int i;
MonoObject *ex_obj;
MonoObject *non_exception = NULL;
if (mono_running_on_valgrind ())
return;
- mono_thread_get_stack_bounds (&staddr, &stsize);
+ mono_thread_info_get_stack_bounds (&staddr, &stsize);
g_assert (staddr);
int count;
} PrintOverflowUserData;
+#ifdef MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX
static gboolean
print_overflow_stack_frame (StackFrameInfo *frame, MonoContext *ctx, gpointer data)
{
return FALSE;
}
+#endif
void
mono_handle_hard_stack_ovf (MonoJitTlsData *jit_tls, MonoJitInfo *ji, void *ctx, guint8* fault_addr)
{
+#ifdef MONO_ARCH_HAVE_SIGCTX_TO_MONOCTX
PrintOverflowUserData ud;
MonoContext mctx;
+#endif
/* we don't do much now, but we can warn the user with a useful message */
mono_runtime_printf_err ("Stack overflow: IP: %p, fault addr: %p", mono_arch_ip_from_context (ctx), fault_addr);
if (mini_get_debug_options ()->suspend_on_sigsegv) {
mono_runtime_printf_err ("Received SIGSEGV, suspending...");
+#ifdef HOST_WIN32
while (1)
;
+#else
+ while (1) {
+ sleep (0);
+ }
+#endif
}
/* To prevent infinite loops when the stack walk causes a crash */
/* Try to get more meaningful information using gdb */
#if !defined(HOST_WIN32) && defined(HAVE_SYS_SYSCALL_H) && defined(SYS_fork)
- if (!mini_get_debug_options ()->no_gdb_backtrace && !mono_debug_using_mono_debugger ()) {
+ if (!mini_get_debug_options ()->no_gdb_backtrace) {
/* From g_spawn_command_line_sync () in eglib */
pid_t pid;
int status;
g_assert_not_reached ();
}
+/*
+ * mono_jinfo_get_unwind_info:
+ *
+ * Return the unwind info for JI.
+ */
+guint8*
+mono_jinfo_get_unwind_info (MonoJitInfo *ji, guint32 *unwind_info_len)
+{
+ if (ji->from_aot)
+ return mono_aot_get_unwind_info (ji, unwind_info_len);
+ else
+ return mono_get_cached_unwind_info (ji->used_regs, unwind_info_len);
+}