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: variable objects and registers


 > > gdb_block_vars only gets called if gdb_get_blocks finds a new block which
 > > then finds any variabes local to it.  That way new variable objects can be
 > > added (and old ones deleted if a block has disappeared) while keeping
 > > the variable objects which are still in scope.  I think we should implement
 > > these functions in MI (perhaps Apple already have).
 > 
 > Again, I think we need more automated approach. Frontend should have a
 > single command  that:
 > 
 > 	1. Reports which local variables are really dead now
 > 	2. Creates and reports variable object for new locals 
 > 	3. Reports which varobjs are out of scope

We don't seem to be finding much agreement, except that what I have described
does 2 and 3, and I don't really understand the difference between 1 and 3
When would a variable belong to just one of those two groups?

 > For example:
 > 
 >     -var-update --locals
 >     ^done,varobjs=[{name="v1",in_scope="false"....}{"name="v2",in_scope="true"....}]
 >                created=[{name="v3"....],
 >                gone-forever=[{name="v0"...}]
 > 
 > 
 > Apple creates varobjs for all variables in all blocks in a function, and use
 > "in_scope" to track their scope. That might be good approach too. IIRC,
 > you've posted a patch to consider block boundaries when computing
 > "in_scope"? That's exactly what's needed for this approach to work.

Yes, I'm fairly sure that's what the above functions from Insight do.  That
wouldn't be a coincidence either because ChangeLog records show that Jim Ingham
worked on Insight while at Cygnus.

-- 
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]