From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3861 invoked by alias); 14 Nov 2014 23:00:29 -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 3840 invoked by uid 89); 14 Nov 2014 23:00:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 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; Fri, 14 Nov 2014 23:00:21 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sAEN0HuU027592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 14 Nov 2014 18:00:17 -0500 Received: from localhost (dhcp-10-15-16-169.yyz.redhat.com [10.15.16.169]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sAEN0Fbo019779 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 14 Nov 2014 18:00:16 -0500 From: Sergio Durigan Junior To: Gabriel Krisman Bertazi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/4] Create syscall groups for x86_64. References: <1414956944-8856-1-git-send-email-gabriel@krisman.be> <1414956944-8856-4-git-send-email-gabriel@krisman.be> X-URL: http://blog.sergiodj.net Date: Fri, 14 Nov 2014 23:00:00 -0000 In-Reply-To: <1414956944-8856-4-git-send-email-gabriel@krisman.be> (Gabriel Krisman Bertazi's message of "Sun, 2 Nov 2014 17:35:43 -0200") Message-ID: <87ppcp75hd.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: 2014-11/txt/msg00342.txt.bz2 On Sunday, November 02 2014, Gabriel Krisman Bertazi wrote: > This commit introduces the following syscall groups for the x86_64 > architecture: memory, ipc, process, descriptor, signal and file. > > Please note that the sorting of the syscalls among these several groups > follows the same structure used in strace. > > This also introduces tests for catching groups of syscalls on the x86_64 > architecture. I guess I said that before, but just in case I didn't: I would prefer if this patch already updated the other architectures as well. IIUC you are planning to do that in another series of patches, but it would be good if you did everything at once, I think. However, I will not oppose if you decide to touch only on x86_64 for now. Other than that, I have only one comment. > gdb/ > > * syscalls/amd64-linux.xml: Add 'groups' attribute to several > syscalls on x86_64. Create groups memory, ipc, file, > descriptor, process and signal. > > gdb/testsuite/ > > * gdb.base/catch-syscall.exp (do_syscall_tests): Add call > to test_catch_syscall_group. > (test_catch_syscall_group): New. > --- > gdb/syscalls/amd64-linux.xml | 362 +++++++++++++++---------------- > gdb/testsuite/gdb.base/catch-syscall.exp | 33 +++ > 2 files changed, 214 insertions(+), 181 deletions(-) > > diff --git a/gdb/syscalls/amd64-linux.xml b/gdb/syscalls/amd64-linux.xml > index 6a04218..974c5b5 100644 > --- a/gdb/syscalls/amd64-linux.xml > +++ b/gdb/syscalls/amd64-linux.xml > @@ -14,101 +14,101 @@ > The file mentioned above belongs to the Linux Kernel. --> > > > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > - > - > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > + > + > > > > > > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > > > @@ -141,18 +141,18 @@ > > > > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > > > - > - > + > + > > > > @@ -163,26 +163,26 @@ > > > > - > - > - > - > + > + > + > + > > > - > + > > > - > + > > > - > + > > - > + > > - > - > - > - > + > + > + > + > > > > @@ -193,7 +193,7 @@ > > > > - > + > > > > @@ -201,20 +201,20 @@ > > > > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > > > @@ -227,15 +227,15 @@ > > > > - > + > > > - > - > + > + > > > - > - > + > + > > > > @@ -245,15 +245,15 @@ > > > > - > - > - > - > - > + > + > + > + > + > > - > - > - > + > + > + > > > > @@ -261,54 +261,54 @@ > > > > - > + > > > > > > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > - > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > + > > diff --git a/gdb/testsuite/gdb.base/catch-syscall.exp b/gdb/testsuite/gdb.base/catch-syscall.exp > index a70534c..de92735 100644 > --- a/gdb/testsuite/gdb.base/catch-syscall.exp > +++ b/gdb/testsuite/gdb.base/catch-syscall.exp > @@ -275,6 +275,36 @@ proc test_catch_syscall_fail_nodatadir {} { > } > } > > +proc test_catch_syscall_group {} { > + global decimal > + > + # Until we have syscall groups to test on other targets. > + if { ![istarget "x86_64-*-linux*"] } then { > + return > + } > + set sysnum "\\\[\[0-9\]+\\\]" This could be "\\\[${decimal}\\\]" right? > + > + 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 g: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 "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" > +} > + > 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. > @@ -311,6 +341,9 @@ proc do_syscall_tests {} { > # Testing the 'catch' syscall command during a restart of > # the inferior. > if [runto_main] then { test_catch_syscall_restarting_inferior } > + > + # 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 This patch looks good to me (I am not the maintainer of this part of the code). -- Sergio GPG key ID: 0x65FC5E36 Please send encrypted e-mail if possible http://sergiodj.net/