Get rid of TCB_ATTACH_DONE

* defs.h: Remove TCB_ATTACH_DONE constant.
* strace.c (startup_attach): Use TCB_STARTUP instead of TCB_ATTACH_DONE
to distinquish attached from not-yet-attached threads.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
This commit is contained in:
Denys Vlasenko 2011-09-05 14:01:33 +02:00
parent 381dbc2292
commit d116a73386
2 changed files with 6 additions and 19 deletions

3
defs.h
View File

@ -458,9 +458,6 @@ struct tcb {
*/
#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 */

View File

@ -444,13 +444,11 @@ startup_attach(void)
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);
@ -493,7 +491,7 @@ startup_attach(void)
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) {
@ -548,14 +546,6 @@ startup_attach(void)
} /* 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);
}