blob: 252e4dd7248f7e363ffc3bbdce2540f5b205198f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#include <zebra.h>
#include "log.h"
void
debug_print_trace (int signal)
{
#ifdef HAVE_GLIBC_BACKTRACE
void *array[10];
size_t size;
char **strings;
size_t i;
size = backtrace (array, 10);
strings = backtrace_symbols (array, size);
printf ("Obtained %zd stack frames.\n", size);
for (i = 0; i < size; i++)
printf ("%s\n", strings[i]);
free (strings);
#endif /* HAVE_GLIBC_BACKTRACE */
exit(1);
}
|