This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: -var-update using formatted value
Marc Khouzam wrote:
> Hello,
>
> I've been using varObject for a three or four months now and I noticed
> something weird with -var-update. -var-update is supposed to show
> variables that have changed since the last -var-udpate, correct? It does
> not seem to work in this case:
...
> As you might guess, the reason for this is that the binary value of var1
> (11 in binary) when doing -var-udpate is the same as the natural value of
> var1 (11 in decimal) of the previous -var-udpate (var-create in this
> case.)
>
> I believe this behaviour was introduced in version 1.75 of varobj.c in
> install_new_value(), where instead of comparing value contents, it now
> compares printed values. I'm sure there was a good reason to compare
> printed values, but was this side-effect known?
I don't think this side-effect is known, at least it was not discussed.
I think this is actually a bug -- we should update stored
value when changing format. Nick, what do you think?
> Another issue with comparing printed values in -var-update is that if a
> front-end wants to know if a variable object memory -really- changed, it
> should perform the -var-udpate using the same format every time, or else
> var-update will show a change although it is just the format that changed.
> But maybe that is what was meant for -var-update to do?
Why do you need "is it really changed" query?
- Volodya