#include #include // used for getting backtraces #include // compiler command // gcc backtrace.c -std=c99 -o backtrace -rdynamic void myfunc3() { const short SIZE = 64; void* btbuffer[SIZE]; int levels = backtrace(btbuffer, SIZE); backtrace_symbols_fd(btbuffer, levels, STDOUT_FILENO); } void myfunc2() { myfunc3(); } void myfunc1() { myfunc2(); } int main(int argc, char** argv) { myfunc1(); return 0; }