aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasatake YAMATO <yamato@redhat.com>2014-04-16 15:33:08 +0900
committerDmitry V. Levin <ldv@altlinux.org>2014-05-30 22:56:38 +0000
commit2b09df9731f97685b4c06e34ce4ff5f1686eb4c1 (patch)
treee282e6d38b4d3fd6a7c7ee8a941eec94b909482d
parent9bc6561588093a788c29f07579f9e4103864a752 (diff)
downloadandroid_external_strace-2b09df9731f97685b4c06e34ce4ff5f1686eb4c1.tar.gz
android_external_strace-2b09df9731f97685b4c06e34ce4ff5f1686eb4c1.tar.bz2
android_external_strace-2b09df9731f97685b4c06e34ce4ff5f1686eb4c1.zip
unwind: call unwind_tcb_fin before printing detached message
captured stacktrace is printed in unwind_tcb_fin if tcp->queue is not empty. This should happen before printing detached message, so unwind_tcb_fin is moved to the top of droptcb. This is implicitly suggested by Dmitry Levin in patch review process. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
-rw-r--r--strace.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/strace.c b/strace.c
index f8d5cb7f..fe197e5d 100644
--- a/strace.c
+++ b/strace.c
@@ -724,6 +724,12 @@ droptcb(struct tcb *tcp)
if (tcp->pid == 0)
return;
+#ifdef USE_LIBUNWIND
+ if (stack_trace_enabled) {
+ unwind_tcb_fin(tcp);
+ }
+#endif
+
nprocs--;
if (debug_flag)
fprintf(stderr, "dropped tcb for pid %d, %d remain\n", tcp->pid, nprocs);
@@ -745,11 +751,6 @@ droptcb(struct tcb *tcp)
if (printing_tcp == tcp)
printing_tcp = NULL;
-#ifdef USE_LIBUNWIND
- if (stack_trace_enabled) {
- unwind_tcb_fin(tcp);
- }
-#endif
memset(tcp, 0, sizeof(*tcp));
}