From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32393 invoked by alias); 30 Jun 2005 09:28:13 -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 32341 invoked by uid 22791); 30 Jun 2005 09:28:02 -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; Thu, 30 Jun 2005 09:28:02 +0000 Received: from farnswood.snap.net.nz (p143-tnt2.snap.net.nz [202.124.108.143]) by viper.snap.net.nz (Postfix) with ESMTP id 7B096555392; Thu, 30 Jun 2005 21:27:57 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 00C0362A99; Thu, 30 Jun 2005 10:02:36 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17091.46378.720749.411474@farnswood.snap.net.nz> Date: Thu, 30 Jun 2005 09:28:00 -0000 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: PATCH: Start Fortran support for variable objects. In-Reply-To: <20050630025323.GA26397@nevyn.them.org> References: <17091.4780.953681.620094@farnswood.snap.net.nz> <20050630025323.GA26397@nevyn.them.org> X-SW-Source: 2005-06/txt/msg00387.txt.bz2 Daniel Jacobowitz writes: > On Thu, Jun 30, 2005 at 09:29:16AM +1200, Nick Roberts wrote: > > > > This patch adjusts the offset from 0 to 1 to allow the display of arrays > > in Fortran using variable objects. > > I see that you're hardcoding this based on language. Can we do it > based on type instead? Specifically, TYPE_LOW_BOUND and > TYPE_HIGH_BOUND. We have got type information here - unless I'm > misreading, var->type should be the type of the array. They look pretty similar to me. C: (top-gdb) p TYPE_LOW_BOUND(var->type) $18 = 0 (top-gdb) p* var->type->main_type $33 = {code = TYPE_CODE_ARRAY, upper_bound_type = BOUND_SIMPLE, lower_bound_type = BOUND_SIMPLE, name = 0x0, tag_name = 0x0, objfile = 0x8357618, target_type = 0x8372c74, flags = 0, nfields = 1, vptr_fieldno = -1, fields = 0x837496c, vptr_basetype = 0x0, type_specific = { cplus_stuff = 0x0, floatformat = 0x0}} Fortran: (top-gdb) p TYPE_LOW_BOUND(var->type) $3 = 0 (top-gdb) p* var->type->main_type $8 = {code = TYPE_CODE_ARRAY, upper_bound_type = BOUND_SIMPLE, lower_bound_type = BOUND_SIMPLE, name = 0x0, tag_name = 0x0, objfile = 0x8357618, target_type = 0x83654cc, flags = 0, nfields = 1, vptr_fieldno = -1, fields = 0x83655c4, vptr_basetype = 0x0, type_specific = {cplus_stuff = 0x0, floatformat = 0x0}} I need more of a clue to follow your suggestion. > I'm not thrilled with the existing language-dependent behavior in > varobj; we have got a common type system, after all. At the moment, I'm finding it hard enough to just work with whats already there. Maybe later on I'll be able to step up another gear. Nick