diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2021-08-25 08:03:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 08:03:10 +0200 |
commit | 3db8359324a968007c7d0f24023831440a6d16e8 (patch) | |
tree | f51fecb6f58410f3cd1429c55a3f9296d424431d /platform/osx/crash_handler_osx.mm | |
parent | 24f562bd1e1ea5b7b4a5d2371729b97984bee460 (diff) | |
parent | 8556dd1bef3e74e9cb8f0c7deb68c95ece1b8e11 (diff) |
Merge pull request #47829 from Calinou/improve-crash-handler-display
Improve crash handler message display
Diffstat (limited to 'platform/osx/crash_handler_osx.mm')
-rw-r--r-- | platform/osx/crash_handler_osx.mm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/osx/crash_handler_osx.mm b/platform/osx/crash_handler_osx.mm index 0f128d504f..31228b10b4 100644 --- a/platform/osx/crash_handler_osx.mm +++ b/platform/osx/crash_handler_osx.mm @@ -32,6 +32,8 @@ #include "core/config/project_settings.h" #include "core/os/os.h" +#include "core/version.h" +#include "core/version_hash.gen.h" #include "main/main.h" #include <string.h> @@ -85,11 +87,18 @@ static void handle_crash(int sig) { } // Dump the backtrace to stderr with a message to the user + fprintf(stderr, "\n================================================================\n"); fprintf(stderr, "%s: Program crashed with signal %d\n", __FUNCTION__, sig); if (OS::get_singleton()->get_main_loop()) OS::get_singleton()->get_main_loop()->notification(MainLoop::NOTIFICATION_CRASH); + // Print the engine version just before, so that people are reminded to include the version in backtrace reports. + if (String(VERSION_HASH).length() != 0) { + fprintf(stderr, "Engine version: " VERSION_FULL_NAME " (" VERSION_HASH ")\n"); + } else { + fprintf(stderr, "Engine version: " VERSION_FULL_NAME "\n"); + } fprintf(stderr, "Dumping the backtrace. %s\n", msg.utf8().get_data()); char **strings = backtrace_symbols(bt_buffer, size); if (strings) { @@ -148,6 +157,7 @@ static void handle_crash(int sig) { free(strings); } fprintf(stderr, "-- END OF BACKTRACE --\n"); + fprintf(stderr, "================================================================\n"); // Abort to pass the error to the OS abort(); |