Re: Command File Scope Checking

Rob Quill
2006-10-23T21:08:26Z

On 23/10/06, Daniel Jacobowitz <drow@false.org> wrote:
> On Mon, Oct 23, 2006 at 09:15:31PM +0100, Rob Quill wrote:
> > On 23/10/06, Eli Zaretskii <eliz@gnu.org> wrote:
> > >> Date: Mon, 23 Oct 2006 11:45:23 +0100
> > >> From: "Rob Quill" <rob.quill@gmail.com>
> > >>
> > >> 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?

Rob

>
> --
> Daniel Jacobowitz
> CodeSourcery
>