diff --git a/lib/defines.h b/lib/defines.h index e9d5c40e..bc393c91 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -37,12 +37,30 @@ static const char * DBG_LVL_LIST[] = {"NONE", "FAIL", "ERROR", "WARN", "INFO", " #endif #endif +#include +static inline void show_stackframe() { + void *trace[16]; + char **messages = 0; + int i, trace_size = 0; + trace_size = backtrace(trace, 16); + messages = backtrace_symbols(trace, trace_size); + for (i=1; i