I'm developing an application which the parent forks a child to handle certain tasks. I'm having an issue where I've configured gdb to follow-fork-mode child but after fork, after reaching a breakpoint, it sends a SIGTRAP but the child somehow terminates and send SIGCHLD to the parent.
I've configured signal(SIGTRAP, SIG_IGN)
before fork so my understanding is that the child should inherit and ignore SIGTRAP when the breakpoint is reached but it's not happening.
Please help me to understand this if I'm incorrect.
How can I successfully debug the child process?
question from:https://stackoverflow.com/questions/15126925/debugging-child-process-after-fork-follow-fork-mode-child-configured