This is the mail archive of the
mailing list for the GDB project.
Checking variable scope
- From: "Rob Quill" <rob dot quill at gmail dot com>
- To: gdb at sourceware dot org
- Date: Wed, 22 Nov 2006 11:32:07 +0000
- Subject: Checking variable scope
I am trying to make it possible to be able to check if a variable is
in scope at a given time. My current implementation for this involves
adding a parameter to parse_expression, and the parsing functions it
calls, all the way until it gets to the line:
if (sym == 0)
error ("No symbol \"%s\" in specified context.", copy_name ($3));
as which point it doesn't call error, but calls another function which
returns a value signifing that the variable is not in scope.
Whilst this is OK, in that it (should) work, I was wondering if anyone
had a neater way of implementing it?
Thanks for your time.