From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109670 invoked by alias); 6 Oct 2016 14:44:59 -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 109619 invoked by uid 89); 6 Oct 2016 14:44:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=vip, VIP, presentation, hacked X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 06 Oct 2016 14:44:57 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D5574A1F49; Thu, 6 Oct 2016 14:44:55 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u96EiqgG028884; Thu, 6 Oct 2016 10:44:53 -0400 Subject: Re: [PATCH 4/5]: Enhancements to "flags": i386 cleanup To: Anton Kolesov , Doug Evans 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> Cc: gdb-patches , Wei-cheng Wang From: Pedro Alves Message-ID: <63d3eb0a-f0c6-e85d-6889-ce2aae6d1054@redhat.com> Date: Thu, 06 Oct 2016 14:44:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <39A54937CC95F24AA2F794E2D2B66B13581BF837@DE02WEMBXB.internal.synopsys.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-10/txt/msg00123.txt.bz2 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. 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. Sorry for all my confusions. I'll go close the PR, and unblock 7.12! Thanks, Pedro Alves