From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4431 invoked by alias); 22 Nov 2006 11:32:18 -0000 Received: (qmail 4421 invoked by uid 22791); 22 Nov 2006 11:32:18 -0000 X-Spam-Check-By: sourceware.org Received: from wx-out-0506.google.com (HELO wx-out-0506.google.com) (66.249.82.234) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 22 Nov 2006 11:32:09 +0000 Received: by wx-out-0506.google.com with SMTP id h26so198154wxd for ; Wed, 22 Nov 2006 03:32:07 -0800 (PST) Received: by 10.70.116.14 with SMTP id o14mr3412549wxc.1164195127156; Wed, 22 Nov 2006 03:32:07 -0800 (PST) Received: by 10.70.12.9 with HTTP; Wed, 22 Nov 2006 03:32:07 -0800 (PST) Message-ID: Date: Wed, 22 Nov 2006 11:32:00 -0000 From: "Rob Quill" To: gdb@sourceware.org Subject: Checking variable scope MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00149.txt.bz2 Hi, 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)); in c-exp.y 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. Rob