diff --git a/src/mono/mono/metadata/debug-helpers.h b/src/mono/mono/metadata/debug-helpers.h index 8ecdf8edc589f6..795eb53d72429f 100644 --- a/src/mono/mono/metadata/debug-helpers.h +++ b/src/mono/mono/metadata/debug-helpers.h @@ -48,6 +48,9 @@ MONO_API char* mono_method_get_reflection_name (MonoMethod *method); MONO_API char* mono_field_full_name (MonoClassField *field); +MONO_API MONO_RT_EXTERNAL_ONLY void +mono_debugger_agent_unhandled_exception (MonoException *e); + MONO_END_DECLS #endif /* __MONO_DEBUG_HELPERS_H__ */ diff --git a/src/mono/mono/mini/debugger-agent-external.c b/src/mono/mono/mini/debugger-agent-external.c index af2d1057359ad0..2fc584c5ad9497 100644 --- a/src/mono/mono/mini/debugger-agent-external.c +++ b/src/mono/mono/mini/debugger-agent-external.c @@ -5,6 +5,7 @@ #include #include #include "debugger-agent-external.h" +#include #ifndef DISABLE_SDB @@ -59,4 +60,12 @@ mono_debugger_agent_get_sdb_options (void) { return sdb_options; } + +void +mono_debugger_agent_unhandled_exception (MonoException *e) +{ + MONO_ENTER_GC_UNSAFE; + MONO_EXTERNAL_ONLY_VOID (mono_component_debugger ()->unhandled_exception (e)); + MONO_EXIT_GC_UNSAFE; +} #endif /* DISABLE_SDB */ diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index 7ba23bd560f920..36400c7e9fdbbe 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -4607,11 +4607,6 @@ register_icalls (void) mono_add_internal_call_internal ("Mono.Runtime::mono_runtime_install_handlers", mono_runtime_install_handlers); -#if defined(HOST_ANDROID) || defined(TARGET_ANDROID) - mono_add_internal_call_internal ("System.Diagnostics.Debugger::Mono_UnhandledException_internal", - mono_component_debugger ()->unhandled_exception); -#endif - /* * It's important that we pass `TRUE` as the last argument here, as * it causes the JIT to omit a wrapper for these icalls. If the JIT