From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44364 invoked by alias); 6 Oct 2016 18:43:29 -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 44351 invoked by uid 89); 6 Oct 2016 18:43:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=consequence, quo, Another, vip X-HELO: mail-wm0-f49.google.com Received: from mail-wm0-f49.google.com (HELO mail-wm0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Oct 2016 18:43:27 +0000 Received: by mail-wm0-f49.google.com with SMTP id k125so344032299wma.1 for ; Thu, 06 Oct 2016 11:43:26 -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=q5DFce0Y+SNUTdnkY8yDGC/mdYF+OeS6/dEDJ+yIp4c=; b=GZFrAn6yh0le5r/tVCpdfYlQvtrohqJ70NSScfY1Zt3BV5swNcfMrKw2jxNqKFgU2K pbMhloIm3ATG3hW13rKk1ybLLm1HUMLd8UvHUOF2dK2cw72al6D8EORtzgOLx//H5+yQ XUIPrhfCOVmjoAUrWeCuYwDMtcoIF297ho9gDHq228WepPDQyI3useXcTtX2WSIGwwA3 Iq3LeWW0B1Ay1tpmXKkzwcwbWk+oPxEsZ70i8trfGYepvyskY5MKOLVW00RklcxZTcPc eymu3M3eZzdNBxDq42HRuCtJco4nxVAOENbQHP8rzrsr9nDxzFmmL+tVLivBCEy3aWVt w/XA== X-Gm-Message-State: AA6/9Rkban1FXXiEf1+xAOgl/3i8ttcWTbm7QKys+ZRfTWgjKPV2uDdbBtgIbxzxrwGgW3SQeJ8GLerISPI0jhJt X-Received: by 10.194.248.226 with SMTP id yp2mr13115496wjc.117.1475779404971; Thu, 06 Oct 2016 11:43:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.18.15 with HTTP; Thu, 6 Oct 2016 11:42:44 -0700 (PDT) In-Reply-To: <63d3eb0a-f0c6-e85d-6889-ce2aae6d1054@redhat.com> 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> <39A54937CC95F24AA2F794E2D2B66B13581BF837@DE02WEMBXB.internal.synopsys.com> <63d3eb0a-f0c6-e85d-6889-ce2aae6d1054@redhat.com> From: Doug Evans Date: Thu, 06 Oct 2016 18:43:00 -0000 Message-ID: Subject: Re: [PATCH 4/5]: Enhancements to "flags": i386 cleanup To: Pedro Alves Cc: Anton Kolesov , gdb-patches , Wei-cheng Wang Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00147.txt.bz2 On Thu, Oct 6, 2016 at 7:44 AM, Pedro Alves wrote: > > On 10/06/2016 02:44 PM, Anton Kolesov wrote: > > Hi Pedro, > > > >> > >> Note how that left several flags with 2-bit and/or 4-bit > >> long bitfields: > >> > >> tdesc_add_bitfield (type, "E", 1, 2); > >> tdesc_add_bitfield (type, "A", 3, 4); > >> ... > >> tdesc_add_bitfield (type, "E", 1, 4); > >> > >> which I understand means these two fields will > >> be given uint32_t type instead of bool? What does this > >> mean in practice? E.g,. for "A", what do we print when both > >> bits 3 and 4 are clear? What do we print if one > >> of the bits is set and the other is clear? > > > > With regards of ARC flags, if field is longer than one bit, then it should be > > treated as an uint. For example, in arc-v2.c field H means "halt bit", so > > it is a single bit, but E is a "Interrupt priority level", so bits are not > > independent in this field - it is a 4-bit integer number, there is no idea > > of independent "first bit" or "second bit" inside this field. If there would, > > then I'd split it into separate fields bits. So it should be printed something > > like "[ H E=1 AE ]" - bits printed only when they are set, uint fields are > > printed as "name=value", though I'm not sure if it should be printed if value > > is 0. At least that is what are my expectations of how "flags" register should > > be presented. > > Thanks. Looks like EL on aarch64 is similar. It's an exception > level, I believe. Correct. This field is actually what prompted me to want to improve on the status quo. > > > To confirm what happens with uint bitfields within flags, I hacked > my local x86-64 GDB with: > > --- c/gdb/features/i386/64bit-core.xml > +++ w/gdb/features/i386/64bit-core.xml > @@ -10,8 +10,7 @@ > > > > - > - > + > > > > > and (after regenerating the gdb/feature/ .c files.), I see: > > (gdb) p $eflags = 0 > $1 = [ PF=0 ] > (gdb) p $eflags = 0xffffffff > $2 = [ CF PF=7 ZF SF TF IF DF OF NT RF VM AC VIF VIP ID ] > > So =0 is always shown for these. Debatable, but that seems > like just a presentation thing. It felt like if the value is a uint, then 0 should be treated no differently so that's what I went with. > Sorry for all my confusions. > I'll go close the PR, and unblock 7.12! Sorry for not getting the patch into master, and thanks for doing so. Another consequence of a distracted summer. Let me know if you need anything more from me.