From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3001 invoked by alias); 12 Jun 2007 12:50:03 -0000 Received: (qmail 2949 invoked by uid 22791); 12 Jun 2007 12:50:02 -0000 X-Spam-Check-By: sourceware.org Received: from nz-out-0506.google.com (HELO nz-out-0506.google.com) (64.233.162.227) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 12 Jun 2007 12:50:00 +0000 Received: by nz-out-0506.google.com with SMTP id s1so1373698nze for ; Tue, 12 Jun 2007 05:49:58 -0700 (PDT) Received: by 10.114.13.1 with SMTP id 1mr6489068wam.1181652598449; Tue, 12 Jun 2007 05:49:58 -0700 (PDT) Received: by 10.114.182.11 with HTTP; Tue, 12 Jun 2007 05:49:58 -0700 (PDT) Message-ID: <266164370706120549w6534b21t2ce23e78741484d6@mail.gmail.com> Date: Tue, 12 Jun 2007 12:50:00 -0000 From: "Weihua JIANG" To: "Weihua JIANG" , gdb@sourceware.org Subject: Re: How to use shell environment variable in GDB? In-Reply-To: <20070612112030.GB29495@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <266164370706120200v25e88408n7af9ee25a6b7cf24@mail.gmail.com> <20070612112030.GB29495@caradoc.them.org> 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-06/txt/msg00097.txt.bz2 Does gdb support custom command? If so, I can define the 3 commands you mentioned as one custom command. Thanks Weihua 2007/6/12, Daniel Jacobowitz : > On Tue, Jun 12, 2007 at 05:00:02PM +0800, Weihua JIANG wrote: > > E.g. I have a shell environment variable CSR which points to a deep > > directory. Now I hope to load the executable file using below command: > > file $CSR/bin/aaa > > But, since GDB can't recognize this environment variable, it can't > > load the executable file. > > > > How can I use BASH environment variable in GDB? > > This is not supported. You might be able to use this hack: > > shell echo file $CSR/bin/aaa > tmp.scr > source tmp.scr > shell rm tmp.scr > > -- > Daniel Jacobowitz > CodeSourcery >