From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12151 invoked by alias); 23 Oct 2006 20:15:36 -0000 Received: (qmail 12141 invoked by uid 22791); 23 Oct 2006 20:15:35 -0000 X-Spam-Check-By: sourceware.org Received: from wx-out-0506.google.com (HELO wx-out-0506.google.com) (66.249.82.230) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 23 Oct 2006 20:15:33 +0000 Received: by wx-out-0506.google.com with SMTP id s19so2342940wxc for ; Mon, 23 Oct 2006 13:15:31 -0700 (PDT) Received: by 10.70.91.16 with SMTP id o16mr7591645wxb; Mon, 23 Oct 2006 13:15:31 -0700 (PDT) Received: by 10.70.12.9 with HTTP; Mon, 23 Oct 2006 13:15:31 -0700 (PDT) Message-ID: Date: Mon, 23 Oct 2006 20:15:00 -0000 From: "Rob Quill" To: gdb@sourceware.org Subject: Command File Scope Checking In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00216.txt.bz2 On 23/10/06, Eli Zaretskii wrote: > > Date: Mon, 23 Oct 2006 11:45:23 +0100 > > From: "Rob Quill" > > > > Is it possible to check if a variable is in scope when using a command > > file, because I don't want control to return to GDB when a variable > > goes out of scope, so I would like to know if a variable is in scope > > before I check the value of it. > > (gdb) info address foobar > No symbol "foobar" in current context. So is it possible to check the result of doing info address foobar, whilst still in the command file? So that if it is out of scope the script can do action B instead of action A? Thanks, Rob > > If the variable _is_ in scope, you will see a different message, like > this: > > (gdb) info address arglen > Symbol "arglen" is a variable in register eax. > > or maybe this: > > Symbol "gdb_use_lsb" is static storage at address 0x815e720 >