From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12184 invoked by alias); 3 Jul 2005 23:47:33 -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 12176 invoked by uid 22791); 3 Jul 2005 23:47:29 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 03 Jul 2005 23:47:29 +0000 Received: from drow by nevyn.them.org with local (Exim 4.51) id 1DpEBJ-0007L5-FI; Sun, 03 Jul 2005 19:47:25 -0400 Date: Sun, 03 Jul 2005 23:47:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: Wu Zhou , gdb-patches@sources.redhat.com Subject: Re: PATCH: Start Fortran support for variable objects. Message-ID: <20050703234725.GA28151@nevyn.them.org> Mail-Followup-To: Nick Roberts , Wu Zhou , gdb-patches@sources.redhat.com 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> <17096.30621.21570.307217@farnswood.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17096.30621.21570.307217@farnswood.snap.net.nz> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00036.txt.bz2 On Mon, Jul 04, 2005 at 11:41:17AM +1200, Nick Roberts wrote: > 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)? Let's stick to TYPE_LOW_BOUND (TYPE_INDEX_TYPE (var->type)) for now. That macro appears to be fortran-specific, and part of the dead bits. > Presumably these macros are more general than dwarf2. I don't understand the > connection with read_subrange_type. It was just an example - that's somewhere that sets it, and knows about the Fortran numbering convention. > > 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? I suppose. I don't know which one is preferred; some day, someone should go through and clean them all up to be consistent. I'm fine with either choice. -- Daniel Jacobowitz CodeSourcery, LLC