MI testsuite failures

Nick Roberts nickrob@snap.net.nz
Mon Jan 8 08:15:00 GMT 2007


 > >   FAIL: gdb.mi/mi-var-cmd.exp: assign same value to func (update)
 > > 
 > > This is more subtle and is caused by having two variable objects for
 > > one variable, var1 and var2 say.  Then if they have a common value 10
 > > say and you do:
 > > 
 > > -var-assign var1 11
 > > -var-assign var2 12
 > > 
 > > var->updated is set to 1 for each and they are both reported as changed
 > > with -var-update.
 > > 
 > > However doing -var-update again gives var1 in the chagelist because the
 > > real value is 12 but var->print_value is "11".
 > 
 > That's because -var-assign should update var->print_value.

"-var-assign var2 12" will update var->print_value for var2 but not var1.  If
you can see a way to do update both please show me.

 > > I think this is a bug in -var-assign; it should set the variable value
 > > but not interfere with the variable object.  Note that generally if you
 > > have two variable objects for one value and set the value of one with
 > > -var-assign, one will be reported as changed because var->updated is 1,
 > > and the other because the value has changed.  I think the value held
 > > by the variable object shouldn't change until -var-update is issued,
 > > just as is the case if the real value changes during execution.  This is
 > > a patch to do that.
 > 
 > I don't think that if you assign a value to varobj and then
 > -var-evaluate-expression returns something else than the value you've
 > assigned, it would be rather confusing interface.

I recall that when I submitted my first patches (start of 2003?) Daniel J was
confused by the fact that -var-evaluate-expression didn't always return the
current variable value, and Jim Ingham explained that variable objects were
designed to work like that.  It only appears confusing because you're used to
the current behaviour.

-- 
Nick                                           http://www.inet.net.nz/~nickrob



More information about the Gdb-patches mailing list