From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97080 invoked by alias); 16 Sep 2019 00:22:13 -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 97071 invoked by uid 89); 16 Sep 2019 00:22:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-30.6 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy= X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Sep 2019 00:22:12 +0000 Received: by mail-ot1-f67.google.com with SMTP id g19so34062708otg.13 for ; Sun, 15 Sep 2019 17:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p24gZ5DWZgyhjQLvE+nlInoQ3I0Q7GK9UsSh4KiJI1w=; b=EbP8EzHpXjhKlcbHY8/kOk5uiiXdIGYD58wN64kHGaGET8SUU7o/rcCydleHJK32Rf 7p5c7IQvHSiAMBrZwS4aO+3/qDFkifa2/J0OkrhXM7HOLfGvhG3aDY90eqv6Gv3K4fyv TdMEjHIfrLEbGYvX1ONq27F4qoLDmxm/twboMgS6WIPNG1wve6ARx8NS7Aaabfb2LRsd wrh8NySx87jZA9QHxbrU7mxK0Q/Otk9FOCgKmYPO468/Zh9rYEKivAmTV5uhxXNQwhXz c5JYIeJgvTzfVxglWhcojEZuOh9XEEtII5sKYgPRBBfrZf2BsaDuy4ZqWFFpeVzvSKHy nt5w== MIME-Version: 1.0 References: <20190915083353.33228-1-cbiesinger@google.com> In-Reply-To: From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Mon, 16 Sep 2019 00:22:00 -0000 Message-ID: Subject: Re: [RFC] Change boolean options to bool instead of int To: Simon Marchi Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00276.txt.bz2 On Mon, Sep 16, 2019 at 8:10 AM Simon Marchi wrote: > > 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. Thanks. > 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 Oh.. thanks, will fix. > 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. Yeah, but I'll still have to manually fill in the variable names in the change log :/ > 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" Thanks, will fix. Christian