From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11579 invoked by alias); 29 Nov 2012 21:51:15 -0000 Received: (qmail 11560 invoked by uid 22791); 29 Nov 2012 21:51:12 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 21:51:08 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qATLp8qa017550 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 29 Nov 2012 16:51:08 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id qATLp7nQ032232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 29 Nov 2012 16:51:07 -0500 From: Tom Tromey To: Jan Kratochvil Cc: gdb@sourceware.org Subject: Re: plan: VLA (Variable Length Arrays) and Fortran dynamic types References: <20121129144855.GA16288@host2.jankratochvil.net> Date: Thu, 29 Nov 2012 21:51:00 -0000 In-Reply-To: <20121129144855.GA16288@host2.jankratochvil.net> (Jan Kratochvil's message of "Thu, 29 Nov 2012 15:48:55 +0100") Message-ID: <874nk83wok.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-SW-Source: 2012-11/txt/msg00099.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> Rename "struct type" to "struct abstract_type". Make all Jan> TYPE_LENGTH, TYPE_ARRAY_UPPER_BOUND_VALUE etc. macros accessing Jan> concrete sizes requiring to provide also "struct value *". Remove Jan> check_typedef, that is hide it under the TYPE_LENGTH etc. macros. Jan> This would also include work to pass "struct value *" mostly Jan> everywhere instead of where current "struct type *" is passed as Jan> one needs the inferior memory to find out the concrete dimensions Jan> of inferior type. This then makes the current *-vla implementation Jan> of DW_AT_object_pointer easy. [...] Jan> Alternative approach would be to "concretize" abstract types by Jan> check_typedef (which would be kept there). In such case there Jan> still would be "struct abstract_type" but there would be also Jan> "struct concrete_type" which would automatically cache all the Jan> values for better performance. check_typedef would still be Jan> impossible to forget like nowadays due to the non-compatible GDB Jan> types "struct abstract_type" vs. "struct concrete_type". Jan> archer-jankratochvil-vla does it this way (but still keeping Jan> "struct type" being both the input and output GDB type of Jan> check_typedef). I do not think this approach is worth the pain. Passing a struct value everywhere seems pretty awful though too, especially considering that one may not generally have a value. 'ptype' and plenty of other things have to work on the abstract type. But I think maybe I don't understand some details here. Could you give an example of where we pass a type now that we would have to pass a value in the future? I note that Ada already uses the concretizing approach. Maybe Joel could share their experiences with this. Tom