HomePhabricator

[lldb-mi] Fix expansion of anonymous structures and unions

Description

[lldb-mi] Fix expansion of anonymous structures and unions

A variable of type:

struct S {
   union {
       int            i1;
       unsigned u1;
   };
   union {
       int            i2;
       unsigned u2;
   };
};

had been impossible to evaluate in lldb-mi, because MI assigns '??' as the
variable name to each of the unnamed unions after "-var-list-children" command.
Also '??' incorrectly goes to 'exp' field which is treated by IDE as a
structure field name and is displayed in watch window.

The patch fixes this returning empty string as type name for unnamed union and
assigning $N to variable name, where N is the field number in the parent entity.

Patch from evgeny.leviant@gmail.com
Reviewed by: clayborg, abidh
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D13947

Details

Committed
dperchikOct 23 2015, 7:01 PM
Differential Revision
D13947: [lldb-mi] Fix expansion of anonymous structures and unions
Parents
rL251175: Merging r249371:
Branches
Unknown
Tags
Unknown