Daemon process debugger
I have wrote a daemon program.Then I tried to debug it using ddd and gdb debuggers.But when the parent is exit its process the debugger stops its job.From that I understood that we can't debug a daemon program using ddd and gdb.CAn any one help me to debug the daemon program.
What is the "parent" you are referring to? How exactly are you invoking the debugger?
Originally Posted by karthigayan
When a daemon() call is done, what actually happens is fork(), after which the parent calls _exit() leaving the child to be running. (simplified). So unless you tell your debugger to "trace children" (see gdb's man page), it will quit when the process it was first attached to exits. Another option is to start the daemon without debugger, and after the parent has exited, you can attach the gdb to running children. (again, see gdb's man page).