From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14111 invoked by alias); 23 Oct 2006 22:23:01 -0000 Received: (qmail 14101 invoked by uid 22791); 23 Oct 2006 22:23:00 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 23 Oct 2006 22:22:59 +0000 Received: (qmail 17911 invoked from network); 23 Oct 2006 22:22:58 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 23 Oct 2006 22:22:58 -0000 To: "Rob Quill" Cc: gdb@sourceware.org Subject: Re: Command File Scope Checking References: <20061023202001.GA5472@nevyn.them.org> From: Jim Blandy Date: Mon, 23 Oct 2006 22:23:00 -0000 In-Reply-To: (Rob Quill's message of "Mon, 23 Oct 2006 22:08:19 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00220.txt.bz2 "Rob Quill" writes: > On 23/10/06, Daniel Jacobowitz wrote: >> On Mon, Oct 23, 2006 at 09:15:31PM +0100, Rob Quill wrote: >> > 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? >> >> No, this sort of thing is not possible in the current GDB scripting >> interface. Yet, anyway. > > In that case, I'm in need of some advice. I was thinking it would work > something like this: > > Write program that given an LTL formula, writes a GDB command file > representing the automaton and stepping through the code, checking > values of variables and using these to make transitions. Pipe the > output to a file and then analyse the file is some way to decide if > the condition had been met. > > But if I am stepping through the code, and a variable goes out of > scope, how do you suggest I go about dealing with this? I'm surprised that your LTL automaton would need to check this. If your conditions are referring to variables that are out of scope, then something strange is going on.