This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC 3/3] catch syscall -- try 6 -- Build system, testcase and documentation
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Sérgio Durigan Júnior <sergiodj at linux dot vnet dot ibm dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sat, 05 Sep 2009 10:34:09 +0300
- Subject: Re: [RFC 3/3] catch syscall -- try 6 -- Build system, testcase and documentation
- References: <200909041600.53576.sergiodj@linux.vnet.ibm.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> 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.