From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12435 invoked by alias); 26 Nov 2009 08:30:50 -0000 Received: (qmail 12426 invoked by uid 22791); 26 Nov 2009 08:30:49 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pw0-f49.google.com (HELO mail-pw0-f49.google.com) (209.85.160.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Nov 2009 08:30:41 +0000 Received: by pwj21 with SMTP id 21so409411pwj.8 for ; Thu, 26 Nov 2009 00:30:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.2.14 with SMTP id 14mr972642wfb.93.1259224240234; Thu, 26 Nov 2009 00:30:40 -0800 (PST) In-Reply-To: <200911251606.07095.pedro@codesourcery.com> References: <20091125151151.GA28302@caradoc.them.org> <200911251606.07095.pedro@codesourcery.com> From: Hui Zhu Date: Thu, 26 Nov 2009 15:54:00 -0000 Message-ID: Subject: Re: A question about gdb script To: Pedro Alves , Daniel Jacobowitz , Michael Snyder Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00191.txt.bz2 On Thu, Nov 26, 2009 at 00:06, Pedro Alves 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 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 > 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 It looks not bad, but got a lot of: ---Type to continue, or q to quit---q If you don't mind, I will post a patch to change each fprintf_filtered in record.c to fprintf_unfiltered. Thanks, Hui