tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: ptrace(2) PT_STEP changes and gdb



On Tue, 17 Aug 2010, Paul Koning wrote:

> > (3) if the process only has one thread ignore he argument.
> 
> That means the semantics of ptrace can change out from under the program 
> using it.  If it passes an argument to PT_STEP because there are two threads, 
> and one thread exits before the ptrace() call actually runs, then the 
> argument would be ignored producing an unexpected result.

Is that really a problem?  If you are using PT_STEP then presumably the 
thread in question is stopped and can only die if something else sends a 
signal.  If the other threads die then you are still single-stepping the 
thread you thought you would be single-stepping.  If there is only one 
thread then he question about what to do about other threads is moot.

OTOH versioning the interface is probably cleaner over all.

Eduardo


Home | Main Index | Thread Index | Old Index