]> granicus.if.org Git - strace/commitdiff
Print stack traces on signals
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 29 Aug 2018 16:09:57 +0000 (18:09 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 3 Sep 2018 12:05:48 +0000 (12:05 +0000)
I don't know why it hasn't been done earlier.

* strace.c (print_stopped) [ENABLE_STACKTRACE]: Call unwind_tcb_print
if stack trace printing is enabled.

strace.c

index 6d70d20c1642e64eb0fba6b5b62351171dacfe50..62142d86cc051b2d16e932b66be77317eae2ec30 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2168,6 +2168,11 @@ print_stopped(struct tcb *tcp, const siginfo_t *si, const unsigned int sig)
                } else
                        tprintf("--- stopped by %s ---\n", signame(sig));
                line_ended();
+
+#ifdef ENABLE_STACKTRACE
+               if (stack_trace_enabled)
+                       unwind_tcb_print(tcp);
+#endif
        }
 }