From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13472 invoked by alias); 27 Nov 2009 01:37:51 -0000 Received: (qmail 13464 invoked by uid 22791); 27 Nov 2009 01:37:50 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Nov 2009 01:37:42 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2E2D82BABEF; Thu, 26 Nov 2009 20:37:41 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OB0wQQACyazE; Thu, 26 Nov 2009 20:37:41 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9A6302BABBE; Thu, 26 Nov 2009 20:37:40 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 8B87FF5905; Thu, 26 Nov 2009 17:37:38 -0800 (PST) Date: Fri, 27 Nov 2009 07:55:00 -0000 From: Joel Brobecker To: Michael Snyder Cc: gdb@sourceware.org, Hui Zhu Subject: Re: [RFC] syntax change for "record save" Message-ID: <20091127013738.GL18141@adacore.com> References: <4B0EF39A.10802@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B0EF39A.10802@vmware.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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/msg00201.txt.bz2 > This proposal follows from Teawater's thread > "A question about gdb script", in which Teawater > wants to know how to use a gdb local variable > to append a sequence number to the file name > of a record log file. This is not an objection, but I am really not fond of that extension. It feels ad hoc that the extension, if provided, should be evaluated as an integer. What if the user wanted a more general scheme? Or what if he wanted to the suffix to be in hex? If I were Teawater, I'd probably look at writing a python script rather than a GDB script. In particular, it's easy to compose the right CLI command from python using: (gdb) python gdb.execute("rec save file.%d" % 1) You can replace the "1" above by an python variable, including one obtained by evaluating an expression as a long. One thing that you might want to look at, to make things even easier, is providing a Python interface to the record layer... Combine that with the work done on getting inferior "events" (I can't remember exactly the name of that project - I think it was a GSOC), and it should be possible to script really nice things... -- Joel