public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/cli] Add command: show logging active
Date: Wed, 24 Nov 2021 11:41:41 +0100	[thread overview]
Message-ID: <3ad1f394-7e34-11bd-0bdf-56e41f6f1bbe@suse.de> (raw)
In-Reply-To: <83a6hvowli.fsf@gnu.org>

On 11/23/21 2:00 PM, Eli Zaretskii wrote:
>> From: Tom de Vries <tdevries@suse.de>
>> Date: Tue, 23 Nov 2021 12:49:34 +0100
>>
>>> Currently, there's no gdb command that shows whether logging is enabled or
>>> disabled.
>>>
>>> There's the show logging command, but output is identical in both cases.
>>> With logging disabled, we have:
>>> ...
>>> (gdb) set logging off
>>> (gdb) show logging
>>> logging debugredirect:  The logging output mode is off.
>>> logging file:  The current logfile is "gdb.txt".
>>> logging overwrite: \
>>>   Whether logging overwrites or appends to the log file is off.
>>> logging redirect:  The logging output mode is off.
>>> ...
>>> and with logging enabled we have:
>>> ...
>>> (gdb) set logging on
>>> Copying output to gdb.txt.
>>> Copying debug output to gdb.txt.
>>> (gdb) show logging
>>> logging debugredirect:  The logging output mode is off.
>>> logging file:  The current logfile is "gdb.txt".
>>> logging overwrite: \
>>>   Whether logging overwrites or appends to the log file is off.
>>> logging redirect:  The logging output mode is off.
>>> ...
>>>
>>> Add a "show logging active" command, such that we have:
>>> ...
>>> (gdb) show logging
>>> logging active:  Logging is disabled.
>>> logging debugredirect:  The logging output mode is off.
>>> logging file:  The current logfile is "gdb.txt".
>>> logging overwrite: \
>>>   Whether logging overwrites or appends to the log file is off.
>>> logging redirect:  The logging output mode is off.
>>> ...
> 
> Isn't the current behavior a bug that should be fixed, instead of
> introducing a new command?  Or what am I missing?
> 

Well, AFAIU the bug is that we can't see whether logging is enabled or
not, and adding the new command fixes that bug.

Normally, a command "set logging on/off" would have a counterpart "show
logging" that shows the effects of the command, but in this case "show
logging" shows the status of the subcommands only.

In the latest version, this is fixed by deprecating "set logging on/off"
and replacing it with "set logging enabled on/off", which does have a
direct show counterpart.

I hope this answers you question.

> The documentation part is OK, assuming that we do want a new
> sub-command.

Thanks for the review.  Could you also review the new version here (
https://sourceware.org/pipermail/gdb-patches/2021-November/183749.html ) ?

Thanks,
- Tom

  reply	other threads:[~2021-11-24 10:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 11:46 [pushed] " Tom de Vries
2021-11-23 11:49 ` [PATCH] " Tom de Vries
2021-11-23 12:30   ` Lancelot SIX
2021-11-24 10:31     ` Tom de Vries
2021-11-23 13:00   ` Eli Zaretskii
2021-11-24 10:41     ` Tom de Vries [this message]
2021-11-24 13:03       ` Eli Zaretskii
2021-11-23 13:30   ` Simon Marchi
2021-11-24 11:06     ` Tom de Vries
2021-11-23 12:49 ` [pushed] " Luis Machado
2021-11-23 12:56   ` Luis Machado
2021-11-24 10:32     ` 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=3ad1f394-7e34-11bd-0bdf-56e41f6f1bbe@suse.de \
    --to=tdevries@suse.de \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /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).