From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121532 invoked by alias); 15 Sep 2019 23:10:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 121524 invoked by uid 89); 15 Sep 2019 23:10:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=am, H*r:sk:server-, UD:a.m, a.m X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 15 Sep 2019 23:10:14 +0000 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 02C471E478; Sun, 15 Sep 2019 19:10:12 -0400 (EDT) Subject: Re: [RFC] Change boolean options to bool instead of int To: Christian Biesinger , gdb-patches@sourceware.org References: <20190915083353.33228-1-cbiesinger@google.com> From: Simon Marchi Message-ID: Date: Sun, 15 Sep 2019 23:10:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: <20190915083353.33228-1-cbiesinger@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-09/txt/msg00274.txt.bz2 On 2019-09-15 4:33 a.m., Christian Biesinger via gdb-patches wrote: > [Before I write a huge changelog entry for this... would this be acceptable > in principle?] > > This is for add_setshow_boolean_cmd as well as the gdb::option interface. Hi Christian, I don't really see any problem with doing this, it seems like the natural thing to do. There are still some globals that are initialized with 0 or 1 instead of false or true. You can find them with: $ grep 'bool .* = [01];' *.c */*.c To generate a big ChangeLog entry like this, you can try using one of the various scripts that try to generate a ChangeLog entry from a diff, like the one from gcc: https://github.com/gcc-mirror/gcc/blob/master/contrib/mklog It might do half of the job automatically. I opened files at random to get a feel of the patch and happened to notice this: > diff --git a/gdb/command.h b/gdb/command.h > index 2c608048d54..29b99333946 100644 > --- a/gdb/command.h > +++ b/gdb/command.h > @@ -62,8 +62,8 @@ cmd_types; > /* Types of "set" or "show" command. */ > typedef enum var_types > { > - /* "on" or "off". *VAR is an integer which is nonzero for on, > - zero for off. */ > + /* "on" or "off". *VAR is an bool which is true for on, > + false for off. */ "is an bool" -> "is a bool" Simon