9 #include "WinStackWalker.h"
24 class PrintingStackWalker:
27 virtual void OnOutput(LPCSTR szText)
override
29 std::fputs(szText, stdout);
37 void * stackTrace[30];
38 auto numItems = backtrace(stackTrace,
ARRAYCOUNT(stackTrace));
39 backtrace_symbols_fd(stackTrace, numItems, STDERR_FILENO);
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
void PrintStackTrace(void)
Prints the stacktrace for the current thread.