Skip to content

Instantly share code, notes, and snippets.

View akoluthic's full-sized avatar

Alex Yoder akoluthic

View GitHub Profile
@jvranish
jvranish / stack_traces.c
Last active January 16, 2025 10:32
An example of catching exceptions and printing stack traces in C on Windows, Linux and OS X
/* compile with:
on linux: gcc -g stack_traces.c
on OS X: gcc -g -fno-pie stack_traces.c
on windows: gcc -g stack_traces.c -limagehlp
*/
#include <signal.h>
#include <stdio.h>
#include <assert.h>