From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16811 invoked by alias); 25 Nov 2009 16:06:16 -0000 Received: (qmail 16716 invoked by uid 22791); 25 Nov 2009 16:06:16 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Nov 2009 16:06:10 +0000 Received: (qmail 8176 invoked from network); 25 Nov 2009 16:06:08 -0000 Received: from unknown (HELO orlando) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Nov 2009 16:06:08 -0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: A question about gdb script Date: Thu, 26 Nov 2009 08:51:00 -0000 User-Agent: KMail/1.9.10 Cc: Daniel Jacobowitz , Hui Zhu References: <20091125151151.GA28302@caradoc.them.org> In-Reply-To: <20091125151151.GA28302@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200911251606.07095.pedro@codesourcery.com> 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/msg00189.txt.bz2 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. > >=20 > > Could you help me with them? >=20 > This is a known limitation of breakpoint commands. =A0It's very > difficult. Try using the hook-stop instead. Something like this: set $stop_recording_on_next_stop=3D0 b functon_name commands silent record set $stop_recording_on_next_stop=3D1 finish end define hook-stop if $stop_recording_on_next_stop=20 set $stop_recording_on_next_stop=3D0 record save record stop end end --=20 Pedro Alves