Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Sérgio Durigan Júnior" <sergiodj@linux.vnet.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC 3/3] catch syscall -- try 6 -- Build system, testcase and documentation
Date: Sat, 05 Sep 2009 07:36:00 -0000	[thread overview]
Message-ID: <83my594zgu.fsf@gnu.org> (raw)
In-Reply-To: <200909041600.53576.sergiodj@linux.vnet.ibm.com>

> From: Sérgio_Durigan_Júnior <sergiodj@linux.vnet.ibm.com>
> Date: Fri, 4 Sep 2009 16:00:53 -0300
> 
> At last but not least, here is the patch that updates the build system,
> testcase and documentation parts of GDB.

Thanks.  I do have some comments, though (sorry).

> +* GDB now has the new command `catch syscall'.  It can be used to
> +catch when the inferior calls a system call, or when the system call
> +returns.  Also, you can specify which system calls you would like GDB
> +to catch (or issue only a `catch syscall' without arguments, which will
> +make GDB catch every system call).  For instance, if you would like to
> +catch the system call close, you would issue a:
> +
> +    (gdb) catch syscall close
> +
> +Then, when the program is running again, GDB will keep track of all
> +the system calls the inferior is calling, and will stop the execution
> +if the system call called or returned is equal to the system call
> +that you asked it to catch (note that if you did not provide any system
> +call, then GDB would stop on any system call).  After stopping the
> +inferior, GDB will print something like:
> +
> +    Catchpoint 1 (call to syscall 'close'),
> +    	0xb7ff831d in ?? () from /lib/ld-linux.so.2
> +
> +It indicates that the correct system call was caught.  If you choose
> +to continue the execution of the inferior from this point, then you
> +should see GDB catching the return of this system call, like that:
> +
> +    Catchpoint 1 (returned from syscall 'close'),
> +	   0xb7ff831d in ?? () from /lib/ld-linux.so.2
> +
> +This feature is available with a native GDB running on the Linux Kernel,
> +under the following architectures: x86, x86_64, PowerPC and PowerPC64.

This is okay, but much too long for a NEWS entry.  I suggest the
following shorter variant, which is similar to other NEWS entries:

    catch syscall [NAME(S) | NUMBER(S)]
      Catch system calls.  Arguments, which should be names of system
      calls or their numbers, mean catch only those syscalls.  Without
      arguments, every syscall will be caught.  When the inferior issues
      any of the specified syscalls, GDB will stop and announce the system
      call, both when it is called and when its call returns.  This
      feature is currently available with a native GDB running on the
      Linux Kernel, under the following architectures: x86, x86_64,
      PowerPC and PowerPC64.

Also, please put this entry in the "New commands" section of NEWS.

> --- a/gdb/doc/gdb.texinfo
> +++ b/gdb/doc/gdb.texinfo

This part is fine.

Thanks again for working on this.


  reply	other threads:[~2009-09-05  7:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 19:01 Sérgio Durigan Júnior
2009-09-05  7:36 ` Eli Zaretskii [this message]
2009-09-10 22:41   ` Sérgio Durigan Júnior
2009-09-11  7:51     ` Eli Zaretskii
2009-09-12  0:25       ` Sérgio Durigan Júnior
2009-09-12  8:17         ` Eli Zaretskii

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=83my594zgu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@linux.vnet.ibm.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