move printing of stack trace headers from library to user's program

This commit is contained in:
2020-04-25 09:09:55 +04:00
parent 3e72295ee9
commit 1825515ca0
2 changed files with 6 additions and 4 deletions
+6 -2
View File
@@ -69,9 +69,13 @@ void FatalSignalHandler(int sig, siginfo_t* info, void* context)
}
if(pst_unwind_simple(handler)) {
printf("\n%s", pst_print_simple(handler));
printf("Simple unwind-based stack trace:\n");
printf("--------------------------------\n");
printf("%s\n", pst_print_simple(handler));
if(pst_unwind_pretty(handler)) {
printf("\n%s", pst_print_pretty(handler));
printf("DWARF-based stack trace information:\n");
printf("------------------------------------\n");
printf("%s", pst_print_pretty(handler));
} else {
printf("Failed to use DWARF for unwind stack trace\n");
}