Print backtrace to standard error
This commit is contained in:
parent
628ae59139
commit
6524044cb9
@ -205,10 +205,10 @@ void backtraceHandler(int sig)
|
|||||||
size = backtrace (array, 10);
|
size = backtrace (array, 10);
|
||||||
strings = (char**)backtrace_symbols (array, size);
|
strings = (char**)backtrace_symbols (array, size);
|
||||||
|
|
||||||
printf ("Obtained %zd stack frames.\n", size);
|
fprintf(stderr, "Obtained %zd stack frames.\n", size);
|
||||||
|
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
printf ("%s\n", strings[i]);
|
fprintf(stderr, "%s\n", strings[i]);
|
||||||
|
|
||||||
free (strings);
|
free (strings);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
Loading…
Reference in New Issue
Block a user