From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21082 invoked by alias); 1 Jul 2013 08:01:50 -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 21067 invoked by uid 89); 1 Jul 2013 08:01:49 -0000 X-Spam-SWARE-Status: No, score=-2.8 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; Mon, 01 Jul 2013 08:01:48 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.allinea.com (Postfix) with ESMTP id 9C2774083E; Mon, 1 Jul 2013 09:01:45 +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 6QqIX2V-U5Kj; Mon, 1 Jul 2013 09:01:45 +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 3F7B7402FC; Mon, 1 Jul 2013 09:01:45 +0100 (BST) Message-ID: <1372665705.3234.3.camel@gumtree> Subject: Re: Variable Length Arrays (VLA) proposal From: Chris January To: Joel Brobecker Cc: gdb@sourceware.org Date: Mon, 01 Jul 2013 08:01:00 -0000 In-Reply-To: <20130701015453.GB10319@adacore.com> References: <0377C58828D86C4588AEEC42FC3B85A7176288F9@IRSMSX105.ger.corp.intel.com> <1372434039.2950.12.camel@gumtree> <20130701015453.GB10319@adacore.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-SW-Source: 2013-07/txt/msg00001.txt.bz2 On Sun, 2013-06-30 at 18:54 -0700, Joel Brobecker wrote: > > Just to add another possibility, we implemented VLA for Fortran by > > wrapping read_var_value and then adding a call to f_fixup_value which > > 'fixed up' the type of the variable (filled in the array bounds, etc.) > > by modifying the original type. (It also auto-dereferences pointers). > > One of the questions that need to be asked is whether it's OK to modify > the type in place like that. For Ada, we create new types with the > bounds fixed-up. I think you might run into problems with cached > values, such as the values accessible from the history (Eg: "print $2"). Do you mean in this scenario (excuse the mixed Fortran / GDB commands)? ALLOCATE(array(10, 10)) (gdb) print array $1 = (...) DEALLOCATE(array) ALLOCATE(array(20,20)) (gdb) print $1 Then no, modifying the original type does not work in that case (it breaks $1 as you say). Chris