Skip to contentSkip to conversation

Fork vs GDB

DISCUSSION Julien Laganier 2 participants 2 messages Jun 25, 2001 – Jun 26, 2001

lore
Share & tools
lore
#0 lore raw

Greetings,

Does anyone knows how to debug a program which fork. It seems that gdb doesn't allow us to debug the child processes without calling 'sleep' in the child, and attach it to gdb (Except on HP-UX, but I choose to use Linux ;-)) ?

Tnx.
--

Julien Laganier
Student Intern
Sun Microsystem Laboratories

#1 lore raw
Quoted 8 lines · Julien Laganier

Greetings,

Does anyone knows how to debug a program which fork. It seems that gdb doesn't allow us to debug the child processes without calling 'sleep' in the child, and attach it to gdb (Except on HP-UX, but I choose to use Linux ;-)) ?

Tnx.

Julien,

I had this question awhile back. Your solution with sleep is the only option, unless you wish to add support for another method.

- N