Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: Gabriel Krisman Bertazi <gabriel@krisman.be>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC PATCH 0/3] Catch syscall group
Date: Wed, 08 Oct 2014 16:12:00 -0000	[thread overview]
Message-ID: <CADPb22Q4K5MfZ5Q4ebD-KfkFJ16xv-RYxVeCw0+-dkC6CkgmeQ@mail.gmail.com> (raw)
In-Reply-To: <1412736678-2760-1-git-send-email-gabriel@krisman.be>

On Tue, Oct 7, 2014 at 10:51 PM, Gabriel Krisman Bertazi
<gabriel@krisman.be> wrote:
> Hello,
>
> This multi-part patch implements on top of the 'catch syscall' command
> the ability to catch a group of related syscalls using a single
> command.
>
> The idea is to be able to catch a group of syscalls with a single
> command, just like we can do with the "-e trace" option in strace.  We
> separate the syscalls in groups according to their functionality and
> allow users to say:
>
> (gdb) catch syscall network
>
> This creates a catchpoint for every network related syscall, such as
> bind, accept, connect...
>
> (Please note that adding this feature to GDB was first suggested by Tom
> Tromey on PR 15879. :-)
>  <https://sourceware.org/bugzilla/show_bug.cgi?id=15879>).
>
> Right now, I've created syscall groups only for x86_64 and sorted the
> syscalls among them by using the same groups that strace has.
>
> I am sending this as an RFC because I still have a few questions before
> proposing this as a patch:
>
> 1) Whether a feature like this would be acceptable on GDB?

I think so.

> 2) About the command to catch syscall groups: I think it is more
> practical to just say "catch syscall network", instead of "catch syscall
> group network" or something like that.  What would be the GDB way to do
> that?  (I implemented the former, but I'd be happy to rewrite
> this part of the patch.)

I dunno.  I think I prefer "catch syscall-group ...".

> 3) I think it is nice to have a command to list the syscall groups
> available.  Maybe by saying "catch syscall group" with no arguments.
> What do you think?

It's too bad "catch syscall" catches any syscall, then "catch syscall"
could list them all. :-)
[To catch any syscall I'd have been ok with "catch syscall all".
Probably too late though - we certainly can't change the meaning of
"catch syscall".]

Playing around I found "complete catch syscall ." is a workaround.
Other non-alnum characters work too.  I'm not suggesting this as a
proper solution. :-)
And it's probably a bug we should fix. :-)

I think we do need a solution to this though.  At least in the case of
syscalls themselves, there's too many to include in the output of
"help catch syscall".

> 4) What kind of documentation should be updated when proposing the
> patch?  Do I have to update only the GDB manual or should I provide
> patches for other documentation as well?

doc/gdb.texinfo and NEWS

> 5) Regarding the code design I propose here, do you have any concerns
> that I should fix right away before submiting this as a patch?  Please
> share your thoughts :)

Have to spend a bit more time on this.
I thought we'd get some high level details ironed out first (in an
attempt to save you some typing).

> This patch series is divided as follows: Part 1 updates the xml-syscall
> interface to support the syscall group feature; Part 2 has the actual
> catchpoint code; Finally, Part 3 has the updated x86_64 xml, which
> defines the syscall groups for this architecture, and includes tests for
> this feature on x86_64.
>
> This presents no regressions on Fedora 20 x86 and x86_64.
>
> Thanks!
>
> Gabriel Krisman Bertazi (3):
>   Implemement support for groups of syscalls in the xml-syscall
>     interface.
>   Add support to catch groups of syscalls.
>   Create syscall groups for x86_64.
>
>  gdb/breakpoint.c                         |  73 +++++--
>  gdb/syscalls/amd64-linux.xml             | 362 +++++++++++++++----------------
>  gdb/syscalls/gdb-syscalls.dtd            |   1 +
>  gdb/testsuite/gdb.base/catch-syscall.exp |  25 +++
>  gdb/xml-syscall.c                        | 183 +++++++++++++++-
>  gdb/xml-syscall.h                        |  12 +
>  6 files changed, 453 insertions(+), 203 deletions(-)
>
> --
> 1.9.3
>


      parent reply	other threads:[~2014-10-08 16:12 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08  2:51 Gabriel Krisman Bertazi
2014-10-08  2:51 ` [RFC PATCH 2/3] Add support to catch groups of syscalls Gabriel Krisman Bertazi
2014-10-08 19:07   ` Sergio Durigan Junior
2014-10-08 19:46     ` Doug Evans
2014-10-08 20:48       ` Sergio Durigan Junior
2014-10-12 21:37         ` Gabriel Krisman Bertazi
2014-10-12 22:52           ` Sergio Durigan Junior
2014-10-13 16:49           ` Doug Evans
2014-10-20  4:52             ` Gabriel Krisman Bertazi
2014-10-20 19:39               ` Sergio Durigan Junior
2014-10-27 19:20                 ` Doug Evans
2014-10-08  2:51 ` [RFC PATCH 1/3] Implemement support for groups of syscalls in the xml-syscall interface Gabriel Krisman Bertazi
2014-10-08 17:21   ` Sergio Durigan Junior
2014-10-08  2:52 ` [RFC PATCH 3/3] Create syscall groups for x86_64 Gabriel Krisman Bertazi
2014-10-08 19:00   ` Sergio Durigan Junior
2014-10-08 16:10 ` [RFC PATCH 0/3] Catch syscall group Sergio Durigan Junior
2014-10-12 21:12   ` Gabriel Krisman Bertazi
2014-10-12 22:55     ` Sergio Durigan Junior
2014-10-08 16:12 ` Doug Evans [this message]

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=CADPb22Q4K5MfZ5Q4ebD-KfkFJ16xv-RYxVeCw0+-dkC6CkgmeQ@mail.gmail.com \
    --to=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