From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23704 invoked by alias); 30 Aug 2013 09:58:22 -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 23668 invoked by uid 89); 30 Aug 2013 09:58:22 -0000 Received: from mga02.intel.com (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 30 Aug 2013 09:58:22 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2 X-HELO: mga02.intel.com Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 30 Aug 2013 02:58:20 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 30 Aug 2013 02:58:19 -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 r7U9wIds014661; Fri, 30 Aug 2013 10:58:18 +0100 Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r7U9wIHw011319; Fri, 30 Aug 2013 11:58:18 +0200 Received: (from wtedesch@localhost) by ulslx001.iul.intel.com with id r7U9wIp9011315; Fri, 30 Aug 2013 11:58:18 +0200 From: Walfred Tedeschi To: gdb-patches@sourceware.org, walfred.tedeschi@intel.com, mircea.gherzan@intel.com Subject: [PATCH v3 1/8] Fix conditions in creating a bitfield. Date: Fri, 30 Aug 2013 09:58:00 -0000 Message-Id: <1377856683-11267-2-git-send-email-walfred.tedeschi@intel.com> In-Reply-To: <1377856683-11267-1-git-send-email-walfred.tedeschi@intel.com> References: <1377856683-11267-1-git-send-email-walfred.tedeschi@intel.com> X-SW-Source: 2013-08/txt/msg00903.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/ * 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