xsprintf(name, "%s.%u", outfname, tcp->pid);
tcp->outf = strace_fopen(name);
}
+
+#ifdef ENABLE_STACKTRACE
+ if (stack_trace_enabled)
+ unwind_tcb_init(tcp);
+#endif
}
static void
#if SUPPORTED_PERSONALITIES > 1
tcp->currpers = current_personality;
#endif
-
-#ifdef ENABLE_STACKTRACE
- if (stack_trace_enabled)
- unwind_tcb_init(tcp);
-#endif
-
nprocs++;
debug_msg("new tcb for pid %d, active tcbs:%d",
tcp->pid, nprocs);
free_tcb_priv_data(tcp);
#ifdef ENABLE_STACKTRACE
- if (stack_trace_enabled) {
+ if (stack_trace_enabled)
unwind_tcb_fin(tcp);
- }
#endif
mmap_cache_delete(tcp, __func__);
set_sighandler(SIGCHLD, SIG_DFL, ¶ms_for_tracee.child_sa);
#ifdef ENABLE_STACKTRACE
- if (stack_trace_enabled) {
- unsigned int tcbi;
-
+ if (stack_trace_enabled)
unwind_init();
- for (tcbi = 0; tcbi < tcbtabsize; ++tcbi) {
- if (!tcbtab[tcbi]->pid)
- continue;
- unwind_tcb_init(tcbtab[tcbi]);
- }
- }
#endif
/* See if they want to run as another user. */
void
unwind_tcb_fin(struct tcb *tcp)
{
+ if (!tcp->unwind_queue)
+ return;
+
queue_print(tcp->unwind_queue);
free(tcp->unwind_queue);
tcp->unwind_queue = NULL;