static MonoW32ExceptionHandler ill_handler;
static MonoW32ExceptionHandler segv_handler;
-static LPTOP_LEVEL_EXCEPTION_FILTER old_handler;
+LPTOP_LEVEL_EXCEPTION_FILTER mono_old_win_toplevel_exception_filter;
+guint64 mono_win_chained_exception_filter_result;
+gboolean mono_win_chained_exception_filter_didrun;
#define W32_SEH_HANDLE_EX(_ex) \
- if (_ex##_handler) _ex##_handler(0, er, sctx)
+ if (_ex##_handler) _ex##_handler(0, ep, sctx)
/*
* Unhandled Exception Filter
MonoContext* sctx;
LONG res;
+ mono_win_chained_exception_filter_didrun = FALSE;
res = EXCEPTION_CONTINUE_EXECUTION;
er = ep->ExceptionRecord;
g_free (sctx);
+ if (mono_win_chained_exception_filter_didrun)
+ res = mono_win_chained_exception_filter_result;
+
return res;
}
void win32_seh_init()
{
- old_handler = SetUnhandledExceptionFilter(seh_handler);
+ mono_old_win_toplevel_exception_filter = SetUnhandledExceptionFilter(seh_handler);
}
void win32_seh_cleanup()
{
- if (old_handler) SetUnhandledExceptionFilter(old_handler);
+ if (mono_old_win_toplevel_exception_filter) SetUnhandledExceptionFilter(mono_old_win_toplevel_exception_filter);
}
void win32_seh_set_handler(int type, MonoW32ExceptionHandler handler)
gboolean
mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
MonoJitInfo *ji, MonoContext *ctx,
- MonoContext *new_ctx, MonoLMF **lmf,
+ MonoContext *new_ctx, MonoLMF **lmf,
+ mgreg_t **save_locations,
StackFrameInfo *frame)
{
gpointer ip = MONO_CONTEXT_GET_IP (ctx);
memset (frame, 0, sizeof (StackFrameInfo));
frame->ji = ji;
- frame->managed = FALSE;
*new_ctx = *ctx;
frame->type = FRAME_TYPE_MANAGED;
- if (!ji->method->wrapper_type || ji->method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)
- frame->managed = TRUE;
-
if (ji->from_aot)
unwind_info = mono_aot_get_unwind_info (ji, &unwind_info_len);
else
unwind_info = mono_get_cached_unwind_info (ji->used_regs, &unwind_info_len);
+
+ frame->unwind_info = unwind_info;
+ frame->unwind_info_len = unwind_info_len;
regs [AMD64_RAX] = new_ctx->rax;
regs [AMD64_RBX] = new_ctx->rbx;
mono_unwind_frame (unwind_info, unwind_info_len, ji->code_start,
(guint8*)ji->code_start + ji->code_size,
- ip, regs, MONO_MAX_IREGS + 1, &cfa);
+ ip, regs, MONO_MAX_IREGS + 1,
+ save_locations, MONO_MAX_IREGS, &cfa);
new_ctx->rax = regs [AMD64_RAX];
new_ctx->rbx = regs [AMD64_RBX];