Command File Scope Checking
Rob Quill
rob.quill@gmail.com
Mon Oct 23 20:15:00 GMT 2006
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?
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
>
More information about the Gdb
mailing list