Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Doug Evans <dje@google.com>
Cc: Gabriel Krisman Bertazi <gabriel@krisman.be>,
	       gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [RFC PATCH 2/3] Add support to catch groups of syscalls.
Date: Wed, 08 Oct 2014 20:48:00 -0000	[thread overview]
Message-ID: <87siiy9vis.fsf@redhat.com> (raw)
In-Reply-To: <CADPb22Q6Uw0qf9iOBzNHvqn6iRiqx7+c5_HfjGwJB495F0d_tQ@mail.gmail.com>	(Doug Evans's message of "Wed, 8 Oct 2014 12:46:18 -0700")

On Wednesday, October 08 2014, Doug Evans wrote:

> Regarding:
>> # catch syscalls write, read, chdir, and groups network and signal
>> (gdb) catch syscall write read chdir -g network,signal
>> # or maybe without comma-separated values for groups, to keep consistency
>> (gdb) catch syscall write read chdir -g network signal
>
> I dislike "network,signal" if we don't also accept "read,write".  I
> gather the comma is there to remove ambiguity as to what "-g network
> signal" means.

Yeah.

> I also kinda dislike interpreting "-g" to mean all remaining arguments
> (for a few reasons).

Since there are very few groups (compared to syscalls names), I also
thought that "-g" could be used multiple times, like:

  (gdb) catch syscall -g network -g signal

But...

> "catch syscall write -g network" feels clumsy if I can't also do
> something like "catch syscall -g network -s write" or some such).

... this comment also applies even if we consider "-g" to refer to the
next argument.

However, while I understand your feeling that having "-g" without having
"-s" seems odd, I don't think I completely agree.  I think that syscall
groups are meta-information, and deserved to be treated differently.
The command name "catch syscall" makes the user understand immediately
what kind of argument the command expects (i.e., a syscall).  It would
be weird to make the user need to issue a "-s" to specify a syscall
name.

I am trying to think what would happen if we were talking about
breakpoints and breakpoint groups.  I think it would be fairly
reasonable to have a syntax like:

  (gdb) break -g mygroup

And not expect something like:

  (gdb) break -b function

Do you see what I mean?

> One could just say that syscall names and syscall group names share
> the same namespace, but
> I can imagine a system that happens to have a syscall that is the name
> of a group on another system.

Yes, that is the rationale behind my proposal.  And I don't think
syscall group names and syscall names share the same namespace, as
explained above.

> E.g., maybe there's a system where "signal" is a syscall.  It's a
> logical name for the group.
> Then if one happened to be unfortunate enough to work with two systems
> where "signal" is a syscall name on one system and a group name on
> another system, I can imagine tripping over the use of the same name
> to mean different things and getting frustrated.
>
> How about appending "-group" or some such to group names?

Hm, it seems OK, but I am thinking about one specific syscall that might
make things confusing here: exit_group(2).  Consider:

  (gdb) catch syscall signal-group exit_group

This can be very confusing for the user.

> [I don't want to have too long a discussion or be too picky.
> OTOH I also don't want to just pick something and then regret it.]

Yeah, I understand your reasons.

Along the lines of your proposal above, I guess we can add a "g:" prefix
to group names:

  (gdb) catch syscall read chdir g:network g:signal signal

WDYT?

-- 
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/


  reply	other threads:[~2014-10-08 20:48 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08  2:51 [RFC PATCH 0/3] Catch syscall group 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 [this message]
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

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=87siiy9vis.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