public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] [gdb] Don't use gdb_stdlog for inferior-events
Date: Mon, 15 Nov 2021 11:42:18 -0500	[thread overview]
Message-ID: <4e429ee5-2238-51e2-2124-7117e6dcd1da@simark.ca> (raw)
In-Reply-To: <20211115112128.27735-2-tdevries@suse.de>

On 2021-11-15 6:21 a.m., Tom de Vries via Gdb-patches wrote:
> 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

Interesting, I didn't know about that.

> ...
> 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 redirecting inferior-events for debugredirect.
> [ Alternatively, we could update the documentation to clarify that debug
> output also implies inferior-events messsages. ]
>
> 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.

I think the patch is doing the right thing, LGTM.

Simon

  reply	other threads:[~2021-11-15 16:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-15 11:21 [PATCH 1/2] [gdb/testsuite] Disable inferior output in gdb.base/foll-vfork.exp Tom de Vries
2021-11-15 11:21 ` [PATCH 2/2] [gdb] Don't use gdb_stdlog for inferior-events Tom de Vries
2021-11-15 16:42   ` Simon Marchi [this message]
2021-11-15 16:39 ` [PATCH 1/2] [gdb/testsuite] Disable inferior output in gdb.base/foll-vfork.exp Simon Marchi
2021-11-15 22:11   ` Tom de Vries
2021-11-16 15:01     ` Simon Marchi
2021-11-16 15:46       ` Tom de Vries

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4e429ee5-2238-51e2-2124-7117e6dcd1da@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).