gdb detaching after fork from child process - disable?
Getting this message inside gdb. I know its not an error or anyt开发者_开发百科hing. I also did pagination so thats not an issue.
Is there any way to suppress this message?
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.
I tried set print inferior-events off
, but it didn't disable the message. Actually, print inferior-events
was already off even before I tried to turn it off.
I looked through the gdb
source code, and found that print inferior-events
controls printing of the messages "[New inferior %d]"
, "[Inferior %d exited]"
, and "[Inferior %d detached]"
only.
The message Detaching after fork from child process
is controlled by the verbose
and debug lin-lwp
options, instead. However, on Fedora systems the message is always printed because they have a patch (namely gdb-6.6-bz235197-fork-detach-info.patch
) that turns
if (info_verbose || debug_linux_nat)
into
if (1 /* Fedora Bug 235197 */ || info_verbose || debug_linux_nat)
. So you can never turn it off, unless you remove the patch from the source and compile it again.
精彩评论