From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id BFC11385840E for ; Wed, 24 Nov 2021 10:41:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BFC11385840E Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 840DD21958; Wed, 24 Nov 2021 10:41:41 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6D19813F05; Wed, 24 Nov 2021 10:41:41 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id NMcNGeUWnmHaawAAMHmgww (envelope-from ); Wed, 24 Nov 2021 10:41:41 +0000 Subject: Re: [PATCH] [gdb/cli] Add command: show logging active To: Eli Zaretskii Cc: gdb-patches@sourceware.org References: <20211123114603.6284-1-tdevries@suse.de> <9ab6df29-2990-704c-ea96-6af09d2e9a1e@suse.de> <83a6hvowli.fsf@gnu.org> From: Tom de Vries Message-ID: <3ad1f394-7e34-11bd-0bdf-56e41f6f1bbe@suse.de> Date: Wed, 24 Nov 2021 11:41:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <83a6hvowli.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Nov 2021 10:41:44 -0000 On 11/23/21 2:00 PM, Eli Zaretskii wrote: >> From: Tom de Vries >> 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