From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12411 invoked by alias); 8 Sep 2003 19:36:21 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12397 invoked from network); 8 Sep 2003 19:36:20 -0000 Received: from unknown (HELO zenia.home) (12.223.225.216) by sources.redhat.com with SMTP; 8 Sep 2003 19:36:20 -0000 Received: by zenia.home (Postfix, from userid 5433) id 8794E204FF; Mon, 8 Sep 2003 14:34:56 -0500 (EST) To: Joel Brobecker Cc: gdb@sources.redhat.com Subject: Re: Which language when parsing a breakpoint condition? References: <20030905232358.GB925@gnat.com> <20030905232839.GC925@gnat.com> From: Jim Blandy Date: Mon, 08 Sep 2003 19:36:00 -0000 In-Reply-To: <20030905232839.GC925@gnat.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-09/txt/msg00103.txt.bz2 You're absolutely right. When the language mode is auto, it's silly to parse an expression in the context of a particular block, but in a language other than the one the block in written in. Your code looks like the right idea to me, too. Some notes: - expout->language_defn needs to be set correctly, too, doesn't it? - Since get_selected_block can return zero, you'll need to deal with the case where expression_context_block is zero. You can linearize the cases like this, I think: if (language_mode == language_manual) lang = current_language else if (expression_context_block) set lang from that, with block_function and language_def else lang = current_language At least, I think this makes it clearer that every case is covered. Up to you. (This sort of issue comes up a lot in relation to conditional breakpoints, since I think it's one of the few cases where an expression is ever parsed/evaluated in a scope other than that of the selected frame. Checking watchpoints is a similar case.)