From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8130 invoked by alias); 16 Dec 2006 17:10:44 -0000 Received: (qmail 8121 invoked by uid 22791); 16 Dec 2006 17:10:43 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 16 Dec 2006 17:10:37 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1Gvd3J-0003gy-Tu; Sat, 16 Dec 2006 12:10:26 -0500 Date: Sat, 16 Dec 2006 17:10:00 -0000 From: Daniel Jacobowitz To: Steve Rodrigues Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] Indirect access to GDB history variables Message-ID: <20061216171025.GB14012@nevyn.them.org> Mail-Followup-To: Steve Rodrigues , gdb-patches@sources.redhat.com References: <20061215024050.GA8750@linden.netapp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20061215024050.GA8750@linden.netapp.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-12/txt/msg00209.txt.bz2 On Thu, Dec 14, 2006 at 06:40:50PM -0800, Steve Rodrigues wrote: > Feature: This patch enables users to programmatcially access the value history > through a GDB variable, by overloading the "$$" construct to contain a variable > name. For example, if my script had printed out values $10-$27, but only every > 3rd one was interesting (it was a pointer I wished to examine further), I could > do the following: > > set $i=10 > while ($i < 28) > p *$$i > set $i+= 3 > end > > ... and I'd see values of $10, $13, $16 and so on. This makes it easier to > compose scripts together when debugging. I've got to say I don't like it much :-( But the reason isn't your fault; in fact, as CLI extensions go, this is pretty elegant. Changing the CLI is touchy because of how weakly specified it is. An example of how the weak specification leaves us grasping at syntax: this introduces something which you can do with "$i" that you can't do with "$1", because $$i and $$1 would mean different things. I think that we should take the long-postponed jump to embedding scripting languages, rather than adding more complexity to the existing CLI. Maybe I'll take another stab at that this weekend. If others disagree, though, I could be easily persuaded. > Testing: This has been tested by hand. I've been trying to write a test > case but have been having no luck getting the test suite to run (due to > old versions of Tcl/expect on the systems this was developed on). If we do go forward with this patch, I'd be happy to help you with a test case (or with getting the testsuite going). -- Daniel Jacobowitz CodeSourcery