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]

MI and anonymous unions


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





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]