Marc Khouzam wrote: > Hi, > > I believe a small bug slipped in the refactoring of varobj_update > interface from: > http://sourceware.org/ml/gdb-patches/2008-05/msg00106.html > > From what I see, varobj that are not in scope don't get flagged > as changed, because nothing was being pushed on the result vector. > The attached patch fixes this. > > The MI part of the testsuite passed ok. > I have an test to trigger the bug, if you care to see it. > > Ok? > > 2009-04-28 Marc Khouzam > > * varobj.c (varobj_update): Push an out-of-scope > variable object on the result vector. > > Index: gdb/varobj.c > =================================================================== > RCS file: /cvs/src/src/gdb/varobj.c,v > retrieving revision 1.126 > diff -u -r1.126 varobj.c > --- gdb/varobj.c 10 Apr 2009 16:00:49 -0000 1.126 > +++ gdb/varobj.c 28 Apr 2009 19:49:24 -0000 > @@ -1188,7 +1188,7 @@ > if (new == NULL) > r.status = VAROBJ_NOT_IN_SCOPE; > > - if (r.type_changed || r.changed) > + if (r.type_changed || r.changed || r.status == > VAROBJ_NOT_IN_SCOPE) > VEC_safe_push (varobj_update_result, result, &r); I am afraid this patch is not right for two reasons: 1. A varobj that is not in scope will be always reported as changed: (gdb) -var-update S ^done,changelist=[{name="S",in_scope="false",type_changed="false"}] (gdb) -var-update S ^done,changelist=[{name="S",in_scope="false",type_changed="false"}] (gdb) This behaviour almost patches GDB 6.8 (it did not print 'type_changed'), but is not right. 2. When a varobj enters the scope again, it won't be reported as changed: (gdb) s &"s\n" ^running *running,thread-id="1" (gdb) ~"foo () at a.c:7\n" ~"7\t s.i = 10;\n" *stopped,.... (gdb) -var-update S ^done,changelist=[] (gdb) This does not match GDB 6.8 -- which continues to claim 'S' is out of scope. Both the above, and GDB 6.8 are clearly in error. I have checked in the below that makes -var-update bahave right in both cases. Let me know if that works for you. Thanks, Volodya