From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15717 invoked by alias); 10 Apr 2007 19:05:05 -0000 Received: (qmail 15703 invoked by uid 22791); 10 Apr 2007 19:05:04 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0506.google.com (HELO nz-out-0506.google.com) (64.233.162.235) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 10 Apr 2007 20:04:54 +0100 Received: by nz-out-0506.google.com with SMTP id m7so1437235nzf for ; Tue, 10 Apr 2007 12:04:53 -0700 (PDT) Received: by 10.115.46.9 with SMTP id y9mr2928647waj.1176231892978; Tue, 10 Apr 2007 12:04:52 -0700 (PDT) Received: by 10.114.77.8 with HTTP; Tue, 10 Apr 2007 12:04:52 -0700 (PDT) Message-ID: Date: Tue, 10 Apr 2007 19:05:00 -0000 From: vb To: "Nick Roberts" Subject: Re: access variables in canned command sequences Cc: gdb@sourceware.org In-Reply-To: <17946.47368.392951.298692@farnswood.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <17946.4774.878951.277496@farnswood.snap.net.nz> <17946.47368.392951.298692@farnswood.snap.net.nz> X-Google-Sender-Auth: 021530b358915551 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/msg00053.txt.bz2 On 4/9/07, Nick Roberts wrote: > > > define xyz > > > printf "offset is %d\n", $offs > > > end > > > > > > > Yeah, this works as we know, but is there any way of passing an > > internal variable value to the shell? > > It's not clear to me what you want to do but you could write the data to a > file and read that file from the shell script: > > set logging file input.dat > > define xyz > set logging on > printf "offset is %d\n", $offs > set logging off > end > > However, perhaps we know that too. No, this I did not know, and it probably will do what I need, let me look. Thanks a lot for the hint, Nick! cheers vadim > AFAIK convenience variables are handled in > GDB just like ordinary program variables. I don't think you can currently > regard the GDB command line as a program language but Daniel Jacobowitz is > working on something more powerful. > > > Somebody mentioned setting up an environment variable - this seems > > interesting, I tried > > > > set environment offset 0x1000 > > shell env | grep offset > > > > `offset' does not get set for the shell started from within gdb.... > > (gdb) help set environment > Set environment variable value to give the program. > ^^^^ > -- > Nick http://www.inet.net.nz/~nickrob >