From e5315363d80cf1c69ddf01e93fe558ccb27f8c32 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 4 Aug 2026 10:55:04 +1000 Subject: [PATCH] [common] debug: print backtraces on assertions --- common/include/common/debug.h | 2 ++ common/src/platform/windows/crash.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/common/include/common/debug.h b/common/include/common/debug.h index 792f73d4..73d072cb 100644 --- a/common/include/common/debug.h +++ b/common/include/common/debug.h @@ -154,7 +154,9 @@ void debug_trace(const char * file, unsigned int line, const char * function, if (!(__VA_ARGS__)) \ { \ DEBUG_ASSERT_PRINT(__VA_ARGS__); \ + DEBUG_PRINT_BACKTRACE(); \ abort(); \ + DEBUG_UNREACHABLE_MARKER(); \ } \ } while (0) diff --git a/common/src/platform/windows/crash.c b/common/src/platform/windows/crash.c index c769be58..ea326760 100644 --- a/common/src/platform/windows/crash.c +++ b/common/src/platform/windows/crash.c @@ -156,6 +156,10 @@ bool installCrashHandler(const char * exe, char * argv0) return true; } +void printBacktrace(void) +{ +} + void printAllThreadBacktraces(void) { } @@ -168,6 +172,10 @@ bool installCrashHandler(const char * exe, char * argv0) return true; } +void printBacktrace(void) +{ +} + void printAllThreadBacktraces(void) { }