MI and anonymous unions

Daniel Jacobowitz drow@false.org
Wed Nov 15 14:54:00 GMT 2006


On Wed, Nov 15, 2006 at 12:38:16PM +0300, Vladimir Prus wrote:
> Traversing it with MI eventually gives:
> 
>   -var-list-children V.public
>    ^done,numchild="1",children=[child={name="V.public.",exp="",numchild="1",
>                  type="union {...}"}]
>     (gdb)
>     -var-list-children V.public.
>     ^done,numchild="1",children=[
>          child={name="V.public..public",exp="public",numchild="2"}]
>      (gdb)
>      -var-list-children V.public..public
>      .....
> 
> Although this kinda works, I'm pretty sure UI won't be happy about empty 
> expression for a variable object, and if you have two anonymous unions, you 
> can't even address them.

I'm not sure what to do for the empty expression.  There's nothing we
can put there which would act like a named union, since you need one
less period - hmm, we were just discussing an MI command to recreate
expressions the other day...

How do people use the exp="" result?  Should it be "<anonymous>"?

> How about using some unique identifier for variable objects corresponding for 
> anonymous unions? Say "@N"?

That sounds reasonable.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb mailing list