From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28579 invoked by alias); 8 Apr 2007 14:06:01 -0000 Received: (qmail 28570 invoked by uid 22791); 8 Apr 2007 14:06:00 -0000 X-Spam-Check-By: sourceware.org Received: from return.false.org (HELO return.false.org) (66.207.162.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 08 Apr 2007 15:05:58 +0100 Received: from return.false.org (localhost [127.0.0.1]) by return.false.org (Postfix) with ESMTP id 6FFEF4B267; Sun, 8 Apr 2007 09:05:56 -0500 (CDT) Received: from caradoc.them.org (dsl093-172-095.pit1.dsl.speakeasy.net [66.93.172.95]) by return.false.org (Postfix) with ESMTP id 2610D4B262; Sun, 8 Apr 2007 09:05:56 -0500 (CDT) Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HaY1j-0003U3-6Y; Sun, 08 Apr 2007 10:05:55 -0400 Date: Sun, 08 Apr 2007 14:06:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: vb , gdb@sourceware.org Subject: Re: access variables in canned command sequences Message-ID: <20070408140554.GA13191@caradoc.them.org> Mail-Followup-To: Michael Snyder , vb , gdb@sourceware.org References: <1175885519.11945.64.camel@svmsnyderlnx.palmsource.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1175885519.11945.64.camel@svmsnyderlnx.palmsource.com> User-Agent: Mutt/1.5.14+cvs20070313 (2007-03-13) 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: 2007-04/txt/msg00042.txt.bz2 On Fri, Apr 06, 2007 at 11:51:59AM -0700, Michael Snyder wrote: > On Fri, 2007-04-06 at 11:26 -0700, vb wrote: > > Hello all, > > > > I need to be able pass a convenience variable defined in gdb command > > file to a shell script from inside a canned sequence, something like > > this: > > > > set $offs=0x1ff80000 > > define xyz > > shell echo offset is $offs > > end > > > > what happens when I run it - the parameter does not get passed to the > > shell at all: > > > > (gdb) xyz > > offset is > > (gdb) > > > > > > What gives?! > > I imagine that the command "echo offset is $offs" is passed directly > to the shell. The shell doesn't have a variable $offs, so nothing > gets printed. That's right. This would work: define xyz printf "offset is %d", $offs end The CLI does not have a lot of ways to manipulate strings. -- Daniel Jacobowitz CodeSourcery