From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32108 invoked by alias); 29 Nov 2006 14:15:26 -0000 Received: (qmail 32095 invoked by uid 22791); 29 Nov 2006 14:15:24 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 29 Nov 2006 14:15:18 +0000 Received: (qmail 32079 invoked from network); 29 Nov 2006 14:15:15 -0000 Received: from unknown (HELO ?172.16.64.38?) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 29 Nov 2006 14:15:15 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com, Nick Roberts Subject: Re: MI/C++/references fixup Date: Wed, 29 Nov 2006 14:15:00 -0000 User-Agent: KMail/1.9.1 References: <200611291215.21876.vladimir@codesourcery.com> <20061129140117.GB29365@nevyn.them.org> In-Reply-To: <20061129140117.GB29365@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200611291715.05247.vladimir@codesourcery.com> 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: 2006-11/txt/msg00385.txt.bz2 On Wednesday 29 November 2006 17:01, Daniel Jacobowitz wrote: > On Wed, Nov 29, 2006 at 12:15:21PM +0300, Vladimir Prus wrote: > > We discussed this at length some time ago: > > > > http://thread.gmane.org/gmane.comp.gdb.patches/28414/ > > > > The conclusion was that this "address prefix" is not necessary. In fact, > > both KDevelop and Eclipse explicitly remove it. Back then, it was decided > > that change would be hard. But recent varobj refactorings make this > > change straight-forward. > > Did we? I believe you, but I can't find it in the thread, and I don't > remember. The last thing I remember from this thread is that we tried, but failed. > > + /* We are not interested in address of references, and given > > + that in C++ reference is not rebindable, it cannot > > + meaningfully change. So, get hold of the real value. */ > > in the address of a reference, in C++ a reference. > > In C++ it can't meaningfully change. In a program, though, it can; > once when it's initialized, and again if something scribbles on the > stack. And that might be what you're trying to debug. So, I'm > a little wary of this; it seems to me that we ought to check for both > changes in the address and value (sort of like we do for watchpoints). In practice, if the address changes, the value also changes, so the user can notice. Second, if user really wants to get the address, he can do that with "&whatever". Finally, what's the point of displaying address, if Eclipse and KDevelop strip it, and I think Nick wants it to be gone too? > > Per your other message, I'd rather not check in the patch without this; > want me to try it? > > > mi_gdb_test "200-break-insert $func" \ > > - > > "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"keep\", > >enabled=\"y\",addr=\"$hex\",func=\"$func\",file=\".*\",line=\"\[0-9\]*\",t > >imes=\"0\"\}" \ + > > "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"keep\", > >enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(\\\)\)?\",file=\".*\",line=\ > >"\[0-9\]*\",times=\"0\"\}" \ "breakpoint at $func" > > Probably ought to allow (.*) for the function in case it has arguments > (or the C++ demangler gives us back a (void)). Okay. > > +proc mi_check_varobj_value { name value } { > > + > > + mi_gdb_test "-var-evaluate-expression $name" \ > > + "\\^done,value=\"$value\"" \ > > + "-var-evaluate-expression $name: expect $value" > > +} > > \ No newline at end of file > > Please add newline :-) > > > # Copyright 2002, 2003 Free Software Foundation, Inc. > > And update copyright years. > > > # Please email any bugs, comments, and/or additions to this file to: > > # bug-gdb@prep.ai.mit.edu > > And skip that. We really should remove it from every file. > > And copyright message on new tests please. Okay. - Volodya