Is this correct? ptrace(2) on NCR Tower

Robert Andersson ra at intsys.no
Fri Nov 2 01:39:48 AEST 1990


I stumbled into this problem when porting the GNU debugger, gdb, to the
NCR Tower.  It is a fairly vanilla SYSV machine, running SYSV Release 3,
or as NCR call it, release 3.00.01.  Problem follows:

1. Start a debugger, sdb or adb, doesn't matter which.
2. Run any program that finally blocks on a read(2) on a fd referring
   to the terminal.  For instance this one-liner:
   main() { char buff[50]; gets(buff); puts(buff); }
3. Cause an INT signal, ie. hit ctrl-c or DEL or whatever.

Now we are back in the debugger, as we should be, but look now:

4. Type a debugger command.
5. The debugger doesn't seem to accept the command.
6. Type the debugger command to continue program execution.
7. The stuff typed in 5 actually was actually sent to the debugged
   program!

Is this the way it should be in System V Release 3, or is it an NCR bug?
When a process run under ptrace(2) control is interrupted in this state,
shouldn't it simply stop, and then resume the read later when the
debugger uses ptrace to resume execution?
-- 
Robert Andersson       Voice +47 2 371055       International Systems A/S
ra at intsys.no           Fax   +47 2 356448       P.O. Box 3356
...!{uunet,mcsun,nuug}!intsys.no!ra             0405 Oslo 4, NORWAY



More information about the Comp.unix.questions mailing list