From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101756 invoked by alias); 8 Jun 2015 02:39:28 -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 101747 invoked by uid 89); 8 Jun 2015 02:39:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 08 Jun 2015 02:39:26 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D6D513582D5; Mon, 8 Jun 2015 02:39:24 +0000 (UTC) Received: from localhost (unused-10-15-17-126.yyz.redhat.com [10.15.17.126]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t582dNLM032079 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Sun, 7 Jun 2015 22:39:23 -0400 From: Sergio Durigan Junior To: Jan Kratochvil Cc: gdb-patches@sourceware.org, Aleksandar Ristovski Subject: Re: [PATCH v6 03/10] Code cleanup: Rename enum -> enum filterflags References: <20150607200422.8918.48900.stgit@host1.jankratochvil.net> <20150607200447.8918.31723.stgit@host1.jankratochvil.net> X-URL: http://blog.sergiodj.net Date: Mon, 08 Jun 2015 02:39:00 -0000 In-Reply-To: <20150607200447.8918.31723.stgit@host1.jankratochvil.net> (Jan Kratochvil's message of "Sun, 07 Jun 2015 22:04:47 +0200") Message-ID: <87r3pm53fu.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00107.txt.bz2 On Sunday, June 07 2015, Jan Kratochvil wrote: > Hi Sergio, > > this is an unrelated cleanup, bit mask ints are better to make enums as GDB > already has support to automatically decode them: > > before this patch: > (gdb) p filterflags > $1 = 51 > (gdb) p/x filterflags > $2 = 0x33 > > after this patch: > (gdb) p filterflags > $1 = (COREFILTER_ANON_PRIVATE | COREFILTER_ANON_SHARED | COREFILTER_ELF_HEADERS | COREFILTER_HUGETLB_PRIVATE) > > New patch, not yet reviewed before. Hello Jan, Thanks for the patch. I agree with it, of course. > gdb/ChangeLog > 2015-06-07 Jan Kratochvil > > * linux-tdep.c (enum filterflags): Make it from anonymous enum. > (dump_mapping_p): Use it for parameter filterflags. > (linux_find_memory_regions_full): Use it for variable filterflags. > --- > gdb/linux-tdep.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c > index 8ce2f34..b0981f5 100644 > --- a/gdb/linux-tdep.c > +++ b/gdb/linux-tdep.c > @@ -46,7 +46,7 @@ > Documentation/filesystems/proc.txt, inside the Linux kernel > tree. */ > > -enum > +enum filterflags > { > COREFILTER_ANON_PRIVATE = 1 << 0, > COREFILTER_ANON_SHARED = 1 << 1, > @@ -598,7 +598,7 @@ mapping_is_anonymous_p (const char *filename) > This should work OK enough, however. */ > > static int > -dump_mapping_p (unsigned int filterflags, const struct smaps_vmflags *v, > +dump_mapping_p (enum filterflags filterflags, const struct smaps_vmflags *v, > int maybe_private_p, int mapping_anon_p, int mapping_file_p, > const char *filename) > { > @@ -1119,10 +1119,10 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch, > /* Default dump behavior of coredump_filter (0x33), according to > Documentation/filesystems/proc.txt from the Linux kernel > tree. */ > - unsigned int filterflags = (COREFILTER_ANON_PRIVATE > - | COREFILTER_ANON_SHARED > - | COREFILTER_ELF_HEADERS > - | COREFILTER_HUGETLB_PRIVATE); > + enum filterflags filterflags = (COREFILTER_ANON_PRIVATE > + | COREFILTER_ANON_SHARED > + | COREFILTER_ELF_HEADERS > + | COREFILTER_HUGETLB_PRIVATE); > > /* We need to know the real target PID to access /proc. */ > if (current_inferior ()->fake_pid_p) -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/