From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9157 invoked by alias); 25 Nov 2009 19:19:42 -0000 Received: (qmail 9147 invoked by uid 22791); 25 Nov 2009 19:19:41 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Nov 2009 19:19:37 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 77100804C; Wed, 25 Nov 2009 11:19:35 -0800 (PST) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost4.vmware.com (Postfix) with ESMTP id 6EE98C9A1D; Wed, 25 Nov 2009 11:19:35 -0800 (PST) Message-ID: <4B0D8250.8010705@vmware.com> Date: Thu, 26 Nov 2009 15:39:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20090624) MIME-Version: 1.0 To: Hui Zhu CC: "gdb@sourceware.org" Subject: Re: A question about gdb script References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00190.txt.bz2 Hui Zhu wrote: > 1. If I want get the gdb_record.xxx file of each record cycle. It's > still hard to me. Because if I add "record save" to commands, each > time it will save record entry to same file. > Does gdb have some way to handle it? like: > $a=1 > record save $a > $a++ If you look at cmd_record_save, you see it has (char *args). GDB will pass "$a" as "args", so at that point you have the opportunity to say, eg. "if (args[0] == '$') then do something". One possibility would be to create your default name, eg. gdb_record.12345, and then append $a making gdb_record.12345.1 That's the quick and dirty way. Something more elegant might be better. > 2. Sometime, 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. I found that gdb stop running after finish. That is unfortunately a long-standing gdb "limitation" (I mean , known bug). It is so old that it is not likely to be fixed soon.