From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5100 invoked by alias); 1 Dec 2009 12:56:16 -0000 Received: (qmail 5084 invoked by uid 22791); 1 Dec 2009 12:56:15 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from oden.vtab.com (HELO oden.vtab.com) (62.20.90.195) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Dec 2009 12:56:05 +0000 Received: from oden.vtab.com (oden.vtab.com [127.0.0.1]) by oden.vtab.com (Postfix) with ESMTP id 56A5B26EF17; Tue, 1 Dec 2009 13:56:02 +0100 (CET) Received: from polhem (unknown [62.20.90.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by oden.vtab.com (Postfix) with ESMTP id 250CB26EF09; Tue, 1 Dec 2009 13:56:02 +0100 (CET) From: "Jakob Engblom" To: "'Joel Brobecker'" , "'Michael Snyder'" Cc: , "'Hui Zhu'" References: <4B0EF39A.10802@vmware.com> <20091127013738.GL18141@adacore.com> In-Reply-To: <20091127013738.GL18141@adacore.com> Subject: RE: [RFC] syntax change for "record save" Date: Tue, 01 Dec 2009 12:56:00 -0000 Message-ID: <00b601ca7285$a3ff39f0$ebfdadd0$@com> MIME-Version: 1.0 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-12/txt/msg00005.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. >=20 > 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? >=20 > 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: >=20 > (gdb) python gdb.execute("rec save file.%d" % 1) >=20 > You can replace the "1" above by an python variable, including > one obtained by evaluating an expression as a long. To take some input from a different (commercial, closed-source, if someone = asks) tool with a similar interface of script + Python, in Simics, we solve that = by having our CLI (quite similar to gdb in many ways) be able to construct str= ings. So we would do something like this: simics> save ("file." + $a)=20=20=20=20=20 (when the first argument to + is a string, the next argument is forced to a string) Or Simics> save ("file.%d" % [$a]) ## Support for Python-style % operator in = CLI I think supporting string generation would solve many more problems easily.= =20 The save name INDEX to me seems silly, if you are doing this manually, why = don't you just type a different name each time? Best regards, /jakob _______________________________________________________ Jakob Engblom, PhD, Technical Marketing Manager Virtutech=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Direct: +46= 8 690 07 47=A0=A0=A0 Drottningholmsv=E4gen 22=A0=A0=A0=A0=A0 Mobile: +46 709 242 646=A0=A0 11243 Stockholm=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Web:=A0=A0=A0 www.virtu= tech.com=A0 Sweden ________________________________________________________ =A0=20