From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83297 invoked by alias); 17 Feb 2020 19:02:09 -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 83280 invoked by uid 89); 17 Feb 2020 19:02:08 -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=HContent-Transfer-Encoding:8bit 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; Mon, 17 Feb 2020 19:02:07 +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 DFC161E092; Mon, 17 Feb 2020 14:02:05 -0500 (EST) Subject: Re: [PATCH 5/5] gdb: change print format of flag enums with value 0 To: Luis Machado , Simon Marchi , gdb-patches@sourceware.org References: <20200213203035.30157-1-simon.marchi@efficios.com> <20200213203035.30157-5-simon.marchi@efficios.com> From: Simon Marchi Message-ID: Date: Mon, 17 Feb 2020 19:02: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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2020-02/txt/msg00690.txt.bz2 On 2020-02-17 7:08 a.m., Luis Machado wrote: > On 2/13/20 5:30 PM, Simon Marchi wrote: >> If a flag enum has value 0 and the enumeration type does not have an >> enumerator with value 0, we currently print: >> >>    $1 = (unknown: 0x0) >> >> I don't like the display of "unknown" here, since for flags, 0 is a >> an expected value.  It just means that no flags are set.  This patch >> makes it so that we print it as a simple 0 in this situation: > > Should we print "no flags set" alongside the 0 for this case then? I don't know, I think that 0 is the natural and standard thing to print here. If you had a flags variable in your code, you'd initialize it with my_flags = 0; So if GDB prints that, I think it's clear. Simon