From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30047 invoked by alias); 26 Feb 2014 18:32:14 -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 29996 invoked by uid 89); 26 Feb 2014 18:32:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 26 Feb 2014 18:32:00 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8B8571166C8; Wed, 26 Feb 2014 13:31:58 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id d+zS4Gkdx4fH; Wed, 26 Feb 2014 13:31:58 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 58DAC116663; Wed, 26 Feb 2014 13:31:58 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 3E294E04D4; Wed, 26 Feb 2014 10:31:57 -0800 (PST) Date: Wed, 26 Feb 2014 18:32:00 -0000 From: Joel Brobecker To: Mark Wielaard Cc: gdb-patches@sourceware.org Subject: Re: [RFA/DWARF] Set enum type "flag_enum" and "unsigned" flags at type creation. Message-ID: <20140226183157.GF4348@adacore.com> References: <1390796357-3739-1-git-send-email-brobecker@adacore.com> <1392820455.21975.235.camel@bordewijk.wildebeest.org> <1392823115.21975.238.camel@bordewijk.wildebeest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1392823115.21975.238.camel@bordewijk.wildebeest.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-02/txt/msg00789.txt.bz2 > So, this patch doesn't show any regressions in the testsuite: > > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 54c538a..0b5de99 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -14303,7 +14303,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) > LONGEST low, high; > int low_default_is_valid; > const char *name; > - LONGEST negative_mask; > > orig_base_type = die_type (die, cu); > /* If ORIG_BASE_TYPE is a typedef, it will not be TYPE_UNSIGNED, > @@ -14433,13 +14432,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) > } > } > > - negative_mask = > - (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1); > - if (!TYPE_UNSIGNED (base_type) && (low & negative_mask)) > - low |= negative_mask; > - if (!TYPE_UNSIGNED (base_type) && (high & negative_mask)) > - high |= negative_mask; > - I finally had some time to test this patch, and unfortunately, it does introduce some regression (in Ada). For instance in homonym.exp: type Integer_Range is new Integer range -100 .. 100; subtype Local_Type is Integer_Range; This is what GDB would print afterwards: (gdb) ptype local_type type = range 4294967196 .. 100 The lower bound should be -100. The debugging info is generated as follow: <2><80>: Abbrev Number: 2 (DW_TAG_subrange_type) <81> DW_AT_lower_bound : 0xffffff9c <85> DW_AT_upper_bound : 100 <86> DW_AT_name : (indirect string, offset: 0x76): homonym__get_value__local_type___XDLU_100m__100 <8a> DW_AT_type : <0x37> And the corresponding abbrev gives the form: 2 DW_TAG_subrange_type [no children] DW_AT_lower_bound DW_FORM_data4 DW_AT_upper_bound DW_FORM_data1 DW_AT_name DW_FORM_strp DW_AT_type DW_FORM_ref4 DW_AT value: 0 DW_FORM value: 0 It's the dreaded DW_FORM_dataN form... And unfortunately, I get the same representation with pre-versions of GCC 4.9, so it looks like we're not going to be able to remove that bit anytime soon :-(. I'll add a comment in the code... -- Joel