From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 52BAF385B835 for ; Fri, 17 Apr 2020 21:02:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 52BAF385B835 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (unknown [192.222.164.54]) (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 B917A1E827; Fri, 17 Apr 2020 17:02:37 -0400 (EDT) Subject: Re: [PATCH] Replace most calls to help_list and cmd_show_list To: Tom Tromey , gdb-patches@sourceware.org References: <20200417132940.3978-1-tromey@adacore.com> From: Simon Marchi Message-ID: <4eba2611-ddaf-6f70-9b5d-15b12e455ee5@simark.ca> Date: Fri, 17 Apr 2020 17:02:37 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200417132940.3978-1-tromey@adacore.com> Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 17 Apr 2020 21:02:39 -0000 On 2020-04-17 9:29 a.m., Tom Tromey wrote: > Currently there are many prefix commands that do nothing but call > either help_list or cmd_show_list. I happened to notice that one such > call, for "set print type", used the wrong command list parameter, > causing incorrect output. > > Rather than fix this bug in isolation, I decided to eliminate this > possibility by adding two new ways to add prefix commands, which > simply route the call to help_list or cmd_show_list, as appropriate. > This makes it impossible for a mismatch to occur. > > In some cases, a bit of output was remove; however, I don't think this removed > output in general was very useful. It seemed redundant with what's > already printed by help_list. Could you mention here an example of command for which the output changed? > > This simplified the CLI style set/show commands quite a bit, and > allowed the deletion of a macro. > > This also cleans up some unusual code in windows-tdep.c. > > Tested on x86-64 Fedora 30. Note that I have no way to build the > go32-nat.c change. I did not read it all, but I glanced at some files. It removes a lot of duplicated code and boilerplate, and therefore chances of inconsistencies, which is nice. Simon