From patchwork Fri May 20 02:55:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 12406 Received: (qmail 42758 invoked by alias); 20 May 2016 02:56:15 -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 42729 invoked by uid 89); 20 May 2016 02:56:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.2 spammy=Hx-languages-length:2365 X-HELO: layla.krisman.be Received: from layla.krisman.be (HELO layla.krisman.be) (176.31.208.35) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 20 May 2016 02:56:12 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (envelope-from ) id 1b3aAt-0002OC-Ig; Fri, 20 May 2016 04:28:28 +0200 From: Gabriel Krisman Bertazi To: gdb-patches@sourceware.org Cc: palves@redhat.com, sergiodj@redhat.com, dje@google.com, Gabriel Krisman Bertazi Subject: [PATCH v6 3/5] Add tests for catching groups of syscalls on supported architectures. Date: Thu, 19 May 2016 23:55:46 -0300 Message-Id: <1463712948-9068-3-git-send-email-gabriel@krisman.be> In-Reply-To: <1463712948-9068-1-git-send-email-gabriel@krisman.be> References: <87shxd1mx2.fsf@oberon.home> <1463712948-9068-1-git-send-email-gabriel@krisman.be> X-IsSubscribed: yes gdb/testsuite/ * gdb.base/catch-syscall.exp (do_syscall_tests): Add call to test_catch_syscall_group. (test_catch_syscall_group): New. --- gdb/testsuite/gdb.base/catch-syscall.exp | 39 ++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp index 5679000..e55bd70 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.exp +++ b/gdb/testsuite/gdb.base/catch-syscall.exp @@ -370,6 +370,42 @@ 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" + + gdb_test "catch syscall g:junk" \ + "Unknown syscall group 'junk'\." \ + "set catchpoints on an unknown group." + + 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_sequence "complete catch syscall g" \ + "complete catch syscall group suggests 'group:' prefix" { + "group:descriptor" "group:file" "group:ipc" "group:memory" + "group:network" "group:process" "group:signal" + } +} + 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. @@ -420,6 +456,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 {} {