public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH v5 3/5] Add tests for catching groups of syscalls on supported architectures.
@ 2016-05-17 16:56 Doug Evans
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Evans @ 2016-05-17 16:56 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: gdb-patches, palves, sergiodj

Gabriel Krisman Bertazi writes:
  > 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 {} {
  > --
  > 2.4.3
  >

LGTM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH v5 3/5] Add tests for catching groups of syscalls on supported architectures.
  2016-05-15 20:32 [PATCH v5 0/5] Catch syscall groups Gabriel Krisman Bertazi
@ 2016-05-15 20:32 ` Gabriel Krisman Bertazi
  0 siblings, 0 replies; 2+ messages in thread
From: Gabriel Krisman Bertazi @ 2016-05-15 20:32 UTC (permalink / raw)
  To: gdb-patches; +Cc: palves, sergiodj, dje, Gabriel Krisman Bertazi

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 {} {
-- 
2.4.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-17 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-17 16:56 [PATCH v5 3/5] Add tests for catching groups of syscalls on supported architectures Doug Evans
  -- strict thread matches above, loose matches on Subject: below --
2016-05-15 20:32 [PATCH v5 0/5] Catch syscall groups Gabriel Krisman Bertazi
2016-05-15 20:32 ` [PATCH v5 3/5] Add tests for catching groups of syscalls on supported architectures Gabriel Krisman Bertazi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).