Interaction of ptrace(2) and slow system calls

jdd at magic.ARPA jdd at magic.ARPA
Wed Jul 31 17:58:13 AEST 1985


I have a problem with ptrace(2) and and looking for a work-around.  This is
under Ultrix, but I'd bet the code is unchanged from 4.2BSD.

I have a parent ptracing a child.  The child is stopped in a slow system
call, like read(2), and receives a signal, like SIGINT.  The parent gets
control and may decide to let the child continue without a signal.

When the parent looks, the child's PC value is for the instruction after the
chmk.  Something in the user area must say that the system call is
unfinished, because:

 a) After being resumed, the child waits for the system call to complete;
    it does \not/ get an EINTR, much less the original signal.

 b) If the parent changes the child's PC value before restarting it, the
    child still waits for the system call to finish, even though control
    is now somewhere else.

The latter is my problem; I'm building a debugger and I'd like to provide
for procedure call in the child, but I can't transfer control well if the
child is stuck in a slow system call.  I can't even tell if this is the
case, disallowing procedure call if it is.

So, any suggestions?

Cheers,
John ("No Source") DeTreville
DEC SRC, Palo Alto



More information about the Comp.unix.wizards mailing list