[PATCH] -var-update [was Re: Variable objects: references formatting]

Nick Roberts nickrob@snap.net.nz
Mon May 8 21:17:00 GMT 2006


 > > I think this patch works.  My reasoning is one of symmetry: whatever is
 > > done to val2 should also be done to val1, and that you probably don't want
 > > to change the contents of val1 (hence val3).  I don't know exactly what
 > > coerce_array does, apart from convert the type from TYPE_CODE_REF to
 > > TYPE_CODE_INT or TYPE_CODE_FLOAT or whatever, so the comment might not be
 > > quite right.
 > 
 > Is there any reason you declared a new variable instead of just saying:
 >
 >    val1 = coerce_array (val1)
 > 
 > ?  That would make the symmetry more apparent.

I thought I had tried and it had failed.  Of course, now you suggest it, it
works ;-).  I had thought that maybe coerce_array kept changing val1, as it was
done for each update, but indeed it looks like the first call finds the
underlying type and further calls do nothing.

 > (I don't know enough about the context to review the patch more
 > substantially.)

I'm in no hurry for this one.  I can re-submit later when I have more
confidence that it's right, if no-one can endorse it for me.


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



More information about the Gdb-patches mailing list