Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View camilstaps's full-sized avatar

Camil Staps camilstaps

View GitHub Profile
@jvranish
jvranish / stack_traces.c
Last active April 17, 2024 16:25
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>