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 testsuite failures [PATCH]


 > > Here's a patch with fixes for the testsuite.  I've made a further change to
 > > varobj.c to fix a failure in mi-var-child.exp.
 > 
 > Was this:
 > 
 > FAIL: gdb.mi/mi-var-child.exp: update all vars int_ptr_ptr and children changed
 > FAIL: gdb.mi/mi-var-child.exp: update all vars struct_declarations.long_array.0 changed
 > 
 > ?

Certainly the second, which was to do with value == NULL and
var->value != NULL.

 > The patch below fixes those, and this one too:
 > 
 > FAIL: gdb.mi/mi-var-cmd.exp: assign same value to func (update)

Yes, this looks right and is much simpler, but I just couldn't see how to do
it.

 > I can't quite tell what your patch does, but I do see why these
 > failures happen.  Because the var->updated and the var->value
 > previously NULL cases were not updating print_value, you sometimes had
 > to -var-update twice to get a value to leave the list.

My patch defers the updating of the variable object until -var-update is
issued.

 > This is the same reason you had to add spurious -var-update's to the
 > testsuite.  

I don't know that I'd call them spurious.  The command -var-assign seems a bit
anomalous to me.  It could just set the value like "set var i=10".  I think the
updating of variable objects should be left to -var-update, but this change
might be too radical at this stage.

 > The first time we do that it's a good thing, i.e. we want lpcharacter
 > to be listed now.  The second time it's kind of dodgy: lpcharacter
 > is not a NULL terminated string and it just so happens that linteger
 > is right after lcharacter in memory, so -var-assign'ing to linteger
 > "changes" the string pointer to by lpcharacter.

I think that's the best we can do; the `string' will be displayed differently
in the watch window.

 > 2007-01-08  Daniel Jacobowitz  <dan@codesourcery.com>
 > 
 > 	* varobj.c (install_new_value): Always update print_value.
 > 	(value_get_print_value): Immediately return NULL for missing
 > 	values.
 > 
 > 2007-01-08  Nick Roberts  <nickrob@snap.net.nz>
 > 	    Daniel Jacobowitz  <dan@codesourcery.com>
 > 
 > 	* gdb.mi/mi-var-cmd.exp: Expect lpcharacter to update when
 > 	lcharacter or linteger change.  Correct duplicated test name.
 > 	* gdb.mi/mi2-var-cmd.exp: Likewise.

Yes, I'd be happy to see these changes installed.

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


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