strace.c: handle PTRACE_EVENT_EXEC like other events
There is nothing unusual about PTRACE_EVENT_EXEC that would require a special treatment. * strace.c (next_event): Move PTRACE_EVENT_EXEC handling to the main switch statement.
This commit is contained in:
parent
4a1a41cb7e
commit
32cff9dc88
12
strace.c
12
strace.c
@ -2311,8 +2311,6 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
int pid;
|
||||
int wait_errno;
|
||||
int status;
|
||||
unsigned int sig;
|
||||
unsigned int event;
|
||||
struct tcb *tcp;
|
||||
struct rusage ru;
|
||||
|
||||
@ -2382,14 +2380,9 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
|
||||
clear_regs();
|
||||
|
||||
event = (unsigned int) status >> 16;
|
||||
|
||||
/* Set current output file */
|
||||
current_tcp = tcp;
|
||||
|
||||
if (event == PTRACE_EVENT_EXEC)
|
||||
return TE_STOP_BEFORE_EXECVE;
|
||||
|
||||
if (cflag) {
|
||||
tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime);
|
||||
tcp->stime = ru.ru_stime;
|
||||
@ -2411,7 +2404,8 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
if (tcp->flags & TCB_STARTUP)
|
||||
startup_tcb(tcp);
|
||||
|
||||
sig = WSTOPSIG(status);
|
||||
const unsigned int sig = WSTOPSIG(status);
|
||||
const unsigned int event = (unsigned int) status >> 16;
|
||||
|
||||
switch (event) {
|
||||
case 0:
|
||||
@ -2456,6 +2450,8 @@ next_event(int *pstatus, siginfo_t *si)
|
||||
}
|
||||
return TE_RESTART;
|
||||
#endif
|
||||
case PTRACE_EVENT_EXEC:
|
||||
return TE_STOP_BEFORE_EXECVE;
|
||||
case PTRACE_EVENT_EXIT:
|
||||
return TE_STOP_BEFORE_EXIT;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user