From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4171 invoked by alias); 22 Mar 2008 12:07:27 -0000 Received: (qmail 4107 invoked by uid 22791); 22 Mar 2008 12:07:25 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout7.012.net.il (HELO mtaout7.012.net.il) (84.95.2.19) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 22 Mar 2008 12:07:06 +0000 Received: from HOME-C4E4A596F7 ([84.228.236.188]) by i-mtaout7.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0JY400KFCRIE7701@i-mtaout7.012.net.il> for gdb-patches@sources.redhat.com; Sat, 22 Mar 2008 13:49:26 +0200 (IST) Date: Sat, 22 Mar 2008 12:07:00 -0000 From: Eli Zaretskii Subject: Re: [RFA] Fix breakpoint condition that use member variables. In-reply-to: <200803221240.16230.vladimir@codesourcery.com> X-012-Sender: halo1@inter.net.il To: Vladimir Prus Cc: gdb-patches@sources.redhat.com Reply-to: Eli Zaretskii Message-id: Content-transfer-encoding: 7BIT References: <200803221240.16230.vladimir@codesourcery.com> X-IsSubscribed: yes 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: 2008-03/txt/msg00330.txt.bz2 > From: Vladimir Prus > Date: Sat, 22 Mar 2008 12:40:15 +0300 > > Suppose that foo.cpp:10 is a location inside member function of a class, > and that said class has member variable i_, and that we've just started > a program and are in main. Then: > > break foo.cpp:10 if i_ == 10 > > will not work, claiming that i_ does not exist. The problem is that > lookup_symbol_aux uses value_of_this, which uses value_of_local and > that totally ignores the block that is passed to parse_exp_1 by > the breakpoint code and uses the block of the selected frame. Of course, > that either does not have "this", or has wrong "this". > > This patch fixes the problem by looking in the right block directly, > and also by looking for the field in the type of "this", without > trying to get the value. What will happen after your patch if there's also a variable i_ in the selected frame?