From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16861 invoked by alias); 29 Nov 2006 14:01:33 -0000 Received: (qmail 16841 invoked by uid 22791); 29 Nov 2006 14:01:30 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 29 Nov 2006 14:01:20 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1GpPzx-0007r7-2U; Wed, 29 Nov 2006 09:01:17 -0500 Date: Wed, 29 Nov 2006 14:01:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb-patches@sources.redhat.com, Nick Roberts Subject: Re: MI/C++/references fixup Message-ID: <20061129140117.GB29365@nevyn.them.org> Mail-Followup-To: Vladimir Prus , gdb-patches@sources.redhat.com, Nick Roberts References: <200611291215.21876.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200611291215.21876.vladimir@codesourcery.com> User-Agent: Mutt/1.5.13 (2006-08-11) 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: 2006-11/txt/msg00383.txt.bz2 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. > + /* 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). 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\]*\",times=\"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)). > +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. -- Daniel Jacobowitz CodeSourcery