From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8589 invoked by alias); 30 Nov 2009 12:37:34 -0000 Received: (qmail 8579 invoked by uid 22791); 30 Nov 2009 12:37: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; Mon, 30 Nov 2009 12:37:27 +0000 Received: by pwi1 with SMTP id 1so2040019pwi.8 for ; Mon, 30 Nov 2009 04:37:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.143.25.38 with SMTP id c38mr458982wfj.11.1259584646085; Mon, 30 Nov 2009 04:37:26 -0800 (PST) In-Reply-To: <4B11DA3C.3000203@vmware.com> References: <4B11DA3C.3000203@vmware.com> From: Hui Zhu Date: Mon, 30 Nov 2009 16:22:00 -0000 Message-ID: Subject: Re: [RFC] Let "gcore" command accept a suffix argument To: Michael Snyder Cc: 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/msg00215.txt.bz2 I think if each command can support $v directly is better. For example: set $a=3D0 gcore $a Saved corefile 0 Thanks, Hui On Sun, Nov 29, 2009 at 10:19, Michael Snyder wrote: > I can't find the reference message, but I have a recollection > about somebody asking why some gdb command (may have been 'gcore') > couldn't accept a gdb internal variable so that the filename could > in effect be "computed", or disambiguated, to avoid overwriting. > > Having just done this for "record save", I thought I'd float the > idea of generalizing it. > > 1) So -- what if 'gcore' were to accept an optional second argument > which, if present, would be treated as an integer and suffixed to > the gcore filename? =A0So for instance: > > (gdb) set $a =3D 0 > (gdb) gcore foo $a++ > (gdb) step > (gdb) gcore foo $a++ > (gdb) step > (gdb) gcore foo $a++ > > would result in three files: foo.0, foo.1, and foo.2. > > 2) Similarly, what if we were to do the same thing with > add_setshow_filename_cmd, which is used for commands such > as "set logging filename". =A0Then a series of logging files > could be created, each with a unique filename. > > Yes, I know, we could do the same thing with Python, but > I'm not convinced that that is an argument against doing it > stand alone (maybe for users who don't want to learn python). > > I'm prepared to submit a patch for 1 and 2, separately or together. > > > >