Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Gabriel Krisman Bertazi <gabriel@krisman.be>
Cc: gdb-patches@sourceware.org, dje@google.com
Subject: Re: [PATCH v3 03/17] Add tests for catching groups of syscalls on supported architectures.
Date: Sun, 26 Apr 2015 18:44:00 -0000	[thread overview]
Message-ID: <87lhhe91be.fsf@redhat.com> (raw)
In-Reply-To: <1430011521-24340-4-git-send-email-gabriel@krisman.be>

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/


  reply	other threads:[~2015-04-26 18:44 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-26  1:25 [PATCH v3 00/17] Catch syscall group Gabriel Krisman Bertazi
2015-04-26  1:25 ` [PATCH v3 02/17] Add support to catch groups of syscalls Gabriel Krisman Bertazi
2015-04-26  1:25 ` [PATCH v3 03/17] Add tests for catching groups of syscalls on supported architectures Gabriel Krisman Bertazi
2015-04-26 18:44   ` Sergio Durigan Junior [this message]
2015-04-26  1:25 ` [PATCH v3 01/17] Implemement support for groups of syscalls in the xml-syscall interface Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 05/17] Create syscall groups for ppc Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 04/17] Create syscall groups for amd64 Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 08/17] Create syscall groups for arm Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 10/17] Create syscall groups for i386 Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 09/17] Create syscall groups for bfin Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 06/17] Create syscall groups for ppc64 Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 12/17] Create syscall groups for mips-n64 Gabriel Krisman Bertazi
2015-04-26  1:26 ` [PATCH v3 07/17] Create syscall groups for aarch64 Gabriel Krisman Bertazi
2015-04-26  1:47 ` [PATCH v3 17/17] Create syscall groups for sparc64 Gabriel Krisman Bertazi
2015-04-26  1:47 ` [PATCH v3 16/17] Create syscall groups for sparc Gabriel Krisman Bertazi
2015-04-26  1:47 ` [PATCH v3 11/17] Create syscall groups for mips-n32 Gabriel Krisman Bertazi
2015-04-26  1:47 ` [PATCH v3 13/17] Create syscall groups for mips-o32 Gabriel Krisman Bertazi
2015-04-26  1:47 ` [PATCH v3 14/17] Create syscall groups for s390 Gabriel Krisman Bertazi
2015-04-26  1:47 ` [PATCH v3 15/17] Create syscall groups for s390x Gabriel Krisman Bertazi
2015-04-26 18:58 ` [PATCH v3 00/17] Catch syscall group Sergio Durigan Junior
2015-04-28 11:24 ` Pedro Alves
2015-04-29  0:45   ` Sergio Durigan Junior
2015-04-29 10:44     ` Pedro Alves
2015-05-04  2:34       ` Gabriel Krisman Bertazi
2015-05-06 14:38         ` Pedro Alves
2015-05-10 18:34           ` Gabriel Krisman Bertazi
2015-05-10 19:01             ` Sergio Durigan Junior
2015-05-11  0:28               ` [PATCH v4 0/4] catch " Gabriel Krisman Bertazi
2015-05-11  0:28                 ` [PATCH v4 4/5] Include group information in xml syscall files Gabriel Krisman Bertazi
2015-05-12 21:42                   ` Doug Evans
2015-05-13  1:17                     ` Gabriel Krisman Bertazi
2015-05-13 10:43                   ` Pedro Alves
2015-05-11  0:28                 ` [PATCH v4 1/5] Implemement support for groups of syscalls in the xml-syscall interface Gabriel Krisman Bertazi
2015-05-11  0:28                 ` [PATCH v4 5/5] Update documentation on catching a group of related syscalls Gabriel Krisman Bertazi
2015-05-11  0:40                   ` Gabriel Krisman Bertazi
2015-05-13 10:30                     ` Pedro Alves
2015-05-13 16:40                       ` Eli Zaretskii
2015-05-11  0:28                 ` [PATCH v4 3/5] Add tests for catching groups of syscalls on supported architectures Gabriel Krisman Bertazi
2015-05-11  0:28                 ` [PATCH v4 2/5] Add support to catch groups of syscalls Gabriel Krisman Bertazi
2015-05-13 10:38                   ` Pedro Alves
2015-05-13 10:47                 ` [PATCH v4 0/4] catch syscall group Pedro Alves
2015-05-11 11:39               ` [PATCH v3 00/17] Catch " Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhhe91be.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=dje@google.com \
    --cc=gabriel@krisman.be \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox