Re: variable objects and registers

Nick Roberts
2006-12-21T01:34:35Z

> > I think that we need more higher-level notification -- namely "new locals
> > appeared" and either:
> > - "varobj now refers to different object"
> > - or have a command that creates varobjs for all variables
> > in a function.
>
> The latter is "-stack-list-locals --make-varobjs" isn't it? Or are you
> talking about variables declared within compound statements?

I see now that Insight has two commands:

/* This implements the tcl command gdb_get_blocks
*
* Returns the start and end addresses for all blocks in
* the selected frame.
*
* Arguments:
* None
* Tcl Result:
* A list of all valid blocks in the selected_frame.
*/
static int
gdb_get_blocks (ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[])

and

/* This implements the tcl command gdb_block_vars.
*
* Returns all variables valid in the specified block.
*
* Arguments:
* The start and end addresses which identify the block.
* Tcl Result:
* All variables defined in the given block.
*/
static int
gdb_block_vars (ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[])

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).

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