Getting this message inside gdb. I know its not an error or anything. I also did pagination so thats not an issue.
Is there any way to suppress this message?
When you have finished debugging the attached process, you can use the detach command to release it from GDB control. Detaching the process continues its execution. After the detach command, that process and GDB become completely independent once more, and you are ready to attach another process or start one with run .
By default, when a program forks, GDB will continue to debug the parent process and the child process will run unimpeded. If you want to follow the child process instead of the parent process, use the command set follow-fork-mode . Set the debugger response to a program call of fork or vfork .
Controls the behavior of GDB when the debugged program calls fork() or vfork()
There is an alternative way of debugging the child process. After fork() is executed, put a sleep() call in the code where the child executes, get the PID of the child using the ps utility, then attach the PID. Now, you can debug the child process, like any other process.
I was curious to see that this question was unanswered...
I obtained the GDB manual, and it says (in part - p33 of the PDF 'Ninth Edition, for gdb version 7.0.50.20091228'):
To be notified when inferiors are started or exit under gdb’s control use
set print inferior-events
:set print inferior-events set print inferior-events on set print inferior-events off
The
set print inferior-events
command allows you to enable or disable printing of messages when gdb notices that new inferiors have started or that inferiors have exited or have been detached. By default, these messages will not be printed.show print inferior-events
Show whether messages will be printed when gdb detects that inferiors have started, exited or have been detached.
The only concern I have about this is that it implies that you should not be seeing the messages by default. Just make sure that your settings match the default and do not override them.
Section 4.11 'Debugging Forks' (pp38-40) looks relevant to you, too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With