From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22045 invoked by alias); 26 Jul 2013 15:08:51 -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 22019 invoked by uid 89); 26 Jul 2013 15:08:51 -0000 X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 26 Jul 2013 15:08:51 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6QF8h2b002310 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 26 Jul 2013 11:08:43 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6QF8gbM010111 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Jul 2013 11:08:43 -0400 Message-ID: <51F290FA.8000104@redhat.com> Date: Fri, 26 Jul 2013 15:08:00 -0000 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tom Tromey CC: "gp >> \"gdb-patches@sourceware.org ml\"" Subject: Re: [RFA] Fix mi-var-child-f.exp failures References: <51F1BB9A.6050607@redhat.com> <87txjhtn6x.fsf@fleche.redhat.com> In-Reply-To: <87txjhtn6x.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2013-07/txt/msg00639.txt.bz2 On 07/26/2013 07:23 AM, Tom Tromey wrote: >>>>>> "Keith" == Keith Seitz writes: > > Keith> 2013-07-25 Keith Seitz > Keith> * gdb.mi/mi-var-child-f.exp: Use mi_create_varobj. > Keith> Use mi_list_varobj_children for the immediate children of `array'. > Keith> Add "has_more" attribute for grandchildren test. > > This is ok. Thanks. > > On irc you said this happens if you don't have f77 installed. > Is there a way to make the test also work with gfortran? > I think f77 is mostly dead. Yes, pass F77_FOR_TARGET=gfortran in RUNTESTFLAGS. Alas, that exposes another problem with the test. The type of "array" is reported as "integer(kind=4)" with gfortran (simply "integer" with g77). There's a blurb about/solution to this in gdb.fortran/multi-dim.exp which I've stolen. I've also changed the compile settings to use F90 instead of F77. This will make this test use gfortran instead of g77. The purpose of this test is to test varobj not f77. Ok? Keith testsuite/ChangeLog 2013-07-26 Keith Seitz * gdb.mi/mi-var-child-f.exp: Pass f90 to gdb_compile instead of f77. Allow for compiler variations of integer types. Use mi_create_varobj. Use mi_list_varobj_children for the immediate children of `array'. Add "has_more" attribute for grandchildren test. diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp b/gdb/testsuite/gdb.mi/mi-var-child-f.exp index 762a90d..79d49bd 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp @@ -28,7 +28,7 @@ if [mi_gdb_start] { standard_testfile array.f if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ - executable {debug f77}] != ""} { + executable {debug f90}] != ""} { return -1 } @@ -37,14 +37,20 @@ mi_gdb_load ${binfile} mi_runto MAIN__ -mi_gdb_test "-var-create array * array" \ - "\\^done,name=\"array\",numchild=\"3\",value=\".*\",type=\"integer \\(2,-1:1\\)\"" \ - "create local variable array" +mi_create_varobj "array" "array" "create local variable array" -mi_gdb_test "-var-list-children --all-values array" \ - "\\^done,numchild=\"3\",children=\\\[child=\{name=\"array.-1\",exp=\"-1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\},child=\{name=\"array.0\",exp=\"0\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\},child=\{name=\"array.1\",exp=\"1\",numchild=\"2\",value=\"\\\[2\\\]\",type=\"integer \\(2\\)\"\}\\\]" \ - "get children of array" + +# Depending on the compiler version being used, the name of the 4-byte integer +# and real types can be printed differently. For instance, gfortran-4.1 uses +# "int4" whereas gfortran-4.3 uses "integer(kind=4)". +set int4 "(int4|integer\\(kind=4\\))" + +set children [list [list "array.-1" "-1" 2 "$int4 \\(2\\)"] \ + [list "array.0" "0" 2 "$int4 \\(2\\)"] \ + [list "array.1" "1" 2 "$int4 \\(2\\)"]] + +mi_list_varobj_children "array" $children "get children of array" mi_gdb_test "-var-list-children --all-values array.-1" \ - "\\^done,numchild=\"2\",children=\\\[child=\{name=\"array.-1.1\",exp=\"1\",numchild=\"0\",value=\"11\",type=\"integer\"\},child=\{name=\"array.-1.2\",exp=\"2\",numchild=\"0\",value=\"21\",type=\"integer\"\}\\\]" \ + "\\^done,numchild=\"2\",children=\\\[child=\{name=\"array.-1.1\",exp=\"1\",numchild=\"0\",value=\"11\",type=\"$int4\"\},child=\{name=\"array.-1.2\",exp=\"2\",numchild=\"0\",value=\"21\",type=\"$int4\"\}\\\],has_more=\"0\"" \ "get grandchildren of array (children of first element of second index)"