mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-02 01:38:34 +00:00
Fix struct member's debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62610 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c99031b02a
commit
2be5893a04
@ -1802,13 +1802,9 @@ private:
|
|||||||
else if (Element.getTag() == dwarf::DW_TAG_variable) // ???
|
else if (Element.getTag() == dwarf::DW_TAG_variable) // ???
|
||||||
ElemDie = CreateGlobalVariableDIE(DW_Unit,
|
ElemDie = CreateGlobalVariableDIE(DW_Unit,
|
||||||
DIGlobalVariable(Element.getGV()));
|
DIGlobalVariable(Element.getGV()));
|
||||||
else {
|
else
|
||||||
DIDerivedType DT = DIDerivedType(Element.getGV());
|
ElemDie = CreateMemberDIE(DW_Unit,
|
||||||
assert (DT.isDerivedType(DT.getTag())
|
DIDerivedType(Element.getGV()));
|
||||||
&& "Unexpected struct element type");
|
|
||||||
ElemDie = new DIE(DT.getTag());
|
|
||||||
AddType(DW_Unit, ElemDie, DT);
|
|
||||||
}
|
|
||||||
Buffer.AddChild(ElemDie);
|
Buffer.AddChild(ElemDie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1903,6 +1899,27 @@ private:
|
|||||||
return GVDie;
|
return GVDie;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// CreateMemberDIE - Create new member DIE.
|
||||||
|
DIE *CreateMemberDIE(CompileUnit *DW_Unit, const DIDerivedType &DT) {
|
||||||
|
DIE *MemberDie = new DIE(DT.getTag());
|
||||||
|
std::string Name = DT.getName();
|
||||||
|
if (!Name.empty())
|
||||||
|
AddString(MemberDie, DW_AT_name, DW_FORM_string, Name);
|
||||||
|
|
||||||
|
AddType(DW_Unit, MemberDie, DT.getTypeDerivedFrom());
|
||||||
|
|
||||||
|
AddSourceLine(MemberDie, &DT);
|
||||||
|
|
||||||
|
AddUInt(MemberDie, DW_AT_bit_size, 0, DT.getSizeInBits());
|
||||||
|
DIEBlock *Block = new DIEBlock();
|
||||||
|
AddUInt(Block, 0, DW_FORM_data1, DW_OP_plus_uconst);
|
||||||
|
AddUInt(Block, 0, DW_FORM_udata, DT.getOffsetInBits() >> 3);
|
||||||
|
AddBlock(MemberDie, DW_AT_data_member_location, 0, Block);
|
||||||
|
|
||||||
|
// FIXME - Handle DW_AT_accessibility
|
||||||
|
return MemberDie;
|
||||||
|
}
|
||||||
|
|
||||||
/// CreateSubprogramDIE - Create new DIE using SP.
|
/// CreateSubprogramDIE - Create new DIE using SP.
|
||||||
DIE *CreateSubprogramDIE(CompileUnit *DW_Unit,
|
DIE *CreateSubprogramDIE(CompileUnit *DW_Unit,
|
||||||
const DISubprogram &SP,
|
const DISubprogram &SP,
|
||||||
|
Loading…
Reference in New Issue
Block a user