From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20746 invoked by alias); 27 Nov 2009 07:55:34 -0000 Received: (qmail 20737 invoked by uid 22791); 27 Nov 2009 07:55:33 -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; Fri, 27 Nov 2009 07:55:26 +0000 Received: by pwi1 with SMTP id 1so545176pwi.8 for ; Thu, 26 Nov 2009 23:55:25 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.27.2 with SMTP id e2mr69886wfj.202.1259308525096; Thu, 26 Nov 2009 23:55:25 -0800 (PST) In-Reply-To: <20091127013738.GL18141@adacore.com> References: <4B0EF39A.10802@vmware.com> <20091127013738.GL18141@adacore.com> From: Hui Zhu Date: Fri, 27 Nov 2009 15:17:00 -0000 Message-ID: Subject: Re: [RFC] syntax change for "record save" To: Joel Brobecker Cc: Michael Snyder , 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/msg00204.txt.bz2 Hi Joel, I think python must can make prec work very powerful. But let record save can do small thing can make it more flexible. It still can be use when the gdb did't support python. BTW, maybe we can put example about use prec together with python to wiki. Thanks, Hui On Fri, Nov 27, 2009 at 09:37, Joel Brobecker wrote: >> 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. =A0In particular, it's easy to compose the > right CLI command from python using: > > =A0 =A0(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... =A0Combine 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 >