From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 822 invoked by alias); 27 Nov 2013 12:25:01 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 811 invoked by uid 89); 27 Nov 2013 12:25:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mga02.intel.com Received: from Unknown (HELO mga02.intel.com) (134.134.136.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 27 Nov 2013 12:25:00 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 27 Nov 2013 04:24:52 -0800 X-ExtLoop1: 1 Received: from kboell-mobl1.ger.corp.intel.com (HELO [172.28.205.40]) ([172.28.205.40]) by orsmga002.jf.intel.com with ESMTP; 27 Nov 2013 04:24:51 -0800 Message-ID: <5295E492.7050501@linux.intel.com> Date: Wed, 27 Nov 2013 13:49:00 -0000 From: Keven Boell User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH] testsuite: introduce index in varobj child eval. References: <1385467825-5236-1-git-send-email-keven.boell@intel.com> <87fvqj5h3e.fsf@fleche.redhat.com> In-Reply-To: <87fvqj5h3e.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00840.txt.bz2 Thanks for the feedback. I've attached the updated patch, which addresses your comments. Keven From 7c6728c1f92f92b54310ca1d74e113e6300e2ba4 Mon Sep 17 00:00:00 2001 From: Keven Boell Date: Thu, 21 Nov 2013 10:54:47 +0100 Subject: [PATCH] testsuite: introduce index in varobj child eval. In some languages, e.g. fortran, arrays start with index 1 instead 0. This patch changes the MI library to support testing varobj children of fortran arrays. 2013-11-21 Keven Boell testsuite/ * lib/mi-support.exp (mi_list_varobj_children_range): Add call to mi_list_array_varobj_children_with_index. (mi_list_array_varobj_children_with_index): New function. Add parameter to specify array start. Signed-off-by: Keven Boell --- gdb/testsuite/lib/mi-support.exp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 0c3cdbe..cb7bf90 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1487,9 +1487,18 @@ proc mi_list_varobj_children_range {varname from to numchildren children testnam # Verifies that variable object VARNAME has NUMBER children, # where each one is named $VARNAME. and has type TYPE. proc mi_list_array_varobj_children { varname number type testname } { + mi_list_array_varobj_children_with_index $varname $number 0 $type $testname +} + +# Same as mi_list_array_varobj_children, but allowing to pass a start index +# for an array. +proc mi_list_array_varobj_children_with_index { varname number start_index \ + type testname } { set t {} + set index $start_index for {set i 0} {$i < $number} {incr i} { - lappend t [list $varname.$i $i 0 $type] + lappend t [list $varname.$index $index 0 $type] + incr index } mi_list_varobj_children $varname $t $testname } -- 1.7.9.5 On 26.11.2013 16:16, Tom Tromey wrote: >>>>>> "Keven" == Keven Boell writes: > > Keven> # Verifies that variable object VARNAME has NUMBER children, > Keven> # where each one is named $VARNAME. and has type TYPE. > Keven> proc mi_list_array_varobj_children { varname number type testname } { > Keven> + mi_list_array_varobj_children_with_index $varname $number 0 $type $testname > Keven> +} > Keven> +proc mi_list_array_varobj_children_with_index { varname number start_index type testname } { > > The new proc should be separated from the previous one by a blank line. > It should have an introductory comment as well. > > Also the first line of the new proc is too long. I think it should be > split in the arglist somewhere. > > Tom >