From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18463 invoked by alias); 10 May 2010 21:28:09 -0000 Received: (qmail 18455 invoked by uid 22791); 10 May 2010 21:28:08 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 10 May 2010 21:27:59 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 93DE72BABAB; Mon, 10 May 2010 17:27:57 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 5kc7yCSxHhyA; Mon, 10 May 2010 17:27:57 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 5D32C2BAB7F; Mon, 10 May 2010 17:27:57 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id F1A15F58F9; Mon, 10 May 2010 14:27:54 -0700 (PDT) Date: Mon, 10 May 2010 21:28:00 -0000 From: Joel Brobecker To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [RFC/commit] parse breakpoint condition according to breakpoint location Message-ID: <20100510212754.GE7479@adacore.com> References: <1273427894-4461-1-git-send-email-brobecker@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00233.txt.bz2 > current_language is a problem global. It is referenced in a lot of > places where an argument would be preferable. E.g., even though > expressions carry their language, code in valops.c checks the global, so > you can wind up with odd behavior (at least in theory, I have not tried > to make a reproducer). Probably, evaluate_expression should call > set_language and restore the old language in a cleanup -- though this is > a workaround and not a clean fix. I see that you already starting cleaning some things up in that department :). The idea of temporarily switching the current_language global is not even guaranteed to work, because there is the risk that some functions that we use actually change it again from under us. For instance, a while ago, I ran into a situation where a some code set the current_language before calling a parsing routine; but that did not work because the parsing routine called get_current_frame which had a side-effect of changing the current_language! > Once the condition is successfully parsed, it seems to me that any > re-parsing should be done with that same language. Agreed 100%. > Maybe this is already accomplished by the set_language calls in > breakpoint.c, I'm not sure. I do not think so. I need to work on that followup email I was referring to (I'm in Paris right now, spending most of my days meeting with people). I'll do that now... -- Joel