From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id E2A043858439 for ; Thu, 4 Nov 2021 19:19:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E2A043858439 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1A4JJV79021590 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 4 Nov 2021 15:19:36 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1A4JJV79021590 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 25CD71ECEB; Thu, 4 Nov 2021 15:19:31 -0400 (EDT) Message-ID: Date: Thu, 4 Nov 2021 15:19:30 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH 4/5] gdb: add "info index-cache stats", deprecate "show index-cache stats" Content-Language: en-US To: Tom Tromey , Simon Marchi via Gdb-patches Cc: Simon Marchi References: <20211101155009.457224-1-simon.marchi@efficios.com> <20211101155009.457224-5-simon.marchi@efficios.com> <87cznfkbxu.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87cznfkbxu.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 4 Nov 2021 19:19:31 +0000 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, 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: Thu, 04 Nov 2021 19:19:39 -0000 On 2021-11-04 14:33, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi via Gdb-patches writes: > > Simon> The "show index-cache stats" command is used to show some statistics > Simon> about the index-cache usage. I believe this is not a good use of a show > Simon> command, as it is not a setting. > > I think "show" is generally used for any information about the debugger, > not just settings. > > A long, long time ago there was some effort to split 'info' and 'show' > this way. The details of this discussion are long lost, as far as I > know, but the outcome lives on in the help and manual: > > 'info' > This command (abbreviated 'i') is for describing the state of your > program. > > 'show' > In contrast to 'info', 'show' is for describing the state of GDB > itself. You can change most of the things you can 'show', by using [...] > > So I tend to think "show index-cache stats" is more correct. Ah, I didn't know about that, thanks. Then I still wonder what to do about: (gdb) interpreter-exec mi "-gdb-show index-cache" ~"\n" ~" Cache hits (this session): 0\n" ~" Cache misses (this session): 0\n" ~"\n" ~"The index cache is currently disabled.\n" ^done The answer is probably to output those numbers using uiout fields in the command implementation. If I hack that, I get: ... ^done,hits="0",misses="0" which looks good. What's nice about "show" is that we don't need to add a new MI command for everything: -gdb-show just works with any child of the "show" command. It would be nice to have the same thing with info, have an "-info" MI command that works with "info" command children. Of course, these commands would have to be MI-aware (emit information using uiout fields), but that's much easier than adding new MI commands for each. So, I'll drop this patch then, and consider changing the "show index-cache stats" implementation to use uiout fields (although I am not aware of any frontend interested in using the the index-cache stats data). Simon