From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1197 invoked by alias); 4 Jul 2013 09:13:53 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 1177 invoked by uid 89); 4 Jul 2013 09:13:53 -0000 X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.1 Received: from mail.allinea.com (HELO mail.allinea.com) (94.125.131.200) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 04 Jul 2013 09:13:28 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.allinea.com (Postfix) with ESMTP id BE9C986C002; Thu, 4 Jul 2013 10:13:25 +0100 (BST) Received: from mail.allinea.com ([127.0.0.1]) by localhost (mail.allinea.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ad6lMBRfZ4Rp; Thu, 4 Jul 2013 10:13:25 +0100 (BST) Received: from [192.168.0.7] (cpc16-sotn11-2-0-cust109.15-1.cable.virginmedia.com [82.10.182.110]) (Authenticated sender: cjanuary) by mail.allinea.com (Postfix) with ESMTPSA id 49E5B86C001; Thu, 4 Jul 2013 10:13:25 +0100 (BST) Message-ID: <1372929205.2796.18.camel@gumtree> Subject: RE: Variable Length Arrays (VLA) proposal From: Chris January To: "Agovic, Sanimir" Cc: "gdb@sourceware.org" , "Boell, Keven" , "Weinmann, Christoph T" Date: Thu, 04 Jul 2013 09:13:00 -0000 In-Reply-To: <0377C58828D86C4588AEEC42FC3B85A71762A7F2@IRSMSX105.ger.corp.intel.com> References: <0377C58828D86C4588AEEC42FC3B85A7176288F9@IRSMSX105.ger.corp.intel.com> <1372434039.2950.12.camel@gumtree> <0377C58828D86C4588AEEC42FC3B85A71762A7F2@IRSMSX105.ger.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-SW-Source: 2013-07/txt/msg00018.txt.bz2 On Thu, 2013-07-04 at 08:17 +0000, Agovic, Sanimir wrote: > $ nl vla.f90 > 1 PROGRAM test > 2 INTEGER, ALLOCATABLE :: vla(:, :, :) > 3 CHARACTER(len=:), ALLOCATABLE :: str > 4 ALLOCATE(vla (3, 4, 5)) > 5 ALLOCATE(character(len=2) :: str) > 6 vla(:,:,:) = 42 > 7 str = '42' > 8 call EXIT(0) > 9 END PROGRAM test > Breakpoint 1, test () at vla.f90:4 > 4 ALLOCATE(vla (3, 4, 5)) > $1 = > type = integer(kind=4), ALLOCATABLE (0:1,0:1,0:1) This highlights another issues implementing VLA. When printing a type (e.g. in f-typeprint.c) you don't have the value of the variable and therefore you can't evaluate the DW_AT_lower_bound, DW_AT_upper_bound, DW_AT_allocated, etc. since they usually uses DW_OP_push_object_address and we don't have the value address in f_type_print and friends. So to print reliably print type type of an expression GDB actually needs to evaluate it, something it hasn't needed to do before. Regards, Chris