mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 11:21:08 -10:00
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7328415ac5 | ||
|
|
20a03cdb8e | ||
|
|
5f805b6b03 | ||
|
|
4205769da9 | ||
|
|
5756e65a5c | ||
|
|
dfd7ba8ff6 |
No files matched your search
@@ -111,6 +111,11 @@
|
||||
#include "icall-def-netcore.h"
|
||||
#else
|
||||
|
||||
|
||||
|
||||
ICALL_TYPE(MONOEXT, "BepInEx.MonoExtensions", MONOEXT_1)
|
||||
HANDLES(MONOEXT_1, "GetFunctionPointerForDelegateInternal2", ves_icall_BepInEx_MonoExtensions_GetFunctionPointerForDelegateInternal2, gpointer, 2, (MonoDelegate, gint32))
|
||||
|
||||
ICALL_TYPE(CLR_INTEROP_SYS, "Interop/Sys", CLR_INTEROP_SYS_1)
|
||||
NOHANDLES(ICALL(CLR_INTEROP_SYS_1, "DoubleToString", ves_icall_Interop_Sys_DoubleToString))
|
||||
|
||||
@@ -747,6 +752,7 @@ NOHANDLES(ICALL(GCH_3, "GetAddrOfPinnedObject", ves_icall_System_GCHandle_GetAdd
|
||||
HANDLES(GCH_4, "GetTarget", ves_icall_System_GCHandle_GetTarget, MonoObject, 1, (gpointer))
|
||||
HANDLES(GCH_5, "GetTargetHandle", ves_icall_System_GCHandle_GetTargetHandle, gpointer, 3, (MonoObject, gpointer, gint32))
|
||||
|
||||
|
||||
#if !defined(DISABLE_COM) || defined (HOST_WIN32)
|
||||
ICALL_TYPE(MARSHAL, "System.Runtime.InteropServices.Marshal", MARSHAL_1)
|
||||
NOHANDLES(ICALL(MARSHAL_1, "AddRefInternal", ves_icall_System_Runtime_InteropServices_Marshal_AddRefInternal))
|
||||
|
||||
+31
-5
@@ -288,9 +288,16 @@ mono_marshal_unlock_internal (void)
|
||||
mono_marshal_unlock ();
|
||||
}
|
||||
|
||||
// This is a JIT icall, it sets the pending exception (in wrapper) and return NULL on error.
|
||||
gpointer
|
||||
mono_delegate_to_ftnptr_impl (MonoDelegateHandle delegate, MonoError *error)
|
||||
{
|
||||
return mono_delegate_to_ftnptr_impl_ext(delegate, -1, error);
|
||||
}
|
||||
|
||||
|
||||
// This is a JIT icall, it sets the pending exception (in wrapper) and return NULL on error.
|
||||
gpointer
|
||||
mono_delegate_to_ftnptr_impl_ext (MonoDelegateHandle delegate, gint32 callConv, MonoError *error)
|
||||
{
|
||||
gpointer result = NULL;
|
||||
MonoMethod *method, *wrapper;
|
||||
@@ -334,7 +341,8 @@ mono_delegate_to_ftnptr_impl (MonoDelegateHandle delegate, MonoError *error)
|
||||
target_handle = mono_gchandle_new_weakref_from_handle (delegate_target);
|
||||
}
|
||||
|
||||
wrapper = mono_marshal_get_managed_wrapper (method, klass, target_handle, error);
|
||||
wrapper = mono_marshal_get_managed_wrapper_2 (method, klass, target_handle, callConv, error);
|
||||
|
||||
goto_if_nok (error, leave);
|
||||
|
||||
MONO_HANDLE_SETVAL (delegate, delegate_trampoline, gpointer, mono_compile_method_checked (wrapper, error));
|
||||
@@ -4006,6 +4014,13 @@ method_signature_is_blittable (MonoMethodSignature *sig)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
MonoMethod *
|
||||
mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, MonoGCHandle target_handle, MonoError *error)
|
||||
{
|
||||
return mono_marshal_get_managed_wrapper_2(method, delegate_klass, target_handle, -1, error);
|
||||
}
|
||||
|
||||
/**
|
||||
* mono_marshal_get_managed_wrapper:
|
||||
* Generates IL code to call managed methods from unmanaged code
|
||||
@@ -4015,7 +4030,7 @@ method_signature_is_blittable (MonoMethodSignature *sig)
|
||||
* UnamangedCallersOnlyAttribute.
|
||||
*/
|
||||
MonoMethod *
|
||||
mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, MonoGCHandle target_handle, MonoError *error)
|
||||
mono_marshal_get_managed_wrapper_2 (MonoMethod *method, MonoClass *delegate_klass, MonoGCHandle target_handle, gint32 callConv, MonoError *error)
|
||||
{
|
||||
MonoMethodSignature *sig, *csig, *invoke_sig;
|
||||
MonoMethodBuilder *mb;
|
||||
@@ -4039,9 +4054,10 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
|
||||
* could be called with different delegates, thus different marshalling
|
||||
* options.
|
||||
*/
|
||||
|
||||
cache = get_cache (&mono_method_get_wrapper_cache (method)->managed_wrapper_cache, mono_aligned_addr_hash, NULL);
|
||||
|
||||
if (!target_handle && (res = mono_marshal_find_in_cache (cache, method)))
|
||||
if (callConv < 0 && !target_handle && (res = mono_marshal_find_in_cache (cache, method)))
|
||||
return res;
|
||||
|
||||
if (G_UNLIKELY (!delegate_klass)) {
|
||||
@@ -4136,6 +4152,7 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
|
||||
|
||||
/* typed args */
|
||||
call_conv = *(gint32*)typed_args [0];
|
||||
|
||||
/* named args */
|
||||
for (i = 0; i < num_named_args; ++i) {
|
||||
CattrNamedArg *narg = &arginfo [i];
|
||||
@@ -4170,6 +4187,9 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
|
||||
mono_custom_attrs_free (cinfo);
|
||||
}
|
||||
|
||||
if (callConv > -1)
|
||||
csig->call_convention = callConv - 1;
|
||||
|
||||
mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle);
|
||||
|
||||
if (!target_handle) {
|
||||
@@ -5927,7 +5947,13 @@ ves_icall_System_Runtime_InteropServices_Marshal_GetDelegateForFunctionPointerIn
|
||||
gpointer
|
||||
ves_icall_System_Runtime_InteropServices_Marshal_GetFunctionPointerForDelegateInternal (MonoDelegateHandle delegate, MonoError *error)
|
||||
{
|
||||
return mono_delegate_to_ftnptr_impl (delegate, error);
|
||||
return mono_delegate_to_ftnptr_impl_ext (delegate, -1, error);
|
||||
}
|
||||
|
||||
gpointer
|
||||
ves_icall_BepInEx_MonoExtensions_GetFunctionPointerForDelegateInternal2 (MonoDelegateHandle delegate, gint32 callConv, MonoError *error)
|
||||
{
|
||||
return mono_delegate_to_ftnptr_impl_ext (delegate, callConv, error);
|
||||
}
|
||||
|
||||
MonoBoolean
|
||||
|
||||
@@ -444,9 +444,15 @@ mono_marshal_get_runtime_invoke_for_sig (MonoMethodSignature *sig);
|
||||
MonoMethodSignature*
|
||||
mono_marshal_get_string_ctor_signature (MonoMethod *method);
|
||||
|
||||
gpointer
|
||||
mono_delegate_to_ftnptr_impl_ext (MonoDelegateHandle delegate, gint32 callConv, MonoError *error);
|
||||
|
||||
MonoMethod *
|
||||
mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, MonoGCHandle this_loc, MonoError *exernal_error);
|
||||
|
||||
MonoMethod *
|
||||
mono_marshal_get_managed_wrapper_2 (MonoMethod *method, MonoClass *delegate_klass, MonoGCHandle this_loc, gint32 callConv, MonoError *exernal_error);
|
||||
|
||||
gpointer
|
||||
mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type);
|
||||
|
||||
|
||||
@@ -930,6 +930,14 @@ addprefix(mini_public_headers ../mini "${mini_public_headers_base}")
|
||||
|
||||
set(mini_sources "${CMAKE_CURRENT_BINARY_DIR}/buildver-sgen.h;main-core.c;${mini_common_sources};${arch_sources};${os_sources};${mini_interp_sources};${llvm_sources};${debugger_sources};${llvm_runtime_sources}")
|
||||
|
||||
if(LLVM_LIBDIR)
|
||||
link_directories(${LLVM_LIBDIR})
|
||||
endif()
|
||||
|
||||
if(HOST_DARWIN)
|
||||
set(OS_LIBS "-framework CoreFoundation" "-framework Foundation")
|
||||
endif()
|
||||
|
||||
add_library(monosgen-objects OBJECT "${eglib_sources};${metadata_sources};${utils_sources};${sgen_sources};${icu_shim_sources};${eventpipe_sources};${mini_sources}")
|
||||
add_library(monosgen-static STATIC $<TARGET_OBJECTS:monosgen-objects>)
|
||||
set_target_properties(monosgen-static PROPERTIES OUTPUT_NAME monosgen-2.0)
|
||||
@@ -942,6 +950,8 @@ install(FILES ${mini_public_headers}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mono-2.0/mono/jit)
|
||||
if(NOT DISABLE_SHARED_LIBS)
|
||||
add_library(monosgen SHARED $<TARGET_OBJECTS:monosgen-objects>)
|
||||
set_target_properties(monosgen PROPERTIES OUTPUT_NAME monosgen-2.0)
|
||||
target_link_libraries(monosgen ${OS_LIBS} "iconv" ${LLVM_LIBS} ${ICU_LIBS})
|
||||
install(TARGETS monosgen LIBRARY)
|
||||
endif()
|
||||
|
||||
@@ -979,8 +989,10 @@ add_custom_command(
|
||||
|
||||
if(NOT DISABLE_EXECUTABLES)
|
||||
add_executable(mono-sgen "main-sgen.c")
|
||||
target_link_libraries(mono-sgen monosgen-static "-framework CoreFoundation" "-framework Foundation" "iconv" ${LLVM_LIBS} ${ICU_LIBS})
|
||||
target_link_libraries(monosgen "-framework CoreFoundation" "-framework Foundation" "iconv" ${LLVM_LIBS} ${ICU_LIBS})
|
||||
set_target_properties(mono-sgen monosgen PROPERTIES LINK_FLAGS ${ICU_LDFLAGS})
|
||||
target_link_libraries(mono-sgen monosgen-static ${OS_LIBS} "iconv" ${LLVM_LIBS} ${ICU_LIBS})
|
||||
target_link_libraries(monosgen ${OS_LIBS} "iconv" ${LLVM_LIBS} ${ICU_LIBS})
|
||||
if(ICU_LDFLAGS)
|
||||
set_target_properties(mono-sgen monosgen PROPERTIES LINK_FLAGS ${ICU_LDFLAGS})
|
||||
endif()
|
||||
install(TARGETS mono-sgen RUNTIME)
|
||||
endif()
|
||||
@@ -66,7 +66,7 @@ static LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
|
||||
#endif
|
||||
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL, NULL);
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
@@ -876,7 +876,7 @@ altstack_handle_and_restore (MonoContext *ctx, MonoObject *obj, guint32 flags)
|
||||
|
||||
if (!ji || (!stack_ovf && !nullref)) {
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), ctx, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), ctx, NULL, NULL);
|
||||
// if couldn't dump or if mono_handle_native_crash returns, abort
|
||||
abort ();
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
|
||||
}
|
||||
if (!ji)
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), (MonoContext*)sigctx, siginfo);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), (MonoContext*)sigctx, siginfo, sigctx);
|
||||
/* setup a call frame on the real stack so that control is returned there
|
||||
* and exception handling can continue.
|
||||
* The frame looks like:
|
||||
|
||||
@@ -67,7 +67,7 @@ static LONG CALLBACK seh_unhandled_exception_filter(EXCEPTION_POINTERS* ep)
|
||||
}
|
||||
#endif
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), NULL, NULL, NULL);
|
||||
|
||||
return EXCEPTION_CONTINUE_SEARCH;
|
||||
}
|
||||
@@ -1140,7 +1140,7 @@ mono_arch_handle_altstack_exception (void *sigctx, MONO_SIG_HANDLER_INFO_TYPE *s
|
||||
MonoContext mctx;
|
||||
mono_sigctx_to_monoctx (sigctx, &mctx);
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, siginfo);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, siginfo, sigctx);
|
||||
else
|
||||
abort ();
|
||||
}
|
||||
|
||||
+14
-11
@@ -3399,7 +3399,7 @@ print_stack_frame_to_string (StackFrameInfo *frame, MonoContext *ctx, gpointer d
|
||||
* printing diagnostic information and aborting.
|
||||
*/
|
||||
void
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info)
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, void *context)
|
||||
{
|
||||
MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
|
||||
|
||||
@@ -3409,17 +3409,20 @@ mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLE
|
||||
sigemptyset (&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
|
||||
/* Remove our SIGABRT handler */
|
||||
/* Mono has crashed - remove our handlers except SIGTERM, which is used by crash reporting */
|
||||
/* TODO: Combine with mono_runtime_cleanup_handlers (but with an option to not de-allocate anything) */
|
||||
if (mini_debug_options.handle_sigint) {
|
||||
g_assert (sigaction (SIGINT, &sa, NULL) != -1);
|
||||
}
|
||||
|
||||
g_assert (sigaction (SIGABRT, &sa, NULL) != -1);
|
||||
|
||||
/* On some systems we get a SIGILL when calling abort (), because it might
|
||||
* fail to raise SIGABRT */
|
||||
g_assert (sigaction (SIGFPE, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGSYS, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGSEGV, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGQUIT, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGBUS, &sa, NULL) != -1);
|
||||
g_assert (sigaction (SIGILL, &sa, NULL) != -1);
|
||||
|
||||
/* Remove SIGCHLD, it uses the finalizer thread */
|
||||
g_assert (sigaction (SIGCHLD, &sa, NULL) != -1);
|
||||
|
||||
/* Remove SIGQUIT, we are already dumping threads */
|
||||
g_assert (sigaction (SIGQUIT, &sa, NULL) != -1);
|
||||
|
||||
#endif
|
||||
@@ -3459,13 +3462,13 @@ mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLE
|
||||
g_async_safe_printf ("=================================================================\n");
|
||||
}
|
||||
|
||||
mono_post_native_crash_handler (signal, mctx, info, mono_do_crash_chaining);
|
||||
mono_post_native_crash_handler (signal, mctx, info, mono_do_crash_chaining, context);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info)
|
||||
mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, void *context)
|
||||
{
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ MONO_SIG_HANDLER_FUNC (static, sigabrt_signal_handler)
|
||||
return;
|
||||
mono_sigctx_to_monoctx (ctx, &mctx);
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, info);
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, info, ctx);
|
||||
else
|
||||
abort ();
|
||||
}
|
||||
@@ -254,7 +254,7 @@ MONO_SIG_HANDLER_FUNC (static, sigterm_signal_handler)
|
||||
// running. Returns FALSE on unrecoverable error.
|
||||
if (mono_dump_start ()) {
|
||||
// Process was killed from outside since crash reporting wasn't running yet.
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, NULL);
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, NULL, ctx);
|
||||
} else {
|
||||
// Crash reporting already running and we got a second SIGTERM from as part of thread-summarizing
|
||||
if (!mono_threads_summarize_execute (&mctx, &output, &hashes, FALSE, NULL, 0))
|
||||
@@ -1107,7 +1107,7 @@ mono_dump_native_crash_info (const char *signal, MonoContext *mctx, MONO_SIG_HAN
|
||||
}
|
||||
|
||||
void
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining)
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining, void *context)
|
||||
{
|
||||
if (!crash_chaining) {
|
||||
/*Android abort is a fluke, it doesn't abort, it triggers another segv. */
|
||||
@@ -1117,6 +1117,11 @@ mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_
|
||||
abort ();
|
||||
#endif
|
||||
}
|
||||
mono_chain_signal (info->si_signo, info, context);
|
||||
|
||||
// we remove Mono's signal handlers from crashing signals in mono_handle_native_crash(), so re-raising will now allow the OS to handle the crash
|
||||
// TODO: perhaps we can always use this to abort, instead of explicit exit()/abort() as we do above
|
||||
raise (info->si_signo);
|
||||
}
|
||||
#endif /* !MONO_CROSS_COMPILE */
|
||||
|
||||
|
||||
@@ -3442,11 +3442,8 @@ MONO_SIG_HANDLER_FUNC (, mono_sigfpe_signal_handler)
|
||||
|
||||
mono_sigctx_to_monoctx (ctx, &mctx);
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGFPE), &mctx, info);
|
||||
if (mono_do_crash_chaining) {
|
||||
mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
|
||||
goto exit;
|
||||
}
|
||||
mono_handle_native_crash (mono_get_signame (SIGFPE), &mctx, info, ctx);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
mono_arch_handle_exception (ctx, exc);
|
||||
@@ -3467,14 +3464,10 @@ MONO_SIG_HANDLER_FUNC (, mono_crashing_signal_handler)
|
||||
mono_sigctx_to_monoctx (ctx, &mctx);
|
||||
if (mono_dump_start ())
|
||||
#if defined(HAVE_SIG_INFO) && !defined(HOST_WIN32) // info is a siginfo_t
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, info);
|
||||
mono_handle_native_crash (mono_get_signame (info->si_signo), &mctx, info, ctx);
|
||||
#else
|
||||
mono_handle_native_crash (mono_get_signame (SIGTERM), &mctx, info);
|
||||
mono_handle_native_crash (mono_get_signame (SIGTERM), &mctx, info, ctx);
|
||||
#endif
|
||||
if (mono_do_crash_chaining) {
|
||||
mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(MONO_ARCH_USE_SIGACTION) || defined(HOST_WIN32)
|
||||
@@ -3554,11 +3547,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigsegv_signal_handler)
|
||||
if (!mono_do_crash_chaining && mono_chain_signal (MONO_SIG_HANDLER_PARAMS))
|
||||
return;
|
||||
if (mono_dump_start())
|
||||
mono_handle_native_crash (mono_get_signame (signo), &mctx, info);
|
||||
if (mono_do_crash_chaining) {
|
||||
mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
|
||||
return;
|
||||
}
|
||||
mono_handle_native_crash (mono_get_signame (signo), &mctx, info, ctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3597,7 +3586,7 @@ MONO_SIG_HANDLER_FUNC (, mono_sigsegv_signal_handler)
|
||||
} else {
|
||||
// FIXME: This shouldn't run on the altstack
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, info);
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, info, ctx);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -3608,23 +3597,14 @@ MONO_SIG_HANDLER_FUNC (, mono_sigsegv_signal_handler)
|
||||
return;
|
||||
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, (MONO_SIG_HANDLER_INFO_TYPE*)info);
|
||||
|
||||
if (mono_do_crash_chaining) {
|
||||
mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
|
||||
return;
|
||||
}
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, (MONO_SIG_HANDLER_INFO_TYPE*)info, ctx);
|
||||
}
|
||||
|
||||
if (mono_is_addr_implicit_null_check (fault_addr)) {
|
||||
mono_arch_handle_exception (ctx, NULL);
|
||||
} else {
|
||||
if (mono_dump_start ())
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, (MONO_SIG_HANDLER_INFO_TYPE*)info);
|
||||
if (mono_do_crash_chaining) {
|
||||
mono_chain_signal (MONO_SIG_HANDLER_PARAMS);
|
||||
return;
|
||||
}
|
||||
mono_handle_native_crash (mono_get_signame (SIGSEGV), &mctx, (MONO_SIG_HANDLER_INFO_TYPE*)info, ctx);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -559,7 +559,7 @@ void
|
||||
mono_dump_native_crash_info (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info);
|
||||
|
||||
void
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining);
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining, void *context);
|
||||
|
||||
gboolean
|
||||
mono_is_addr_implicit_null_check (void *addr);
|
||||
|
||||
@@ -281,7 +281,7 @@ mono_dump_native_crash_info (const char *signal, MonoContext *mctx, MONO_SIG_HAN
|
||||
}
|
||||
|
||||
void
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining)
|
||||
mono_post_native_crash_handler (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *info, gboolean crash_chaining, void *context)
|
||||
{
|
||||
if (!crash_chaining)
|
||||
abort ();
|
||||
|
||||
+1
-1
@@ -2520,7 +2520,7 @@ typedef gboolean (*MonoJitStackWalk) (StackFrameInfo *frame, MonoCont
|
||||
|
||||
void mono_exceptions_init (void);
|
||||
gboolean mono_handle_exception (MonoContext *ctx, gpointer obj);
|
||||
void mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *siginfo);
|
||||
void mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLER_INFO_TYPE *siginfo, void *context);
|
||||
MONO_API void mono_print_thread_dump (void *sigctx);
|
||||
MONO_API void mono_print_thread_dump_from_ctx (MonoContext *ctx);
|
||||
void mono_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data);
|
||||
|
||||
@@ -130,6 +130,11 @@ class OffsetsTool:
|
||||
self.target = Target ("TARGET_X86", "", IOS_DEFINES)
|
||||
self.target_args += ["-arch", "i386"]
|
||||
self.target_args += ["-isysroot", args.sysroot]
|
||||
elif "x86_64-apple-darwin10" == args.abi:
|
||||
require_sysroot (args)
|
||||
self.target = Target ("TARGET_AMD64", "", IOS_DEFINES)
|
||||
self.target_args += ["-arch", "x86_64"]
|
||||
self.target_args += ["-isysroot", args.sysroot]
|
||||
|
||||
# watchOS
|
||||
elif "armv7k-apple-darwin" == args.abi:
|
||||
|
||||
@@ -305,6 +305,9 @@ mono_valloc (void *addr, size_t length, int flags, MonoMemAccountType type)
|
||||
}
|
||||
if ((flags & MONO_MMAP_JIT) && (use_mmap_jit || is_hardened_runtime == 1))
|
||||
mflags |= MAP_JIT;
|
||||
/* Patching code on apple silicon seems to cause random crashes without this flag */
|
||||
if (__builtin_available (macOS 11, *))
|
||||
mflags |= MAP_JIT;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user