diff --git a/defs.h b/defs.h index 76ea6197..03cad786 100644 --- a/defs.h +++ b/defs.h @@ -457,7 +457,6 @@ extern void printleader P((struct tcb *)); extern void printtrailer P((struct tcb *)); extern void tabto P((int)); extern void call_summary P((FILE *)); -extern void fake_execve P((struct tcb *, char *, char *[], char *[])); extern void printtv32 P((struct tcb*, long)); extern void tprint_iov P((struct tcb *, int, long)); diff --git a/process.c b/process.c index d28fa476..f1f6701d 100644 --- a/process.c +++ b/process.c @@ -1575,39 +1575,6 @@ struct tcb *tcp; #endif -void -fake_execve(tcp, program, argv, envp) -struct tcb *tcp; -char *program; -char *argv[]; -char *envp[]; -{ - int i; - -#ifdef ARM - if (!(qual_flags[SYS_execve - __NR_SYSCALL_BASE] & QUAL_TRACE)) - return; -#else - if (!(qual_flags[SYS_execve] & QUAL_TRACE)) - return; -#endif /* !ARM */ - printleader(tcp); - tprintf("execve("); - string_quote(program); - tprintf(", ["); - for (i = 0; argv[i] != NULL; i++) { - if (i != 0) - tprintf(", "); - string_quote(argv[i]); - } - for (i = 0; envp[i] != NULL; i++) - ; - tprintf("], [/* %d var%s */]) ", i, (i != 1) ? "s" : ""); - tabto(acolumn); - tprintf("= 0"); - printtrailer(tcp); -} - static void printargv(tcp, addr) struct tcb *tcp; diff --git a/strace.c b/strace.c index de962969..ac83703d 100644 --- a/strace.c +++ b/strace.c @@ -597,6 +597,13 @@ Process %u attached - interrupt to quit\n", } else setreuid(run_uid, run_uid); + + /* + * Induce an immediate stop so that the parent + * will resume us with PTRACE_SYSCALL and display + * this execve call normally. + */ + kill(getpid(), SIGSTOP); #endif /* !USE_PROCFS */ execv(pathname, &argv[optind]); @@ -617,11 +624,6 @@ Process %u attached - interrupt to quit\n", exit(1); } #endif /* USE_PROCFS */ -#ifndef USE_PROCFS - if (!cflag) - fake_execve(tcp, pathname, - &argv[optind], environ); -#endif /* !USE_PROCFS */ break; } }