From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110666 invoked by alias); 26 Apr 2015 18:44:44 -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 110657 invoked by uid 89); 26 Apr 2015 18:44:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 26 Apr 2015 18:44:41 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 55F768E7B3; Sun, 26 Apr 2015 18:44:40 +0000 (UTC) Received: from localhost (unused-10-15-17-126.yyz.redhat.com [10.15.17.126]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3QIidsW012780 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA256 bits=256 verify=NO); Sun, 26 Apr 2015 14:44:40 -0400 From: Sergio Durigan Junior To: Gabriel Krisman Bertazi Cc: gdb-patches@sourceware.org, dje@google.com Subject: Re: [PATCH v3 03/17] Add tests for catching groups of syscalls on supported architectures. References: <1430011521-24340-1-git-send-email-gabriel@krisman.be> <1430011521-24340-4-git-send-email-gabriel@krisman.be> X-URL: http://blog.sergiodj.net Date: Sun, 26 Apr 2015 18:44:00 -0000 Message-ID: <87lhhe91be.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00976.txt.bz2 On Saturday, April 25 2015, Gabriel Krisman Bertazi wrote: > gdb/testsuite/ > > * gdb.base/catch-syscall.exp (do_syscall_tests): Add call > to test_catch_syscall_group. > (test_catch_syscall_group): New. Hey, Thanks for this third version. I think we're almost there :-). > --- > gdb/testsuite/gdb.base/catch-syscall.exp | 37 ++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp > index df0004a..c65c8e3 100644 > --- a/gdb/testsuite/gdb.base/catch-syscall.exp > +++ b/gdb/testsuite/gdb.base/catch-syscall.exp > @@ -269,6 +269,40 @@ proc test_catch_syscall_fail_nodatadir {} { > } > } > > +proc test_catch_syscall_group {} { > + global decimal > + > + set sysnum "\\\[${decimal}\\\]" > + > + gdb_test "catch syscall g:process" \ > + "Catchpoint $decimal \\(syscalls (\'(clone|fork|execve|exit)\' $sysnum)+.*" \ > + "set catchpoint on a group of syscalls" > + > + gdb_test "catch syscall group:process read" \ > + "Catchpoint $decimal \\(syscalls (\'(clone|fork|execve|exit)\' $sysnum)+.*read.*\\)" \ > + "set catchpoints on a group of syscalls and on a single syscall" > + > + gdb_test "catch syscall group:" \ > + "Unknown syscall group.*" \ > + "set catchpoints on an invalid group" You should use a full-anchored regex here. You know exactly what to expect from the command, so match it literally. > + > + gdb_test "catch syscall g:junk" \ > + "Unknown syscall group.*" \ > + "set catchpoints on an unknown group." Same here. > + > + gdb_test "complete catch syscall g:proc" \ > + "catch syscall g:process" \ > + "complete catch syscall group with 'g:' prefix" > + > + gdb_test "complete catch syscall group:proc" \ > + "catch syscall group:process" \ > + "complete catch syscall group with 'group:' prefix" > + > + gdb_test "complete catch syscall g" \ > + ".*group:process.*" \ > + "complete catch syscall group suggests 'group:' prefix" What you can do here, assuming that all targets have the same groups, is to use gdb_test_sequence and match all the "catch syscall group:XYZ" entries. Maybe that is too strict (it assumes that future targets will also have to implement the exact same groups), but I think it is OK doing that now and adjusting this in the future if we need. > +} > + > proc do_syscall_tests {} { > # NOTE: We don't have to point gdb at the correct data-directory. > # For the build tree that is handled by INTERNAL_GDBFLAGS. > @@ -309,6 +343,9 @@ proc do_syscall_tests {} { > # Testing if the 'catch syscall' command works when switching to > # different architectures on-the-fly (PR gdb/10737). > if [runto_main] then { test_catch_syscall_multi_arch } > + > + # Testing the 'catch' syscall command for a group of syscalls. > + if [runto_main] then { test_catch_syscall_group } > } > > proc test_catch_syscall_without_args_noxml {} { > -- > 1.9.3 Other than that, this part is OK, but I am not a global maintainer to approve. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/