From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 81169 invoked by alias); 17 Feb 2020 18:59:42 -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 81161 invoked by uid 89); 17 Feb 2020 18:59:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 18:59:41 +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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 460791E092; Mon, 17 Feb 2020 13:59:39 -0500 (EST) Subject: Re: [PATCH 4/5] gdb: print unknown part of flag enum in hex To: Luis Machado , Simon Marchi , gdb-patches@sourceware.org References: <20200213203035.30157-1-simon.marchi@efficios.com> <20200213203035.30157-4-simon.marchi@efficios.com> <801f3b0d-d452-101f-7f12-b5d0299a0307@linaro.org> From: Simon Marchi Message-ID: Date: Mon, 17 Feb 2020 18:59: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: <801f3b0d-d452-101f-7f12-b5d0299a0307@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2020-02/txt/msg00689.txt.bz2 On 2020-02-17 6:04 a.m., Luis Machado wrote: > On 2/13/20 5:30 PM, Simon Marchi wrote: >> When we print the "unknown" part of a flag enum, it is printed in >> decimal.  I think it would be more useful if it was printed in hex, as >> it helps to determine which bits are set more than a decimal value. >> > > Would it be better to mention the offending bit position explicitly? The hex value could be displayed along with it as well. > > I mean, in both decimal and hex you'd need to do some calculations to figure out the bit position anyway. Might as well make it easier for developers by displaying the information. It's much easier to convert between hex and bit positions than decimal and bit positions, so I wouldn't put decimal and hex on the same level here. Also, there could be many bits that are set and unknown, so if we mention them explicitly, it could take a lot of space and become actually less readable. I think that the hex notation is the most convenient, it's compact and people are used to converting between hex and binary on the spot. Simon