[PATCH] Try to use PTRACE_SETOPTIONS to handle non-ptrace SIGTRAP

Andreas Schwab schwab at redhat.com
Mon Mar 8 12:19:50 UTC 2010


Roland McGrath <roland at redhat.com> writes:

>> > If you trace an execve, you're going to get its syscall exit stop
>> > before you get its old-style traced-exec SIGTRAP.
>> 
>> No, you don't.
>
> How did you come to that conclusion?

Reality check.

Breakpoint 1, is_ptrace_stop (tcp=0x661030, status=34175)
    at ../strace/strace.c:2282
2282            if (!(tcp->flags & TCB_PTRACE_OPTIONS))
(gdb) c
Continuing.
execve("/bin/echo", ["echo"], [/* 79 vars */]
Breakpoint 1, is_ptrace_stop (tcp=0x661030, status=263551)
    at ../strace/strace.c:2282
2282            if (!(tcp->flags & TCB_PTRACE_OPTIONS))
(gdb) 
Continuing.

Breakpoint 1, is_ptrace_stop (tcp=0x661030, status=34175)
    at ../strace/strace.c:2282
2282            if (!(tcp->flags & TCB_PTRACE_OPTIONS))
(gdb) 
Continuing.
) = 0

Andreas.

-- 
Andreas Schwab, schwab at redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."




More information about the Strace-devel mailing list