This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MI/C++/references fixup


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]