From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1517 invoked by alias); 5 Sep 2009 07:36:17 -0000 Received: (qmail 1509 invoked by uid 22791); 5 Sep 2009 07:36:16 -0000 X-SWARE-Spam-Status: No, hits=2.4 required=5.0 tests=AWL,BAYES_00,BOTNET,RCVD_IN_JMF_BL,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout1.012.net.il (HELO mtaout1.012.net.il) (84.95.2.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 05 Sep 2009 07:36:10 +0000 Received: from conversion-daemon.i-mtaout1.012.net.il by i-mtaout1.012.net.il (HyperSendmail v2007.08) id <0KPH00800MG7LC00@i-mtaout1.012.net.il> for gdb-patches@sourceware.org; Sat, 05 Sep 2009 10:36:07 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.228.50.163]) by i-mtaout1.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KPH005ACMG76360@i-mtaout1.012.net.il>; Sat, 05 Sep 2009 10:36:07 +0300 (IDT) Date: Sat, 05 Sep 2009 07:36:00 -0000 From: Eli Zaretskii Subject: Re: [RFC 3/3] catch syscall -- try 6 -- Build system, testcase and documentation In-reply-to: <200909041600.53576.sergiodj@linux.vnet.ibm.com> To: =?iso-8859-1?q?S=E9rgio_Durigan_J=FAnior?= Cc: gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83my594zgu.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 8BIT References: <200909041600.53576.sergiodj@linux.vnet.ibm.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00115.txt.bz2 > From: Sérgio_Durigan_Júnior > 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.