diff --git a/SConstruct b/SConstruct index fa324b2aa0f..572ab0b99ac 100644 --- a/SConstruct +++ b/SConstruct @@ -731,9 +731,12 @@ if env.msvc: env.Append(CCFLAGS=["/Od"]) else: if env["debug_symbols"]: - # Adding dwarf-4 explicitly makes stacktraces work with clang builds, - # otherwise addr2line doesn't understand them - env.Append(CCFLAGS=["-gdwarf-4"]) + if env["platform"] == "windows": + env.Append(CCFLAGS=["-gdwarf-5"]) + else: + # Adding dwarf-4 explicitly makes stacktraces work with clang builds, + # otherwise addr2line doesn't understand them + env.Append(CCFLAGS=["-gdwarf-4"]) if methods.using_emcc(env): # Emscripten only produces dwarf symbols when using "-g3". env.Append(CCFLAGS=["-g3"]) diff --git a/platform/windows/crash_handler_windows_signal.cpp b/platform/windows/crash_handler_windows_signal.cpp index c3a0d08ad6a..ddfb9b65de0 100644 --- a/platform/windows/crash_handler_windows_signal.cpp +++ b/platform/windows/crash_handler_windows_signal.cpp @@ -164,6 +164,9 @@ extern void CrashHandlerException(int signal) { int64_t image_file_base = get_image_base(_execpath); data.offset = image_mem_base - image_file_base; + if (FileAccess::exists(_execpath + ".debugsymbols")) { + _execpath = _execpath + ".debugsymbols"; + } data.state = backtrace_create_state(_execpath.utf8().get_data(), 0, &error_callback, reinterpret_cast(&data)); if (data.state != nullptr) { data.index = 1;