From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10784 invoked by alias); 3 Jul 2005 23:40:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 10723 invoked by uid 22791); 3 Jul 2005 23:40:14 -0000 Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 03 Jul 2005 23:40:13 +0000 Received: from farnswood.snap.net.nz (p154-tnt1.snap.net.nz [202.124.110.154]) by viper.snap.net.nz (Postfix) with ESMTP id A16B65BEFBC; Mon, 4 Jul 2005 11:40:10 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id B007C62A99; Mon, 4 Jul 2005 00:41:17 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17096.30621.21570.307217@farnswood.snap.net.nz> Date: Sun, 03 Jul 2005 23:40:00 -0000 To: Daniel Jacobowitz Cc: Wu Zhou , gdb-patches@sources.redhat.com Subject: Re: PATCH: Start Fortran support for variable objects. In-Reply-To: <20050703161706.GA13289@nevyn.them.org> References: <17091.4780.953681.620094@farnswood.snap.net.nz> <20050630131809.GB8241@nevyn.them.org> <17092.28833.284587.118362@farnswood.snap.net.nz> <17092.51062.559020.560618@farnswood.snap.net.nz> <20050703161706.GA13289@nevyn.them.org> X-SW-Source: 2005-07/txt/msg00035.txt.bz2 Daniel Jacobowitz writes: > On Fri, Jul 01, 2005 at 04:32:54PM +1200, Nick Roberts wrote: > > So I should have done: > > > > (top-gdb) p TYPE_LOW_BOUND(var->type->main_type->fields->type) > > $1 = 1 > > (top-gdb) p TYPE_HIGH_BOUND(var->type->main_type->fields->type) > > $2 = 4 > > Right - specifically, TYPE_LOW_BOUND (TYPE_INDEX_TYPE (var->type)) > is supposed to be the lower bound for an array. Tricky. It comes from > read_subrange_type in dwarf2read.c for dwarf2. Or even TYPE_ARRAY_LOWER_BOUND_VALUE (var->type)? Presumably these macros are more general than dwarf2. I don't understand the connection with read_subrange_type. ... > First of all, never reference ->main_type - see above for the right way > to get the low bound. An even better way (it seems) is to call > get_discrete_bounds. Take a look at value_subscript for an example. Better than TYPE_LOW_BOUND? ... > So let's use TYPE_LOW_BOUND for now; does that eliminate the need for > the fortran-specific code? OK. And, in future, bear get_discrete_bounds in mind? Nick