From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2875 invoked by alias); 18 Feb 2015 15:54: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 2865 invoked by uid 89); 18 Feb 2015 15:54:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga01.intel.com Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Feb 2015 15:54:20 +0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP; 18 Feb 2015 07:54:17 -0800 X-ExtLoop1: 1 Received: from kboell-mobl2.ger.corp.intel.com (HELO [172.28.205.49]) ([172.28.205.49]) by orsmga003.jf.intel.com with ESMTP; 18 Feb 2015 07:45:38 -0800 Message-ID: <54E4B5A7.8010506@linux.intel.com> Date: Wed, 18 Feb 2015 15:54:00 -0000 From: Keven Boell User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Joel Brobecker , Keven Boell CC: gdb-patches@sourceware.org, Doug Evans Subject: Re: [V4 01/18] vla: introduce allocated/associated flags References: <1421243390-24015-1-git-send-email-keven.boell@intel.com> <1421243390-24015-2-git-send-email-keven.boell@intel.com> <20150209065213.GA15579@adacore.com> In-Reply-To: <20150209065213.GA15579@adacore.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00483.txt.bz2 On 09.02.2015 07:52, Joel Brobecker wrote: > [Copying Doug, as I think Doug has experience in this area, and is > also dealing with the kind of giant programs where size of types > really make a big difference] > >> Fortran 90 provide types whose values may be dynamically >> allocated or associated with a variable under explicit >> program control. The purpose of this commit is to read >> allocated/associated DWARF tags and store them to the >> main_type. >> >> 2014-05-28 Keven Boell >> Sanimir Agovic >> >> * dwarf2read.c (set_die_type): Add reading of >> allocated/associated flags. >> * gdbtypes.h (struct main_type): Add allocated/ >> associated dwarf2_prop attributes. >> (TYPE_ALLOCATED_PROP): New macro. >> (TYPE_ASSOCIATED_PROP): New macro. >> (TYPE_NOT_ALLOCATED): New macro. >> (TYPE_NOT_ASSOCIATED): New macro. > > struct main_type is size-critical, so we simply cannot add > fields to it that only a very small minority of instances > will actually be using.. > > To avoid the size increase, I propose that we turn... > > struct dynamic_prop *data_location; > > ... into a chained list of dynamic properties. To determine > which type of property each element in the list is, we'll need > to introduce an enumerated type to be used as discriminant. > > So, I propose something like that: > > /* FIXME: Add comment. */ > > enum dynamic_prop_kind > { > /* FIXME: Document. */ > DYNAMIC_PROP_DATA_LOCATION, > /* FIXME: Document. */ > DYNAMIC_PROP_ALLOCATED, > /* FIXME: Document. */ > DYNAMIC_PROP_ASSOCIATED, > }; > > /* FIXME: Document. */ > > struct dynamic_prop_list > { > enum dynamic_prop_kind kind; > struct dynamic_prop *prop; > struct dynamic_prop_list *next; > }; > > ... then replace... > > struct dynamic_prop *data_location; > > ... into ... > > struct dynamic_prop_list *dyn_prop_list; > > ... and finally adjust the macros to go through the list instead of > accessing the data through the dedicated fields. Using a function > which does the search for a given kind will probably be useful. > > I think you might find it easier to do it in 2 stages (and therefore > two patches): > > 1. Convert the current "data_location" field to the list scheme; > 2. Then add the two new kinds of properties, which should then > be fairly straightforward. > Hi Joel, Thanks for your reply. Appreciate the time you invested for reviewing the patches. I will re-work this part to have the new attributes as a linked list as you proposed and will come up with an updated patch series. Thanks, Keven