diff --git a/platform/linuxbsd/crash_handler_linuxbsd.cpp b/platform/linuxbsd/crash_handler_linuxbsd.cpp index 7f98f8de615..770bc835fcf 100644 --- a/platform/linuxbsd/crash_handler_linuxbsd.cpp +++ b/platform/linuxbsd/crash_handler_linuxbsd.cpp @@ -67,9 +67,8 @@ static void handle_crash(int sig) { String _execpath = OS::get_singleton()->get_executable_path(); String msg; - const ProjectSettings *proj_settings = ProjectSettings::get_singleton(); - if (proj_settings) { - msg = proj_settings->get("debug/settings/crash_handler/message"); + if (ProjectSettings::get_singleton()) { + msg = GLOBAL_GET("debug/settings/crash_handler/message"); } // Tell MainLoop about the crash. This can be handled by users too in Node. @@ -144,21 +143,18 @@ static void handle_crash(int sig) { free(strings); } - print_error("-- END OF BACKTRACE --"); + print_error("-- END OF C++ BACKTRACE --"); print_error("================================================================"); - Vector> script_backtraces; if (ScriptServer::are_languages_initialized()) { - script_backtraces = ScriptServer::capture_script_backtraces(false); - } - if (!script_backtraces.is_empty()) { + Vector> script_backtraces = ScriptServer::capture_script_backtraces(false); for (const Ref &backtrace : script_backtraces) { if (!backtrace->is_empty()) { print_error(backtrace->format()); + print_error(vformat("-- END OF %s BACKTRACE --", backtrace->get_language_name().to_upper())); + print_error("================================================================"); } } - print_error("-- END OF SCRIPT BACKTRACE --"); - print_error("================================================================"); } // Abort to pass the error to the OS diff --git a/platform/macos/crash_handler_macos.mm b/platform/macos/crash_handler_macos.mm index acb21c1bc8a..6dc389d0376 100644 --- a/platform/macos/crash_handler_macos.mm +++ b/platform/macos/crash_handler_macos.mm @@ -90,9 +90,8 @@ static void handle_crash(int sig) { String _execpath = OS::get_singleton()->get_executable_path(); String msg; - const ProjectSettings *proj_settings = ProjectSettings::get_singleton(); - if (proj_settings) { - msg = proj_settings->get("debug/settings/crash_handler/message"); + if (ProjectSettings::get_singleton()) { + msg = GLOBAL_GET("debug/settings/crash_handler/message"); } // Tell MainLoop about the crash. This can be handled by users too in Node. @@ -174,21 +173,18 @@ static void handle_crash(int sig) { free(strings); } - print_error("-- END OF BACKTRACE --"); + print_error("-- END OF C++ BACKTRACE --"); print_error("================================================================"); - Vector> script_backtraces; if (ScriptServer::are_languages_initialized()) { - script_backtraces = ScriptServer::capture_script_backtraces(false); - } - if (!script_backtraces.is_empty()) { + Vector> script_backtraces = ScriptServer::capture_script_backtraces(false); for (const Ref &backtrace : script_backtraces) { if (!backtrace->is_empty()) { print_error(backtrace->format()); + print_error(vformat("-- END OF %s BACKTRACE --", backtrace->get_language_name().to_upper())); + print_error("================================================================"); } } - print_error("-- END OF SCRIPT BACKTRACE --"); - print_error("================================================================"); } // Abort to pass the error to the OS diff --git a/platform/windows/crash_handler_windows_seh.cpp b/platform/windows/crash_handler_windows_seh.cpp index dba4f0c3473..02c95120b6e 100644 --- a/platform/windows/crash_handler_windows_seh.cpp +++ b/platform/windows/crash_handler_windows_seh.cpp @@ -134,9 +134,8 @@ DWORD CrashHandlerException(EXCEPTION_POINTERS *ep) { } String msg; - const ProjectSettings *proj_settings = ProjectSettings::get_singleton(); - if (proj_settings) { - msg = proj_settings->get("debug/settings/crash_handler/message"); + if (ProjectSettings::get_singleton()) { + msg = GLOBAL_GET("debug/settings/crash_handler/message"); } // Tell MainLoop about the crash. This can be handled by users too in Node. @@ -226,23 +225,20 @@ DWORD CrashHandlerException(EXCEPTION_POINTERS *ep) { } } while (frame.AddrReturn.Offset != 0 && n < 256); - print_error("-- END OF BACKTRACE --"); + print_error("-- END OF C++ BACKTRACE --"); print_error("================================================================"); SymCleanup(process); - Vector> script_backtraces; if (ScriptServer::are_languages_initialized()) { - script_backtraces = ScriptServer::capture_script_backtraces(false); - } - if (!script_backtraces.is_empty()) { + Vector> script_backtraces = ScriptServer::capture_script_backtraces(false); for (const Ref &backtrace : script_backtraces) { if (!backtrace->is_empty()) { print_error(backtrace->format()); + print_error(vformat("-- END OF %s BACKTRACE --", backtrace->get_language_name().to_upper())); + print_error("================================================================"); } } - print_error("-- END OF SCRIPT BACKTRACE --"); - print_error("================================================================"); } // Pass the exception to the OS diff --git a/platform/windows/crash_handler_windows_signal.cpp b/platform/windows/crash_handler_windows_signal.cpp index 7f60046d093..cd1f39d3a49 100644 --- a/platform/windows/crash_handler_windows_signal.cpp +++ b/platform/windows/crash_handler_windows_signal.cpp @@ -140,9 +140,8 @@ extern void CrashHandlerException(int signal) { } String msg; - const ProjectSettings *proj_settings = ProjectSettings::get_singleton(); - if (proj_settings) { - msg = proj_settings->get("debug/settings/crash_handler/message"); + if (ProjectSettings::get_singleton()) { + msg = GLOBAL_GET("debug/settings/crash_handler/message"); } // Tell MainLoop about the crash. This can be handled by users too in Node. @@ -182,21 +181,18 @@ extern void CrashHandlerException(int signal) { backtrace_simple(data.state, 1, &trace_callback, &error_callback, reinterpret_cast(&data)); } - print_error("-- END OF BACKTRACE --"); + print_error("-- END OF C++ BACKTRACE --"); print_error("================================================================"); - Vector> script_backtraces; if (ScriptServer::are_languages_initialized()) { - script_backtraces = ScriptServer::capture_script_backtraces(false); - } - if (!script_backtraces.is_empty()) { + Vector> script_backtraces = ScriptServer::capture_script_backtraces(false); for (const Ref &backtrace : script_backtraces) { if (!backtrace->is_empty()) { print_error(backtrace->format()); + print_error(vformat("-- END OF %s BACKTRACE --", backtrace->get_language_name().to_upper())); + print_error("================================================================"); } } - print_error("-- END OF SCRIPT BACKTRACE --"); - print_error("================================================================"); } } #endif