From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24804 invoked by alias); 9 Oct 2013 12:01: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 24728 invoked by uid 89); 9 Oct 2013 12:01:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Oct 2013 12:01:28 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 09 Oct 2013 04:58:13 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 09 Oct 2013 05:01:24 -0700 Received: from ulslx001.iul.intel.com (ulslx001.iul.intel.com [172.28.207.63]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id r99C1NAI011870; Wed, 9 Oct 2013 13:01:23 +0100 Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r99C1NCS004151; Wed, 9 Oct 2013 14:01:23 +0200 Received: (from wtedesch@localhost) by ulslx001.iul.intel.com with id r99C1NXu004147; Wed, 9 Oct 2013 14:01:23 +0200 From: Walfred Tedeschi To: tromey@redhat.com, mark.kettenis@xs4all.nl Cc: gdb-patches@sourceware.org, Walfred Tedeschi Subject: [PATCH V7 1/8] Fix conditions in creating a bitfield. Date: Wed, 09 Oct 2013 12:01:00 -0000 Message-Id: <1381320034-4092-2-git-send-email-walfred.tedeschi@intel.com> In-Reply-To: <1381320034-4092-1-git-send-email-walfred.tedeschi@intel.com> References: <1381320034-4092-1-git-send-email-walfred.tedeschi@intel.com> X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00261.txt.bz2 Bitfields are represented by intervals [start, begin]. It means that for an interval comprised by only one bit start and end will be equal. The present condition does not always hold. On the other hand in target-description.c (tdesc_gdb_type) bitfield is created when "f->type" is null. The routine maint_print_maint_print_c_tdesc_cmd is modified to follow the same strategy. 2013-07-31 Walfred Tedeschi * target-descriptions.c (maint_print_maint_print_c_tdesc_cmd): Modified logic of creating a bitfield to be in sync with tdesc_gdb_type. testsuite/ * gdb.xml/maint_print_struct.xml (bitfield): Added bitfield having start and end equal 0. --- gdb/target-descriptions.c | 2 +- gdb/testsuite/gdb.xml/maint_print_struct.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 44ad401..1410c02 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -1762,7 +1762,7 @@ feature = tdesc_create_feature (result, \"%s\");\n", /* Going first for implicitly sized types, else part handles bitfields. As reported on xml-tdesc.c implicitly sized types cannot contain a bitfield. */ - if (f->start == 0 && f->end == 0) + if (f->type != NULL) { printf_unfiltered (" field_type = tdesc_named_type (feature, \"%s\");\n", diff --git a/gdb/testsuite/gdb.xml/maint_print_struct.xml b/gdb/testsuite/gdb.xml/maint_print_struct.xml index 5ef0683..deac300 100644 --- a/gdb/testsuite/gdb.xml/maint_print_struct.xml +++ b/gdb/testsuite/gdb.xml/maint_print_struct.xml @@ -15,6 +15,7 @@ + -- 1.7.10.4