Keep the crash report's exception filter in place, and write the game's exit code into its log from the launcher.

The last-chance exception filter is set at the start, before the GPU driver and the other DLLs load. A DLL that sets
its own filter later takes its place, and a fault in that DLL then ends the game with no FATAL line in the log. Two
0.6.0 logs from an RX 7800 XT end that way on the title screen. Once a second the filter is now put back and the
module that replaced it is logged (NX2NAVI_CRASH_FILTER_GUARD, default 1). When the game ends with a nonzero code,
the launcher adds that code, in hex with its meaning, to the end of logs\nx2navi.log, so a fail-fast exit that no
handler in the process can see still shows in the log a player sends.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-09 11:22:37 -05:00
parent d9dacb4ae4
commit 7db0c5c75b
7 changed files with 82 additions and 3 deletions

View File

@@ -1051,6 +1051,7 @@ void plat_mem_fault_hook(int (*fn)(uint64_t addr)) {
}
void plat_crash_context(const char *s) { (void)s; } // the Windows crash notes only
int plat_crash_filter_reassert(char *who, size_t n) { (void)who, (void)n; return 0; } // Windows only
// plat_jmp_save / plat_jmp_go (platform.h): leaf code that does not move rsp before it leaves, as on Windows.
_Static_assert(sizeof(PlatJmp) == 72 && __builtin_offsetof(PlatJmp, mxcsr) == 64, "plat_jmp_save layout");