mirror of
https://github.com/tmate-io/tmate.git
synced 2025-01-12 17:08:14 +01:00
Better stack traces
This commit is contained in:
parent
13d3439933
commit
089a594a68
@ -23,6 +23,7 @@ endif
|
|||||||
|
|
||||||
CFLAGS += -Wno-unused-parameter -Wno-unused-variable
|
CFLAGS += -Wno-unused-parameter -Wno-unused-variable
|
||||||
CFLAGS += -Ilibssh/include/ -Imsgpack/src
|
CFLAGS += -Ilibssh/include/ -Imsgpack/src
|
||||||
|
CFLAGS += -rdynamic # for stack traces
|
||||||
|
|
||||||
if IS_DEVENV
|
if IS_DEVENV
|
||||||
CFLAGS += -DDEVENV
|
CFLAGS += -DDEVENV
|
||||||
|
@ -62,13 +62,13 @@ void tmate_print_trace(void)
|
|||||||
size = backtrace (array, 20);
|
size = backtrace (array, 20);
|
||||||
strings = backtrace_symbols (array, size);
|
strings = backtrace_symbols (array, size);
|
||||||
|
|
||||||
tmate_debug ("============ %zd stack frames ============", size);
|
tmate_info ("============ %zd stack frames ============", size);
|
||||||
|
|
||||||
for (i = 1; i < size; i++) {
|
for (i = 1; i < size; i++) {
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (print_resolved_stack_frame(strings[i]) < 0)
|
if (print_resolved_stack_frame(strings[i]) < 0)
|
||||||
#endif
|
#endif
|
||||||
tmate_debug("%s", strings[i]);
|
tmate_info("%s", strings[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
free (strings);
|
free (strings);
|
||||||
|
Loading…
Reference in New Issue
Block a user