feat(util): Separate debug module with proper stacktrace printing

Because we are using mingw, we can't just use window's
dbghelp library as the symbols created are in dwarf format.

Fortunately, the dwarfstack library already provides all the
facilities to easily print very descriptive stacktraces,
including function names, file names and line numbers,
when dwarf symbols are available.

This moves the incomplete exception handling portion from
signal to a separate module as well to improve scoping.
This commit is contained in:
icex2
2024-01-31 21:21:00 +01:00
parent 69e469858c
commit 8eefb2d477
10 changed files with 384 additions and 83 deletions
+10
View File
@@ -0,0 +1,10 @@
#ifndef UTIL_DEBUG_H
#define UTIL_DEBUG_H
#include <windows.h>
void debug_init();
void debug_print_stacktrace();
const char *debug_exception_code_to_str(DWORD code);
#endif