linuxdarwin_backtrace.h (355B)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #ifndef _LINUXDARWIN_BACKTRACE_H_ #define _LINUXDARWIN_BACKTRACE_H_ #include <unistd.h> #include <execinfo.h> #include "intrinsics.h" inline void print_backtrace() { void * stack[ 128 ]; const int stack_size = backtrace( stack, array_count( stack ) ); backtrace_symbols_fd( stack, stack_size, STDERR_FILENO ); } #endif // _LINUXDARWIN_BACKTRACE_H_ |