From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98935 invoked by alias); 11 Aug 2016 18:18:54 -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 98917 invoked by uid 89); 11 Aug 2016 18:18:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=verbosity, *do*, Hx-languages-length:1950 X-HELO: mail-ua0-f175.google.com Received: from mail-ua0-f175.google.com (HELO mail-ua0-f175.google.com) (209.85.217.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 11 Aug 2016 18:18:52 +0000 Received: by mail-ua0-f175.google.com with SMTP id k90so6140550uak.1 for ; Thu, 11 Aug 2016 11:18:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uaJR2Fq1b0+fp1X/5mpKTm5KXrGcGVg6n0LEm+CY9SM=; b=SrU3ht+DnigIkoEvm63ruD/gS9HIOAjzzknkxzcqBJ6HMM/dOZdXxsKguHSqiTmqpr sb9QCjGr/cidns22TNyKwsYF5U0iyR7ww7CbVn4Mif9OBFT7XLU2WcPCAc2fNIvRCmY9 ySo3KDN5+oVSraV73IUJIRmc01kqa2S6JqDPnXERLfARmzOzpXWldK2EY/iENvYpc+Vw 5G9cuPOfWh2YgLcAb5aup7w9gty6aSkgQKHR8R0TXUgA8iG2HFxxzfRoZKr60gH0T8YE 5p0ILi6cTz+JEYmHFQjhvFyBczsTXvrv7GjCFfPAUl+c5gExX8z7m40ncdr4xPCa5boU Hv7g== X-Gm-Message-State: AEkooutIZ9EjITTtnWhpUcFzxu5PNZRIxY4L+Z7UuzXLesv76mg4nNdrQak/+ptEFBElvq/zWHRp8fJEsDNlEk3b X-Received: by 10.159.36.108 with SMTP id 99mr4481376uaq.79.1470939530620; Thu, 11 Aug 2016 11:18:50 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.141.8 with HTTP; Thu, 11 Aug 2016 11:18:09 -0700 (PDT) In-Reply-To: References: <047d7b5dbb865204bd052cf0bc2b@google.com> <2026a39c-0b53-9142-74ce-091bc73832d8@redhat.com> <7635a6d6-4059-6b23-952c-a88dbfef3b18@redhat.com> <187cd5cc-be8d-3a61-66cd-338ea68a72f8@redhat.com> From: Doug Evans Date: Thu, 11 Aug 2016 18:18:00 -0000 Message-ID: Subject: Re: [PATCH 4/5]: Enhancements to "flags": i386 cleanup To: Pedro Alves Cc: gdb-patches , Wei-cheng Wang Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-08/txt/msg00140.txt.bz2 On Thu, Aug 11, 2016 at 11:10 AM, Pedro Alves wrote: > On 08/09/2016 06:55 PM, Pedro Alves wrote: > >> Thanks! All looks good to me. > > A thought has been running through my mind though. > > Is the "type" attribute used for anything in elements? > Does changing the type of a flag bitfield have any user-visible > effect at all? I.e., does a 1-bit uint32_t bitfield flag > print differently from a bool bitfield flag? There may be some simplification possible, but note that bools do print differently: if false we don't print the field at all. [digression: I'm not sure it's possible today, but while I understand the desire to avoid the extra verbosity if we always printed false fields, there are times when I *do* want the field printed even if false] > > Wondering if we could remove the bool-special case, because > before 8151645076ce927e0ee866c598a19f192e68e103, we used to say, > for : > > There are two forms of the @samp{} > element; a @samp{} element must either contain only bitfields > or contain no bitfields. If the structure contains only bitfields, > its total size in bytes must be specified, each bitfield must have an > explicit start and end, and bitfields are automatically assigned an > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > integer type. The field's @var{start} should be less than or > ^^^^^^^^^^^^ > equal to its @var{end}, and zero represents the least significant bit. > > And for flags, we used to say: > > @cindex > If a register's value is a series of single-bit flags, define it with > a flags type. The @samp{} element has an explicit @var{size} > and contains one or more @samp{} elements. Each field has a > @var{name}, a @var{start}, and an @var{end}. Only single-bit flags > are supported. > > I think I may be very confused by this all, though. > > Thanks, > Pedro Alves >