Newer
Older
void DwarfDebug::emitSkeletonAbbrevs(const MCSection *Section) {
assert(useSplitDwarf() && "No split dwarf debug info?");
emitAbbrevs(Section, &SkeletonAbbrevs);
}
// Emit the .debug_info.dwo section for separated dwarf. This contains the
// compile units that would normally be in debug_info.
void DwarfDebug::emitDebugInfoDWO() {
assert(useSplitDwarf() && "No split dwarf debug info?");
InfoHolder.emitUnits(this, Asm->getObjFileLowering().getDwarfInfoDWOSection(),
Asm->getObjFileLowering().getDwarfAbbrevDWOSection(),
DwarfAbbrevDWOSectionSym);
}
// Emit the .debug_abbrev.dwo section for separated dwarf. This contains the
// abbreviations for the .debug_info.dwo section.
void DwarfDebug::emitDebugAbbrevDWO() {
assert(useSplitDwarf() && "No split dwarf?");
emitAbbrevs(Asm->getObjFileLowering().getDwarfAbbrevDWOSection(),
&Abbreviations);
}
// Emit the .debug_str.dwo section for separated dwarf. This contains the
// string section and is identical in format to traditional .debug_str
// sections.
void DwarfDebug::emitDebugStrDWO() {
assert(useSplitDwarf() && "No split dwarf?");
const MCSection *OffSec = Asm->getObjFileLowering()
.getDwarfStrOffDWOSection();
const MCSymbol *StrSym = DwarfStrSectionSym;
InfoHolder.emitStrings(Asm->getObjFileLowering().getDwarfStrDWOSection(),
OffSec, StrSym);
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
/// When we don't know whether the correct form is ref4 or ref_addr, we create
/// a worklist item and insert it to DIEEntryWorklist.
void DwarfDebug::addDIEEntry(DIE *Die, uint16_t Attribute, uint16_t Form,
DIEEntry *Entry) {
/// Early exit when we only have a single CU.
if (GlobalCUIndexCount == 1 || Form != dwarf::DW_FORM_ref4) {
Die->addValue(Attribute, Form, Entry);
return;
}
DIE *DieCU = Die->checkCompileUnit();
DIE *EntryCU = Entry->getEntry()->checkCompileUnit();
if (!DieCU || !EntryCU) {
// Die or Entry is not added to an owner yet.
insertDIEEntryWorklist(Die, Attribute, Entry);
return;
}
Die->addValue(Attribute,
EntryCU == DieCU ? dwarf::DW_FORM_ref4 : dwarf::DW_FORM_ref_addr,
Entry);
}