From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27285 invoked by alias); 4 Jul 2005 07:35:24 -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 27269 invoked by uid 22791); 4 Jul 2005 07:35:16 -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; Mon, 04 Jul 2005 07:35:16 +0000 Received: from farnswood.snap.net.nz (p205-tnt2.snap.net.nz [202.124.108.205]) by viper.snap.net.nz (Postfix) with ESMTP id 775F95CC330; Mon, 4 Jul 2005 19:35:12 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 6CB9262A99; Mon, 4 Jul 2005 08:36:10 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17096.59111.167858.307158@farnswood.snap.net.nz> Date: Mon, 04 Jul 2005 07:35: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: <20050704034904.GA5802@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> <17096.30621.21570.307217@farnswood.snap.net.nz> <20050703234725.GA28151@nevyn.them.org> <17096.37817.638887.840041@farnswood.snap.net.nz> <20050704034904.GA5802@nevyn.them.org> X-SW-Source: 2005-07/txt/msg00043.txt.bz2 > > ...(you still haven't approved my patch for > > mi2-cmd-stack.exp (28 Jun 2005 01:53:52 +1200). > > You posted nothing to gdb-patches on June 27th, 28th, or 29th (except > for the first version of this patch). I vaguely remember seeing a > patch on gdb@ when Mark complained about your introducing regressions. > But if you'd like it approved, please post it to the patches list; I am > methodical about processing gdb-patches mail because it has a clearly > defined request-reply format, and gdb@ discussions tend to wander off > on tangents (like that one did). OK, I'll remember that in future. > BTW, found the patch in the archives - the changelog entry is for the > wrong file. Also, can we just remove the failing test, instead of > adding new tests to mi2? We really need to get a coherent story > together on what "is" mi2, but I don't think we need to add tests for > new commands to it. It comes back to what I said earlier: In reality GDB doesn't support more than one version of MI (the current one). Even the recently implemented MI command -stack-info-frame will work with -i=mi1. There are small differences in output format e.g the preamble that GDB prints out is put on the log stream for mi2 but not mi1, but thats about it. I would favour just supporting one level with tests mi-*.exp. That seems to be hard enough. Apple seem to be the only ones who are already using MI, and they have their own version anyway. > > > 2005-06-30 Nick Roberts > > > > * varobj.c (varobj_list_children): Allow non-zero offsets for > > languages like Fortran. > > Retcode is unused. OK. > Can't we get here with struct types? In which case this will blow up: Would this work? struct type *type; ... type = get_type (var); if (TYPE_CODE (type) == TYPE_CODE_ARRAY) j = i + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (var->type)); else j = i; > > + j = i + TYPE_LOW_BOUND (TYPE_INDEX_TYPE (var->type)); > > + > > /* check if child exists, if not create */ > > - name = name_of_child (var, i); > > + name = name_of_child (var, j); > > child = child_exists (var, name); > > if (child == NULL) > > - child = create_child (var, i, name); > > + child = create_child (var, j, name); > > > > *((*childlist) + i) = child; > > } > > Also, I'm beginning to wonder if you're doing this in the right place. > Not that it matters a whole lot, but index is 0-based in every other > case, including for structs. Maybe the children of arr(4) should be > arr.0 == arr(1), arr.1 == arr(2), arr.2 == arr(3), arr.3 == arr(4). > Then you'd add the lower bound in c_value_of_child. Does that work? > Do you have an opinion on which is "more right"? I'll think this over (and the change above) and then submit another patch. Nick