diff --git a/src/dwarf/dwarf_handler.c b/src/dwarf/dwarf_handler.c index c2cbbb9..54b3308 100644 --- a/src/dwarf/dwarf_handler.c +++ b/src/dwarf/dwarf_handler.c @@ -165,7 +165,6 @@ bool pst_handler_handle_dwarf(pst_handler* h) const char* pst_print_pretty(pst_handler* h) { h->ctx.clean_print(&h->ctx); - h->ctx.print(&h->ctx, "DWARF-based stack trace information:\n"); uint32_t idx = 0; for(pst_function* fn = pst_handler_next_function(h, NULL); fn; fn = pst_handler_next_function(h, fn)) { h->ctx.print(&h->ctx, "[%-2u] ", idx); idx++; @@ -188,7 +187,6 @@ Dwfl_Callbacks callbacks = { const char* pst_print_simple(pst_handler* h) { h->ctx.clean_print(&h->ctx); - h->ctx.print(&h->ctx, "Simple unwind-based stack trace:\n"); uint32_t idx = 0; for(pst_function* fn = pst_handler_next_function(h, NULL); fn; fn = pst_handler_next_function(h, fn)) { h->ctx.print(&h->ctx, "[%-2u] ", idx); diff --git a/tests/main.c b/tests/main.c index 004cc59..01d9f43 100644 --- a/tests/main.c +++ b/tests/main.c @@ -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"); }