From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24514 invoked by alias); 7 Nov 2013 18:01:42 -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 24490 invoked by uid 89); 7 Nov 2013 18:01:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.3 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPAM_SUBJECT,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Nov 2013 18:01:40 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rA7I1WwY001833 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 7 Nov 2013 13:01:33 -0500 Received: from barimba (ovpn-113-94.phx2.redhat.com [10.3.113.94]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id rA7I1VPn019745 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 7 Nov 2013 13:01:32 -0500 From: Tom Tromey To: Sanimir Agovic Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 01/10] vla: introduce new bound type abstraction adapt uses References: <1382366424-21010-1-git-send-email-sanimir.agovic@intel.com> <1382366424-21010-2-git-send-email-sanimir.agovic@intel.com> Date: Thu, 07 Nov 2013 19:00:00 -0000 In-Reply-To: <1382366424-21010-2-git-send-email-sanimir.agovic@intel.com> (Sanimir Agovic's message of "Mon, 21 Oct 2013 16:40:15 +0200") Message-ID: <87iow4um4k.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-11/txt/msg00200.txt.bz2 >>>>> "Sanimir" == Sanimir Agovic writes: Sanimir> The rational behind this patch is to get started to implement Sanimir> the feature described in dwarf4 standard (2.19) Static and Sanimir> Dynamic Values of Attributes. It adds new DWARF2_PROP to store Sanimir> either a constant, exprloc, or reference to describe an Sanimir> upper-/lower bound of a subrange. Other than that no new Sanimir> features are introduce. Thanks very much for working on this. Sanimir> + low.data.const_val = dwarf2_get_attr_constant_value (attr, low.data.const_val); This line is too long and should be wrapped. Sanimir> +struct type * Sanimir> +create_range_type_1 (struct type *result_type, struct type *index_type, Sanimir> + const struct dwarf2_prop *low_bound, Sanimir> + const struct dwarf2_prop *high_bound) Sanimir> +{ This needs an introductory comment. Sanimir> +/* Used to store bound information for a type. */ Sanimir> + Sanimir> +struct dwarf2_prop Sanimir> +{ Sanimir> + /* Determine which field of the union dwarf2_prop.data is used. */ Sanimir> + enum Sanimir> + { Sanimir> + DWARF_CONST, Sanimir> + DWARF_LOCEXPR, Sanimir> + DWARF_LOCLIST Sanimir> + } kind; Sanimir> + Sanimir> + /* Stores information as location expression, location list, Sanimir> + or constant value. */ Sanimir> + union data Sanimir> + { Sanimir> + LONGEST const_val; Sanimir> + struct dwarf2_locexpr_baton *locexpr; Sanimir> + struct dwarf2_loclist_baton *loclist; Sanimir> + } data; Sanimir> +}; Sanimir> @@ -589,11 +612,11 @@ struct main_type Sanimir> { Sanimir> /* Low bound of range. */ Sanimir> - LONGEST low; Sanimir> + struct dwarf2_prop low; Sanimir> /* High bound of range. */ Sanimir> - LONGEST high; Sanimir> + struct dwarf2_prop high; Just after this hunk of "struct range_bounds" is this code: /* Flags indicating whether the values of low and high are valid. When true, the respective range value is undefined. Currently used only for FORTRAN arrays. */ char low_undefined; char high_undefined; It seems to me that it would be cleanest to make this a new value of the enum you introduced, like "DWARF_UNDEFINED", and update a few macros to follow. What do you think? Tom