From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126394 invoked by alias); 18 Feb 2020 20:52:57 -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 126269 invoked by uid 89); 18 Feb 2020 20:52:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 spammy= 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; Tue, 18 Feb 2020 20:52:55 +0000 Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (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 DA11A1E5FA; Tue, 18 Feb 2020 15:52:53 -0500 (EST) Subject: Re: [PATCH 5/5] gdb: change print format of flag enums with value 0 To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <20200213203035.30157-1-simon.marchi@efficios.com> <20200213203035.30157-5-simon.marchi@efficios.com> <87sgj762w5.fsf@tromey.com> From: Simon Marchi Message-ID: <09fc97e9-e4cd-bca1-e03b-5a00bb6e5fd4@simark.ca> Date: Tue, 18 Feb 2020 20:52:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <87sgj762w5.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-02/txt/msg00744.txt.bz2 On 2020-02-18 3:45 p.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> gdb/ChangeLog: > > Simon> * valprint.c (generic_val_print_enum_1): When printing a flag > Simon> enum with value 0 and there is no enumerator with value 0, print > Simon> just "0" instead of "(unknown: 0x0)". > > This looks reasonable. Thanks. > > Simon> /* We have a "flag" enum, so we try to decompose it into > Simon> pieces as appropriate. A flag enum has disjoint > Simon> constants by definition. */ > > I guess this comment is stale now, because an earlier patch changed it > so that identical constants are allowed. Right, I would then change this comment to this in patch 3/5: 634 /* We have a "flag" enum, so we try to decompose it into pieces as 635 appropriate. The enum may have multiple enumerators representing 636 the same bit, in which case we choose to only print the first one 637 we find. */ Simon