summaryrefslogtreecommitdiff
path: root/platform/windows
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2021-04-12 16:59:23 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2021-06-17 20:05:16 +0200
commit8556dd1bef3e74e9cb8f0c7deb68c95ece1b8e11 (patch)
tree2950da8fc6ec79f0d54a5f36241c8897c47698d1 /platform/windows
parent13c4796693c3c32993cd49b226fc9c78ad376f6d (diff)
Improve crash handler message display
- State the Godot version and full hash in the backtrace. - Add decoration around the crash backtrace, both to make it stand out from other messages and help the user figure out what they should copy.
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/crash_handler_windows.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/windows/crash_handler_windows.cpp b/platform/windows/crash_handler_windows.cpp
index e2d507eddd..1b4dae207f 100644
--- a/platform/windows/crash_handler_windows.cpp
+++ b/platform/windows/crash_handler_windows.cpp
@@ -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"
#ifdef CRASH_HANDLER_EXCEPTION
@@ -127,6 +129,7 @@ DWORD CrashHandlerException(EXCEPTION_POINTERS *ep) {
return EXCEPTION_CONTINUE_SEARCH;
}
+ fprintf(stderr, "\n================================================================\n");
fprintf(stderr, "%s: Program crashed\n", __FUNCTION__);
if (OS::get_singleton()->get_main_loop())
@@ -175,6 +178,12 @@ DWORD CrashHandlerException(EXCEPTION_POINTERS *ep) {
msg = proj_settings->get("debug/settings/crash_handler/message");
}
+ // 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());
int n = 0;
@@ -200,6 +209,7 @@ DWORD CrashHandlerException(EXCEPTION_POINTERS *ep) {
} while (frame.AddrReturn.Offset != 0 && n < 256);
fprintf(stderr, "-- END OF BACKTRACE --\n");
+ fprintf(stderr, "================================================================\n");
SymCleanup(process);