From patchwork Fri Oct 26 18:06:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 29911 Received: (qmail 63810 invoked by alias); 26 Oct 2018 18:06:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 63798 invoked by uid 89); 26 Oct 2018 18:06:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=$cmd X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 26 Oct 2018 18:06:19 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A511A88E54; Fri, 26 Oct 2018 18:06:18 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id D112266064; Fri, 26 Oct 2018 18:06:17 +0000 (UTC) Subject: Re: [RFVv4 5/5] Add a test case for info args|functions|locals|variables [-q] [-t TYPEREGEXP] [NAMEREGEXP] To: Philippe Waroquiers , gdb-patches@sourceware.org References: <20181025201107.24828-1-philippe.waroquiers@skynet.be> <20181025201107.24828-6-philippe.waroquiers@skynet.be> From: Pedro Alves Message-ID: <0635db5a-c2ff-cc3f-3dfb-7c2c98c7323b@redhat.com> Date: Fri, 26 Oct 2018 19:06:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181025201107.24828-6-philippe.waroquiers@skynet.be> On 10/25/2018 09:11 PM, Philippe Waroquiers wrote: > Add a test case for info args|functions|locals|variables [-q] [-t TYPEREGEXP] [NAMEREGEXP] > > gdb/testsuite/ChangeLog > 2018-10-25 Philippe Waroquiers > > * gdb.base/info_qt.c: New file. > * gdb.base/info_qt.exp: New file. Thanks! I still think that the gdb.sum output with the patch below on top looks much clearer. Do you disagree? Note that the last hunk below shows that "info args" was incorrect, should have been "info locals". Otherwise looks good. From 347d23341613bc0780d5ee189a21b45b6d1eac7a Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 26 Oct 2018 13:46:51 +0100 Subject: [PATCH] foreach --- gdb/testsuite/gdb.base/info_qt.exp | 53 ++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/gdb/testsuite/gdb.base/info_qt.exp b/gdb/testsuite/gdb.base/info_qt.exp index 83084a3ce83..ab0872973a7 100644 --- a/gdb/testsuite/gdb.base/info_qt.exp +++ b/gdb/testsuite/gdb.base/info_qt.exp @@ -42,7 +42,7 @@ set number "\[0-9]\+" ############# Test 'info functions'. with_test_prefix "info functions nameregexp" { - foreach_with_prefix cmd { + foreach cmd { "info functions info_fun" "info functions -- info_fun" "info functions ^info_fun" } { @@ -56,13 +56,12 @@ with_test_prefix "info functions nameregexp" { "${number}: int info_fun2bis\\\(char\\\);" \ "${number}: entier info_fun2xxx\\\(char, int, int\\\);" \ "${number}: entier info_fun2yyy\\\(char, int, int\\\);" \ - ] \ - "info functions info_fun" + ] } } with_test_prefix "info functions nameregexp quiet" { - foreach_with_prefix cmd { + foreach cmd { "info functions -q info_fun" "info functions -q -- info_fun" } { gdb_test $cmd \ @@ -74,21 +73,20 @@ with_test_prefix "info functions nameregexp quiet" { "${number}: int info_fun2bis\\\(char\\\);" \ "${number}: entier info_fun2xxx\\\(char, int, int\\\);" \ "${number}: entier info_fun2yyy\\\(char, int, int\\\);" \ - ] \ - "info functions -q info_fun" + ] } } with_test_prefix "info functions nameregexp quiet no match" { - foreach_with_prefix cmd { + foreach cmd { "info functions -q nowaythiscanmatch" "info functions -q -- -q" } { - gdb_test_no_output $cmd "quiet info functions empty output" + gdb_test_no_output $cmd } } with_test_prefix "info functions typeregexp nameregexp" { - foreach_with_prefix cmd { + foreach cmd { "info functions -t entier -q info_fun" "info functions -q -t 'entier (' -- info_fun" "info functions -q -t '(char, int, int)' -- info_fun" @@ -99,8 +97,7 @@ with_test_prefix "info functions typeregexp nameregexp" { "File .*info_qt.c:" \ "${number}: entier info_fun2xxx\\\(char, int, int\\\);" \ "${number}: entier info_fun2yyy\\\(char, int, int\\\);" \ - ] \ - "info functions -q info_fun" + ] } } @@ -112,7 +109,7 @@ with_test_prefix "info functions typeregexp nameregexp no match" { ############# Test 'info variables'. with_test_prefix "info variables nameregexp" { - foreach_with_prefix cmd { + foreach cmd { "info variables info_qt" "info variables -- info_qt" "info variables ^info_qt" } { @@ -123,21 +120,20 @@ with_test_prefix "info variables nameregexp" { "File .*info_qt.c:" \ "${number}: entier info_qt_ent;" \ "${number}: int info_qt_inc;" \ - ] \ - "info functions info_fun" + ] } } with_test_prefix "info variables nameregexp quiet no match" { - foreach_with_prefix cmd { + foreach cmd { "info variables -q nowaythiscanmatch" "info variables -q -- -q" } { - gdb_test_no_output $cmd "quiet info variables empty output" + gdb_test_no_output $cmd } } with_test_prefix "info variables typeregexp nameregexp quiet" { - foreach_with_prefix cmd { + foreach cmd { "info variables -t entier -q info_qt" "info variables -q -t entier -- info_qt" } { gdb_test $cmd \ @@ -145,8 +141,7 @@ with_test_prefix "info variables typeregexp nameregexp quiet" { "" \ "File .*info_qt.c:" \ "${number}: entier info_qt_ent;" \ - ] \ - "info variables -q -t entier info_fun" + ] } } @@ -162,7 +157,7 @@ with_test_prefix "info variables typeregexp nameregexp quiet no match" { gdb_test "frame 1" ".* in setup .*" "set frame 1 for info args" with_test_prefix "info args matching all args" { - foreach_with_prefix cmd { + foreach cmd { "info args" "info args arg_" "info args g" @@ -172,21 +167,19 @@ with_test_prefix "info args matching all args" { "arg_c = 100 'd'" \ "arg_i = 3" \ "arg_j = 4" \ - ] \ - "info args" + ] } } with_test_prefix "info args matching some args" { - foreach_with_prefix cmd { + foreach cmd { "info args -t int" "info args arg_[ij]"} { gdb_test $cmd \ [multi_line \ "arg_i = 3" \ "arg_j = 4" \ - ] \ - "info args" + ] } } @@ -201,7 +194,7 @@ with_test_prefix "info args no match" { gdb_test "frame 1" ".* in setup .*" "set frame 1 for info locals" with_test_prefix "info locals matching all locals" { - foreach_with_prefix cmd { + foreach cmd { "info locals" "info locals loc_arg_" "info locals g" @@ -211,13 +204,12 @@ with_test_prefix "info locals matching all locals" { "loc_arg_c = 100 'd'" \ "loc_arg_i = 3" \ "loc_arg_j = 4" \ - ] \ - "info locals" + ] } } with_test_prefix "info locals matching some locals" { - foreach_with_prefix cmd { + foreach cmd { "info locals -t int" "info locals arg_[ij]" "info locals loc_arg_[ij]"} { @@ -225,8 +217,7 @@ with_test_prefix "info locals matching some locals" { [multi_line \ "loc_arg_i = 3" \ "loc_arg_j = 4" \ - ] \ - "info args" + ] } }