From 778007a358961f30ccadd738300a353edf0a0c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Rold=C3=A1n=20Etcheverry?= Date: Sun, 27 Feb 2022 21:57:39 +0100 Subject: C#: Re-introduce exception logging and error stack traces in editor These two had been disabled while moving to .NET 5, as the previous implementation relied on Mono embedding APIs. --- modules/mono/mono_gd/gd_mono.cpp | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) (limited to 'modules/mono/mono_gd/gd_mono.cpp') diff --git a/modules/mono/mono_gd/gd_mono.cpp b/modules/mono/mono_gd/gd_mono.cpp index 7adb6f60eb..8499d30ba4 100644 --- a/modules/mono/mono_gd/gd_mono.cpp +++ b/modules/mono/mono_gd/gd_mono.cpp @@ -360,13 +360,15 @@ static bool _on_core_api_assembly_loaded() { return false; } - GDMonoCache::managed_callbacks.Dispatcher_InitializeDefaultGodotTaskScheduler(); - + bool debug; #ifdef DEBUG_ENABLED - // Install the trace listener now before the project assembly is loaded - GDMonoCache::managed_callbacks.DebuggingUtils_InstallTraceListener(); + debug = true; +#else + debug = false; #endif + GDMonoCache::managed_callbacks.GD_OnCoreApiAssemblyLoaded(debug); + return true; } @@ -534,26 +536,6 @@ Error GDMono::reload_scripts_domain() { #endif #endif -#warning TODO Reimplement in C# -#if 0 -void GDMono::unhandled_exception_hook(MonoObject *p_exc, void *) { - // This method will be called by the runtime when a thrown exception is not handled. - // It won't be called when we manually treat a thrown exception as unhandled. - // We assume the exception was already printed before calling this hook. - -#ifdef DEBUG_ENABLED - GDMonoUtils::debug_send_unhandled_exception_error((MonoException *)p_exc); - if (EngineDebugger::is_active()) { - EngineDebugger::get_singleton()->poll_events(false); - } -#endif - - exit(mono_environment_exitcode_get()); - - GD_UNREACHABLE(); -} -#endif - GDMono::GDMono() { singleton = this; -- cgit v1.2.3