[Patch] Fix for -var-update to use natural format to compare

Daniel Jacobowitz drow@false.org
Tue Jan 22 15:03:00 GMT 2008


On Tue, Jan 22, 2008 at 09:43:21AM -0500, Marc Khouzam wrote:
> You can refer to http://sourceware.org/ml/gdb/2008-01/msg00175.html
> where you had agreed with me :-)

That's what happens when the thread goes on too long :-)

Here's the problem, as I see it.  There are two different reasonable
definitions of "varobj has changed".  One is that the textual
representation has changed.  The other is that the underlying bytes
have changed.

We used to check the underlying bytes.  This was a problem because the
textual representation for a "char *" includes more bytes than the
value, for C-like languages.  So, as Nick mentioned last week, we
would not detect a change from "GNU" to "GDB" in a "char *", but we
would display the "GNU" string in -var-evaluate-expression.

We switched to checking the string representation.  But if you're
looking in lots of formats, then this is not enough.

We could check in all supported formats; check in the natural format;
or go back to checking the underlying bytes.  Checking in the natural
format is appealing because it's efficient.  But does the natural
format always capture changes in any of the other formats?

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list