[comp.sys.hp] Child processes and cdb

puglia@cunixf.cc.columbia.edu (Paul Puglia) (07/28/90)

Could someone give me the scoop on what chances have to be made to 
a program which forks children inorder to debug it and the
children under cdb?  

thanks in advance

Paul Puglia
Dept. of Civil Engineering
Columbia University
puglia@cucevx.civil.columbia.edu

steve-t@hpfcso.HP.COM (Steve Taylor) (07/29/90)

/comp.sys.hp/puglia@cunixf.cc.columbia.edu (Paul Puglia)/11:32am Jul 27,1990/
} Could someone give me the scoop on what chances have to be made to a program
} which forks children inorder to debug it and the children under cdb?
----------
I haven't done this, but I have answered some questions about it, so here's
some hints:
1.  If the program just forks, and doesn't exec, you're out of luck.  The
    debugger doesn't like it if two processes are running on the same object
    (you'll get "bad access to child process" on the original program).
2.  If the child and parent would normally be running the same object, but
    the child will be exec'ed, make a second copy of the object file and use
    it when you exec the child.
3.  You'll need two debugger sessions, so it helps to be running Xwindows or
    to have two terminals or some such.
4.  Use the second debugger session to adopt the child process using the -P
    option.
This may not be everything you need to know, but I hope it will be enough to
get you started.				Regards, Steve taylor

NOT A STATEMENT, OFFICIAL OR OTHERWISE, OF THE HEWLETT-PACKARD COMPANY.