From: Gabriel Krisman Bertazi <gabriel@krisman.be>
To: gdb-patches@sourceware.org
Cc: palves@redhat.com, sergiodj@redhat.com, dje@google.com,
Gabriel Krisman Bertazi <gabriel@krisman.be>
Subject: [PATCH v6 5/5] Update documentation on catching a group of related syscalls.
Date: Fri, 20 May 2016 02:56:00 -0000 [thread overview]
Message-ID: <1463712948-9068-5-git-send-email-gabriel@krisman.be> (raw)
In-Reply-To: <1463712948-9068-1-git-send-email-gabriel@krisman.be>
gdb/
* break-catch-syscall.c (_initialize_breakpoint): Update catch
syscall command documentation.
* NEWS: Include section about catching groups of syscalls.
gdb/doc/
* gdb.texinfo (Set Catchpoints): Add 'group' argument to catch
syscall.
---
gdb/NEWS | 5 +++++
gdb/break-catch-syscall.c | 10 +++++-----
gdb/doc/gdb.texinfo | 28 +++++++++++++++++++++++++++-
3 files changed, 37 insertions(+), 6 deletions(-)
diff --git a/gdb/NEWS b/gdb/NEWS
index 3e8e7a1..5fa8500 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -32,6 +32,11 @@
language. See https://www.rust-lang.org/ for more information about
Rust.
+* The "catch syscall" command catches groups of related syscalls.
+
+ The "catch syscall" command now supports catching a group of related
+ syscalls using the 'group:' or 'g:' prefix.
+
* New commands
skip -file file
diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c
index c564b8f..602aba4 100644
--- a/gdb/break-catch-syscall.c
+++ b/gdb/break-catch-syscall.c
@@ -724,11 +724,11 @@ _initialize_break_catch_syscall (void)
catch_syscall_inferior_data_cleanup);
add_catch_command ("syscall", _("\
-Catch system calls by their names and/or numbers.\n\
-Arguments say which system calls to catch. If no arguments\n\
-are given, every system call will be caught.\n\
-Arguments, if given, should be one or more system call names\n\
-(if your system supports that), or system call numbers."),
+Catch system calls by their names, groups and/or numbers.\n\
+Arguments say which system calls to catch. If no arguments are given,\n\
+every system call will be caught. Arguments, if given, should be one\n\
+or more system call names (if your system supports that), system call\n\
+groups or system call numbers."),
catch_syscall_command_1,
catch_syscall_completer,
CATCH_PERMANENT,
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 42d1a63..da98fdb 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -4375,7 +4375,7 @@ A failed Ada assertion.
A call to @code{exec}.
@item syscall
-@itemx syscall @r{[}@var{name} @r{|} @var{number}@r{]} @dots{}
+@itemx syscall @r{[}@var{name} @r{|} @var{number} @r{|} @r{group:}@var{groupname} @r{|} @r{g:}@var{groupname}@r{]} @dots{}
@kindex catch syscall
@cindex break on a system call.
A call to or return from a system call, a.k.a.@: @dfn{syscall}. A
@@ -4410,6 +4410,15 @@ may be useful if @value{GDBN}'s database does not have the complete
list of syscalls on your system (e.g., because @value{GDBN} lags
behind the OS upgrades).
+You may specify a group of related syscalls to be caught at once using
+the @code{group:} syntax (@code{g:} is a shorter equivalent). For
+instance, on some platforms @value{GDBN} allows you to catch all
+network related syscalls, by passing the argument @code{group:network}
+to @code{catch syscall}. Note that not all syscall groups are
+available in every system. You can use the command completion
+facilities (@pxref{Completion,, command completion}) to list the
+syscall groups available on your environment.
+
The example below illustrates how this command works if you don't provide
arguments to it:
@@ -4466,6 +4475,23 @@ Program exited normally.
(@value{GDBP})
@end smallexample
+Here is an example of catching a syscall group:
+
+@smallexample
+(@value{GDBP}) catch syscall group:process
+Catchpoint 1 (syscalls 'exit' [1] 'fork' [2] 'waitpid' [7]
+'execve' [11] 'wait4' [114] 'clone' [120] 'vfork' [190]
+'exit_group' [252] 'waitid' [284] 'unshare' [310])
+(@value{GDBP}) r
+Starting program: /tmp/catch-syscall
+
+Catchpoint 1 (call to syscall fork), 0x00007ffff7df4e27 in open64 ()
+ from /lib64/ld-linux-x86-64.so.2
+
+(@value{GDBP}) c
+Continuing.
+@end smallexample
+
However, there can be situations when there is no corresponding name
in XML file for that syscall number. In this case, @value{GDBN} prints
a warning message saying that it was not able to find the syscall name,
--
2.4.11
next prev parent reply other threads:[~2016-05-20 2:56 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 17:28 [PATCH v5 4/5] Include group information to xml syscall files Doug Evans
2016-05-20 2:30 ` Gabriel Krisman Bertazi
2016-05-20 2:56 ` [PATCH v6 1/5] Implemement support for groups of syscalls in the xml-syscall interface Gabriel Krisman Bertazi
2016-05-20 2:56 ` [PATCH v6 3/5] Add tests for catching groups of syscalls on supported architectures Gabriel Krisman Bertazi
2016-05-26 18:18 ` Sergio Durigan Junior
2016-05-20 2:56 ` [PATCH v6 2/5] Add support to catch groups of syscalls Gabriel Krisman Bertazi
2016-05-26 18:17 ` Sergio Durigan Junior
2016-05-20 2:56 ` Gabriel Krisman Bertazi [this message]
2016-05-20 5:48 ` [PATCH v6 5/5] Update documentation on catching a group of related syscalls Eli Zaretskii
2016-05-26 18:22 ` [PATCH v6 1/5] Implemement support for groups of syscalls in the xml-syscall interface Sergio Durigan Junior
2016-05-20 3:10 ` [RESEND PATCH v6 4/5] Include group information to xml syscall files Gabriel Krisman Bertazi
2016-05-26 18:14 ` Sergio Durigan Junior
2016-05-27 10:18 ` Pedro Alves
2016-06-19 20:37 ` Gabriel Krisman Bertazi
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=1463712948-9068-5-git-send-email-gabriel@krisman.be \
--to=gabriel@krisman.be \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=sergiodj@redhat.com \
/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