*/
#define TCB_INSYSCALL 00004
#define TCB_ATTACHED 00010 /* Process is not our own child */
-#ifdef LINUX
-#define TCB_ATTACH_DONE 00020 /* PTRACE_ATTACH was done on this tcb->pid */
-#endif
#define TCB_BPTSET 00100 /* "Breakpoint" set after fork(2) */
#define TCB_SIGTRAPPED 00200 /* Process wanted to block SIGTRAP */
#define TCB_REPRINT 01000 /* We should reprint this syscall on exit */
for (tcbi = 0; tcbi < tcbtabsize; tcbi++) {
tcp = tcbtab[tcbi];
- if (!(tcp->flags & TCB_INUSE) || !(tcp->flags & TCB_ATTACHED))
- continue;
-#ifdef LINUX
- if (tcp->flags & TCB_ATTACH_DONE)
- continue;
-#endif
- /* Reinitialize the output since it may have changed. */
+ /* Is this a process we should attach to, but not yet attached? */
+ if ((tcp->flags & (TCB_ATTACHED | TCB_STARTUP)) != TCB_ATTACHED)
+ continue; /* no */
+
+ /* Reinitialize the output since it may have changed */
tcp->outf = outf;
newoutf(tcp);
cur_tcp = tcp;
if (tid != tcp->pid)
cur_tcp = alloctcb(tid);
- cur_tcp->flags |= TCB_ATTACHED|TCB_ATTACH_DONE|TCB_STARTUP;
+ cur_tcp->flags |= TCB_ATTACHED | TCB_STARTUP;
}
closedir(dir);
if (interactive) {
} /* for each tcbtab[] */
ret:
-#ifdef LINUX
- /* TCB_ATTACH_DONE flag is used only in this function */
- for (tcbi = 0; tcbi < tcbtabsize; tcbi++) {
- tcp = tcbtab[tcbi];
- tcp->flags &= ~TCB_ATTACH_DONE;
- }
-#endif
-
if (interactive)
sigprocmask(SIG_SETMASK, &empty_set, NULL);
}