summaryrefslogtreecommitdiff
path: root/modules/mono/mono_gd/gd_mono.cpp
diff options
context:
space:
mode:
authorIgnacio Roldán Etcheverry <ignalfonsore@gmail.com>2022-02-27 21:57:39 +0100
committerIgnacio Roldán Etcheverry <ignalfonsore@gmail.com>2022-08-22 03:36:51 +0200
commit778007a358961f30ccadd738300a353edf0a0c51 (patch)
treef0565278dd7456446f546b416231ed72d30d0017 /modules/mono/mono_gd/gd_mono.cpp
parent67db89988d3c9283d4d58b328b959e1531b16dae (diff)
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.
Diffstat (limited to 'modules/mono/mono_gd/gd_mono.cpp')
-rw-r--r--modules/mono/mono_gd/gd_mono.cpp30
1 files changed, 6 insertions, 24 deletions
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;