I'm not sure I understand the question, but you can attach to a live process with gdb.
FOR EXAMPLE:
1. You think the program is hanging - you don't know where, but you can see it "get stuck".
2. You compile the program with "-g" (permitting debugging), and let it run (normally, outside the debugger or in - it doesn't matter)
3. When it hangs...
4. You do:
a) ps -eaf|grep MYPROG
<= GET THE PID
b) gdb MYPROG MYPID
<= ATTACH TO THE LIVE PROCESS AND DEBUG
'Hope that helps .. PSM
|