paul | fb2d150 | 2003-06-04 09:40:54 +0000 | [diff] [blame] | 1 | #include <zebra.h> |
2 | #include "log.h" | ||||
3 | |||||
4 | void | ||||
5 | debug_print_trace (int signal) | ||||
6 | { | ||||
7 | void *array[10]; | ||||
8 | size_t size; | ||||
9 | char **strings; | ||||
10 | size_t i; | ||||
11 | |||||
12 | size = backtrace (array, 10); | ||||
13 | strings = backtrace_symbols (array, size); | ||||
14 | |||||
15 | printf ("Obtained %zd stack frames.\n", size); | ||||
16 | |||||
17 | for (i = 0; i < size; i++) | ||||
18 | printf ("%s\n", strings[i]); | ||||
19 | |||||
20 | free (strings); | ||||
21 | |||||
22 | exit(1); | ||||
23 | } |