Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* MI and anonymous unions
@ 2006-11-15  9:38 Vladimir Prus
  2006-11-15 14:54 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Prus @ 2006-11-15  9:38 UTC (permalink / raw)
  To: gdb


I've noticed that MI does not work nice with anonymous unions. Consider this 
structure:

    struct S
    {
         union {
                int i;
                int j;
          };
    };

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.

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

- Volodya





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-11-15 17:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-15  9:38 MI and anonymous unions Vladimir Prus
2006-11-15 14:54 ` Daniel Jacobowitz
2006-11-15 14:58   ` Vladimir Prus
2006-11-15 17:21     ` Jim Ingham
2006-11-15 17:28       ` Vladimir Prus
2006-11-15 17:52         ` Jim Ingham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox