From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19044 invoked by alias); 26 Nov 2009 15:39:18 -0000 Received: (qmail 19029 invoked by uid 22791); 26 Nov 2009 15:39:16 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Nov 2009 15:39:10 +0000 Received: from eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id nAQFbVtI014687; Thu, 26 Nov 2009 09:38:45 -0600 Received: from EUSAACMS0703.eamcs.ericsson.se ([169.254.1.228]) by eusaamw0711.eamcs.ericsson.se ([147.117.20.178]) with mapi; Thu, 26 Nov 2009 10:37:21 -0500 From: Marc Khouzam To: Hui Zhu , Pedro Alves , Daniel Jacobowitz , Michael Snyder CC: "gdb@sourceware.org" Date: Thu, 26 Nov 2009 17:16:00 -0000 Subject: RE: A question about gdb script Message-ID: References: <20091125151151.GA28302@caradoc.them.org> <200911251606.07095.pedro@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-11/txt/msg00193.txt.bz2 =20 > -----Original Message----- > From: gdb-owner@sourceware.org=20 > [mailto:gdb-owner@sourceware.org] On Behalf Of Hui Zhu > Sent: November-26-09 9:30 AM > To: Pedro Alves; Daniel Jacobowitz; Michael Snyder > Cc: gdb@sourceware.org > Subject: Re: A question about gdb script >=20 > On Thu, Nov 26, 2009 at 00:06, Pedro Alves=20 > wrote: > > On Wednesday 25 November 2009 15:11:51, Daniel Jacobowitz wrote: > >> > 2. =A0Sometime, I want just record a function, I want: > >> > b functon_name > >> > commands > >> > silent > >> > record > >> > finish > >> > #Maybe we can record save in this line, this is first question. > >> > record stop > >> > end > >> > But when I really do it. =A0I found that gdb stop running=20 > after finish. > >> > > >> > Could you help me with them? > >> > >> This is a known limitation of breakpoint commands. =A0It's very > >> difficult. > > > > Try using the hook-stop instead. =A0Something like this: > > > > =A0set $stop_recording_on_next_stop=3D0 > > > > =A0b functon_name > > =A0commands > > =A0silent > > =A0record > > =A0set $stop_recording_on_next_stop=3D1 > > =A0finish > > =A0end > > > > =A0define hook-stop > > =A0 if $stop_recording_on_next_stop > > =A0 =A0 set $stop_recording_on_next_stop=3D0 > > =A0 =A0 record save > > =A0 =A0 record stop > > =A0 =A0 end > > =A0 end > > >=20 > Cool. I change hook-stop to: > define hook-stop > if $stop_recording_on_next_stop > set $stop_recording_on_next_stop=3D0 > record save > record stop > c > end > end >=20 > It looks not bad, but got a lot of: > ---Type to continue, or q to quit---q I think the command set pagination off will prevent this. > If you don't mind, I will post a patch to change each fprintf_filtered > in record.c to fprintf_unfiltered. >=20 > Thanks, > Hui >=20