Debugging programs with fork

Mike Hoegeman mh at wlbr.EATON.COM
Tue Oct 4 08:37:14 AEST 1988


In article <12523 at oberon.USC.EDU- pgarg at pollux.usc.edu () writes:
-
- I am having trouble debugging programs which fork other
-processes. Dbx doesn't seem to handle them easily. Is there
-some feature of dbx that I am missing or is there another tool
-which helps in this debugging process?
-

I've had this problem too. If you are debugging the parent somtimes you
have to put a sleep(2) in the child part of the fork so dbx "stays"
with debugging the parent. if you want to debug the child , do
something like put a pause() at the start of the child part of the fork
then attach to the child process with the "debug" feature of dbx (see
dbx man page). once you've attached send a signal with kill(1) to break
it out of the pause ( don't forget to put in a no-op signal catcher in
too).

hope this helps.



More information about the Comp.lang.c mailing list