From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23302 invoked by alias); 5 Sep 2013 09:26:45 -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 23231 invoked by uid 89); 5 Sep 2013 09:26:44 -0000 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; Thu, 05 Sep 2013 09:26:44 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE autolearn=no version=3.3.2 X-HELO: mga09.intel.com Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 05 Sep 2013 02:23:45 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga002.jf.intel.com with ESMTP; 05 Sep 2013 02:26:40 -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 r859Qdw6001741; Thu, 5 Sep 2013 10:26:39 +0100 Received: from ulslx001.iul.intel.com (localhost [127.0.0.1]) by ulslx001.iul.intel.com with ESMTP id r859QdFf031200; Thu, 5 Sep 2013 11:26:39 +0200 Received: (from wtedesch@localhost) by ulslx001.iul.intel.com with id r859QdLw031196; Thu, 5 Sep 2013 11:26:39 +0200 From: Walfred Tedeschi To: tromey@redhat.com, gdb-patches@sourceware.org, mark.kettenis@xs4all.nl Cc: Walfred Tedeschi Subject: [PATCH V4 1/8] Fix conditions in creating a bitfield. Date: Thu, 05 Sep 2013 09:26:00 -0000 Message-Id: <1378373188-31144-2-git-send-email-walfred.tedeschi@intel.com> In-Reply-To: <1378373188-31144-1-git-send-email-walfred.tedeschi@intel.com> References: <1378373188-31144-1-git-send-email-walfred.tedeschi@intel.com> X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00159.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