summaryrefslogtreecommitdiff
path: root/defs.h
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2013-06-26 14:14:29 +0200
committerDenys Vlasenko <dvlasenk@redhat.com>2013-06-26 14:58:03 +0200
commitfadbf6679cb52d4265a771cbb8635a2ff472e869 (patch)
tree16c2426e98cfd815de5bc56bb5ca93a0316caae7 /defs.h
parent1b2bfbc8257231c18dcdd30b8a84eadffbe9417a (diff)
downloadstrace-fadbf6679cb52d4265a771cbb8635a2ff472e869.tar.gz
strace-fadbf6679cb52d4265a771cbb8635a2ff472e869.tar.bz2
strace-fadbf6679cb52d4265a771cbb8635a2ff472e869.tar.xz
Get rid of TCB_INUSE and TCB_STRACE_CHILD
We can use tcb::pid == 0 as an indicator of free tcb, and we already have strace_child variable which holds pid of our child, if any. Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
Diffstat (limited to 'defs.h')
-rw-r--r--defs.h24
1 files changed, 11 insertions, 13 deletions
diff --git a/defs.h b/defs.h
index fbbe48c..1f1602a 100644
--- a/defs.h
+++ b/defs.h
@@ -393,7 +393,7 @@ typedef struct ioctlent {
/* Trace Control Block */
struct tcb {
int flags; /* See below for TCB_ values */
- int pid; /* Process Id of this entry */
+ int pid; /* If 0, this tcb is free */
int qual_flg; /* qual_flags[scno] or DEFAULT_QUAL_FLAGS + RAW */
int u_error; /* Error code */
long scno; /* System call number */
@@ -418,10 +418,9 @@ struct tcb {
};
/* TCB flags */
-#define TCB_INUSE 00001 /* This table entry is in use */
/* We have attached to this process, but did not see it stopping yet */
-#define TCB_STARTUP 00002
-#define TCB_IGNORE_ONE_SIGSTOP 00004 /* Next SIGSTOP is to be ignored */
+#define TCB_STARTUP 0x01
+#define TCB_IGNORE_ONE_SIGSTOP 0x02 /* Next SIGSTOP is to be ignored */
/*
* Are we in system call entry or in syscall exit?
*
@@ -440,14 +439,13 @@ struct tcb {
*
* Use entering(tcp) / exiting(tcp) to check this bit to make code more readable.
*/
-#define TCB_INSYSCALL 00010
-#define TCB_ATTACHED 00020 /* It is attached already */
-/* Are we PROG from "strace PROG [ARGS]" invocation? */
-#define TCB_STRACE_CHILD 0040
-#define TCB_BPTSET 00100 /* "Breakpoint" set after fork(2) */
-#define TCB_REPRINT 00200 /* We should reprint this syscall on exit */
-#define TCB_FILTERED 00400 /* This system call has been filtered out */
-/* x86 does not need TCB_WAITEXECVE.
+#define TCB_INSYSCALL 0x04
+#define TCB_ATTACHED 0x08 /* We attached to it already */
+#define TCB_BPTSET 0x10 /* "Breakpoint" set after fork(2) */
+#define TCB_REPRINT 0x20 /* We should reprint this syscall on exit */
+#define TCB_FILTERED 0x40 /* This system call has been filtered out */
+/*
+ * x86 does not need TCB_WAITEXECVE.
* It can detect post-execve SIGTRAP by looking at eax/rax.
* See "not a syscall entry (eax = %ld)\n" message.
*
@@ -468,7 +466,7 @@ struct tcb {
/* This tracee has entered into execve syscall. Expect post-execve SIGTRAP
* to happen. (When it is detected, tracee is continued and this bit is cleared.)
*/
-# define TCB_WAITEXECVE 01000
+# define TCB_WAITEXECVE 0x80
#endif
/* qualifier flags */