]> granicus.if.org Git - strace/commitdiff
* defs.h, syscall.c: explain why x86 does not need TCB_WAITEXECVE trick,
authorDenys Vlasenko <dvlasenk@redhat.com>
Fri, 2 Jan 2009 18:02:45 +0000 (18:02 +0000)
committerDenys Vlasenko <dvlasenk@redhat.com>
Fri, 2 Jan 2009 18:02:45 +0000 (18:02 +0000)
and what syscall_fixup() is expected to do. Comments only, no code changes.

defs.h
syscall.c

diff --git a/defs.h b/defs.h
index 4d4a78c889c13602fc67c0147e3b0ac395ca541d..e3cd93d0bb86a8e9c04c69f8aa8569496c4c41a0 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -360,6 +360,10 @@ struct tcb {
 #define TCB_FOLLOWFORK 00400   /* Process should have forks followed */
 #define TCB_REPRINT    01000   /* We should reprint this syscall on exit */
 #ifdef LINUX
+/* x86 does not need TCB_WAITEXECVE.
+ * It can detect execve's SIGTRAP by looking at eax/rax.
+ * See "stray syscall exit: eax = " message in syscall_fixup().
+ */
 # if defined(ALPHA) || defined(SPARC) || defined(SPARC64) || defined(POWERPC) || defined(IA64) || defined(HPPA) || defined(SH) || defined(SH64) || defined(S390) || defined(S390X) || defined(ARM) || defined(MIPS) || defined(BFIN)
 #  define TCB_WAITEXECVE 02000 /* ignore SIGTRAP after exceve */
 # endif
index 19f8fe9f74f14fdde6291efef73afb2c37c21552..273b3c801d108a3e988ef97a20065d6d2e97eac6 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -1335,6 +1335,13 @@ struct tcb *tcp;
        return scno;
 }
 
+/* Called in trace_syscall() at each syscall entry and exit.
+ * Returns:
+ * 0: "ignore this syscall", bail out of trace_syscall() silently.
+ * 1: ok, continue in trace_syscall().
+ * other: error, trace_syscall() should print error indicator
+ *    ("????" etc) and bail out.
+ */
 static int
 syscall_fixup(tcp)
 struct tcb *tcp;