From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24526 invoked by alias); 20 Nov 2013 12:47:05 -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 24516 invoked by uid 89); 20 Nov 2013 12:47:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mga01.intel.com Received: from Unknown (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Nov 2013 12:47:04 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 20 Nov 2013 04:46:56 -0800 X-ExtLoop1: 1 Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga002.fm.intel.com with ESMTP; 20 Nov 2013 04:46:29 -0800 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.215]) by IRSMSX103.ger.corp.intel.com ([169.254.3.66]) with mapi id 14.03.0123.003; Wed, 20 Nov 2013 12:46:29 +0000 From: "Agovic, Sanimir" To: 'Pedro Alves' CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH 06/10] vla: update type from newly created value Date: Wed, 20 Nov 2013 13:08:00 -0000 Message-ID: <0377C58828D86C4588AEEC42FC3B85A7176B82F7@IRSMSX105.ger.corp.intel.com> References: <1382366424-21010-1-git-send-email-sanimir.agovic@intel.com> <1382366424-21010-7-git-send-email-sanimir.agovic@intel.com> <528C8F1E.2080309@redhat.com> In-Reply-To: <528C8F1E.2080309@redhat.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00593.txt.bz2 > -----Original Message----- > From: Pedro Alves [mailto:palves@redhat.com] > Sent: Wednesday, November 20, 2013 11:30 AM > To: Agovic, Sanimir > Cc: gdb-patches@sourceware.org > Subject: Re: [PATCH 06/10] vla: update type from newly created value >=20 > On 10/21/2013 03:40 PM, Sanimir Agovic wrote: > > Constructing a value based on a type and address might change the type > > of the newly constructed value. >=20 > OOC (and for the archives), why's that? Where does that occur? >=20 Since dwarf3 certain attributes e.g upper/lower bound may be computed dynamically. To support such attributes with the current gdb type-system we require such types to be "normalized". This means types with dynamic properties are converted to types with static properties. To successful convert a type with dynamic properties into one with static properties access to inferior memory is needed. Therefore we hooked into the following value constructors value_at/value_at_lazy/value_from_contents_and_address as they require an inferior address in addition to a type to instantiate a value. IIF the passed type has dynamic properties we resolve the bounds and thus change the type. Given the following statement: struct value *val =3D value_at (my_vla_type, at_address); Before this was always true: TYPE_LENGTH (value_type (val)) =3D=3D TYPE_LENGTH (my_vla_type) This is not the case after applying this (vla-c00) patch series. Type=20 normalization is done in the mentioned value constructors and might=20 change the value type, therefore we need to re-fetch the type from the constructed value. I hope this makes sense. > > Thus re-fetch type via value_type to ensure > > we have the correct type at hand. >=20 > -- > Pedro Alves Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052