This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH 2/3] Add support to catch groups of syscalls.


Sergio Durigan Junior <sergiodj@redhat.com> writes:

> 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...

Doug and Sergio,

Thank you for your review and valuable suggestions.

The suggestion I feel more comfortable with is using -g for each syscall
group.  I agree that syscall groups should be treated on a different
namespace than syscall names, which are the expected argument for a
command called  "catch syscall".

>> 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?

I dislike the proposal of adding prefixes/suffixes to the group names
because I feel it might be harder to type, and also because it feels a
little unusual, if we consider the common way of providing arguments to
commands.

Using -g to specify syscall groups, as Sergio said, has also the
advantage of providing us with an intuitive command to list available
syscall groups, by saying "catch syscall -g" with no arguments.

So, my vote goes to using '-g' for each syscall group we want to
catch. Is that ok for you, guys?

I will still wait a few days to see if anyone has more suggestions
before sending the updated patch that fixes the syntax and the other
things you guys pointed out.

Thanks!

-- 
Gabriel Krisman Bertazi

Attachment: pgpbXaqAyAlu9.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]