[gdb] Don't use gdb_stdlog for inferior-events
The test-case gdb.base/foll-vfork.exp contains:
...
if [gdb_debug_enabled] {
untested "debug is enabled"
return 0
}
...
To understand what it does, I disabled this bit and ran with GDB_DEBUG=infrun,
like so:
...
$ cd $build/gdb/testsuite
$ make check GDB_DEBUG=infrun RUNTESTFLAGS=gdb.base/foll-vfork.exp
...
and ran into:
...
(gdb) PASS: gdb.base/foll-vfork.exp: exec: \
vfork parent follow, through step: set follow-fork parent
next^M
33 if (pid == 0) {^M
(gdb) FAIL: gdb.base/foll-vfork.exp: exec: \
vfork parent follow, through step: step
...
The problem is that the test-case expects:
...
(gdb) PASS: gdb.base/foll-vfork.exp: exec: \
vfork parent follow, through step: set follow-fork parent
next^M
[Detaching after vfork from child process 28169]^M
33 if (pid == 0) {^M
(gdb) PASS: gdb.base/foll-vfork.exp: exec: \
vfork parent follow, through step: step
...
but the "Detaching" line has been redirected to
$outputs/gdb.base/foll-vfork/gdb.debug.
I looked at the documentation of "set logging debugredirect [on|off]":
...
By default, GDB debug output will go to both the terminal and the logfile.
Set debugredirect if you want debug output to go only to the log file.
...
and my interpretation of it was that "debug output" did not match the
"messages" description of inferior-events:
...
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.
...
Fix the discrepancy by not using gdb_stdlog for inferior-events.
Update the gdb.base/foll-vfork.exp test-case to not require
gdb_debug_enabled == 0.
Tested on x86_64-linux.
Tested test-case gdb.base/foll-vfork.exp with and without GDB_DEBUG=infrun.