struct Data;
struct PubSection;
-void EmitDebugAbbrev(raw_ostream &OS, const Data &DI);
-void EmitDebugStr(raw_ostream &OS, const Data &DI);
+void emitDebugAbbrev(raw_ostream &OS, const Data &DI);
+void emitDebugStr(raw_ostream &OS, const Data &DI);
-void EmitDebugAranges(raw_ostream &OS, const Data &DI);
-void EmitDebugRanges(raw_ostream &OS, const Data &DI);
-void EmitPubSection(raw_ostream &OS, const PubSection &Sect,
+void emitDebugAranges(raw_ostream &OS, const Data &DI);
+void emitDebugRanges(raw_ostream &OS, const Data &DI);
+void emitPubSection(raw_ostream &OS, const PubSection &Sect,
bool IsLittleEndian);
-void EmitDebugInfo(raw_ostream &OS, const Data &DI);
-void EmitDebugLine(raw_ostream &OS, const Data &DI);
+void emitDebugInfo(raw_ostream &OS, const Data &DI);
+void emitDebugLine(raw_ostream &OS, const Data &DI);
Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
-EmitDebugSections(StringRef YAMLString, bool ApplyFixups = false,
+emitDebugSections(StringRef YAMLString, bool ApplyFixups = false,
bool IsLittleEndian = sys::IsLittleEndianHost);
} // end namespace DWARFYAML
} // end namespace llvm
writeInteger((uint64_t)Length.TotalLength64, OS, IsLittleEndian);
}
-void DWARFYAML::EmitDebugStr(raw_ostream &OS, const DWARFYAML::Data &DI) {
+void DWARFYAML::emitDebugStr(raw_ostream &OS, const DWARFYAML::Data &DI) {
for (auto Str : DI.DebugStrings) {
OS.write(Str.data(), Str.size());
OS.write('\0');
}
}
-void DWARFYAML::EmitDebugAbbrev(raw_ostream &OS, const DWARFYAML::Data &DI) {
+void DWARFYAML::emitDebugAbbrev(raw_ostream &OS, const DWARFYAML::Data &DI) {
for (auto AbbrevDecl : DI.AbbrevDecls) {
encodeULEB128(AbbrevDecl.Code, OS);
encodeULEB128(AbbrevDecl.Tag, OS);
}
}
-void DWARFYAML::EmitDebugAranges(raw_ostream &OS, const DWARFYAML::Data &DI) {
+void DWARFYAML::emitDebugAranges(raw_ostream &OS, const DWARFYAML::Data &DI) {
for (auto Range : DI.ARanges) {
auto HeaderStart = OS.tell();
if (Range.Format == dwarf::DWARF64) {
}
}
-void DWARFYAML::EmitDebugRanges(raw_ostream &OS, const DWARFYAML::Data &DI) {
+void DWARFYAML::emitDebugRanges(raw_ostream &OS, const DWARFYAML::Data &DI) {
const size_t RangesOffset = OS.tell();
for (auto DebugRanges : DI.DebugRanges) {
const size_t CurrOffset = OS.tell() - RangesOffset;
}
}
-void DWARFYAML::EmitPubSection(raw_ostream &OS,
+void DWARFYAML::emitPubSection(raw_ostream &OS,
const DWARFYAML::PubSection &Sect,
bool IsLittleEndian) {
writeInitialLength(Sect.Length, OS, IsLittleEndian);
};
} // namespace
-void DWARFYAML::EmitDebugInfo(raw_ostream &OS, const DWARFYAML::Data &DI) {
+void DWARFYAML::emitDebugInfo(raw_ostream &OS, const DWARFYAML::Data &DI) {
DumpVisitor Visitor(DI, OS);
Visitor.traverseDebugInfo();
}
-static void EmitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) {
+static void emitFileEntry(raw_ostream &OS, const DWARFYAML::File &File) {
OS.write(File.Name.data(), File.Name.size());
OS.write('\0');
encodeULEB128(File.DirIdx, OS);
encodeULEB128(File.Length, OS);
}
-void DWARFYAML::EmitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) {
+void DWARFYAML::emitDebugLine(raw_ostream &OS, const DWARFYAML::Data &DI) {
for (const auto &LineTable : DI.DebugLines) {
writeInitialLength(LineTable.Length, OS, DI.IsLittleEndian);
uint64_t SizeOfPrologueLength = LineTable.Length.isDWARF64() ? 8 : 4;
OS.write('\0');
for (auto File : LineTable.Files)
- EmitFileEntry(OS, File);
+ emitFileEntry(OS, File);
OS.write('\0');
for (auto Op : LineTable.Opcodes) {
DI.IsLittleEndian);
break;
case dwarf::DW_LNE_define_file:
- EmitFileEntry(OS, Op.FileEntry);
+ emitFileEntry(OS, Op.FileEntry);
break;
case dwarf::DW_LNE_end_sequence:
break;
using EmitFuncType = void (*)(raw_ostream &, const DWARFYAML::Data &);
static void
-EmitDebugSectionImpl(const DWARFYAML::Data &DI, EmitFuncType EmitFunc,
+emitDebugSectionImpl(const DWARFYAML::Data &DI, EmitFuncType EmitFunc,
StringRef Sec,
StringMap<std::unique_ptr<MemoryBuffer>> &OutputBuffers) {
std::string Data;
} // namespace
Expected<StringMap<std::unique_ptr<MemoryBuffer>>>
-DWARFYAML::EmitDebugSections(StringRef YAMLString, bool ApplyFixups,
+DWARFYAML::emitDebugSections(StringRef YAMLString, bool ApplyFixups,
bool IsLittleEndian) {
yaml::Input YIn(YAMLString);
}
StringMap<std::unique_ptr<MemoryBuffer>> DebugSections;
- EmitDebugSectionImpl(DI, &DWARFYAML::EmitDebugInfo, "debug_info",
+ emitDebugSectionImpl(DI, &DWARFYAML::emitDebugInfo, "debug_info",
DebugSections);
- EmitDebugSectionImpl(DI, &DWARFYAML::EmitDebugLine, "debug_line",
+ emitDebugSectionImpl(DI, &DWARFYAML::emitDebugLine, "debug_line",
DebugSections);
- EmitDebugSectionImpl(DI, &DWARFYAML::EmitDebugStr, "debug_str",
+ emitDebugSectionImpl(DI, &DWARFYAML::emitDebugStr, "debug_str",
DebugSections);
- EmitDebugSectionImpl(DI, &DWARFYAML::EmitDebugAbbrev, "debug_abbrev",
+ emitDebugSectionImpl(DI, &DWARFYAML::emitDebugAbbrev, "debug_abbrev",
DebugSections);
- EmitDebugSectionImpl(DI, &DWARFYAML::EmitDebugAranges, "debug_aranges",
+ emitDebugSectionImpl(DI, &DWARFYAML::emitDebugAranges, "debug_aranges",
DebugSections);
- EmitDebugSectionImpl(DI, &DWARFYAML::EmitDebugRanges, "debug_ranges",
+ emitDebugSectionImpl(DI, &DWARFYAML::emitDebugRanges, "debug_ranges",
DebugSections);
return std::move(DebugSections);
}
const DWARFYAML::Data &DWARF, raw_ostream &OS) {
uint64_t BeginOffset = OS.tell();
if (Name == ".debug_str")
- DWARFYAML::EmitDebugStr(OS, DWARF);
+ DWARFYAML::emitDebugStr(OS, DWARF);
else if (Name == ".debug_aranges")
- DWARFYAML::EmitDebugAranges(OS, DWARF);
+ DWARFYAML::emitDebugAranges(OS, DWARF);
else if (Name == ".debug_ranges")
- DWARFYAML::EmitDebugRanges(OS, DWARF);
+ DWARFYAML::emitDebugRanges(OS, DWARF);
else
llvm_unreachable("unexpected emitDWARF() call");
"wrote too much data somewhere, section offsets don't line up");
if (0 == strncmp(&Sec.segname[0], "__DWARF", 16)) {
if (0 == strncmp(&Sec.sectname[0], "__debug_str", 16)) {
- DWARFYAML::EmitDebugStr(OS, Obj.DWARF);
+ DWARFYAML::emitDebugStr(OS, Obj.DWARF);
} else if (0 == strncmp(&Sec.sectname[0], "__debug_abbrev", 16)) {
- DWARFYAML::EmitDebugAbbrev(OS, Obj.DWARF);
+ DWARFYAML::emitDebugAbbrev(OS, Obj.DWARF);
} else if (0 == strncmp(&Sec.sectname[0], "__debug_aranges", 16)) {
- DWARFYAML::EmitDebugAranges(OS, Obj.DWARF);
+ DWARFYAML::emitDebugAranges(OS, Obj.DWARF);
} else if (0 == strncmp(&Sec.sectname[0], "__debug_ranges", 16)) {
- DWARFYAML::EmitDebugRanges(OS, Obj.DWARF);
+ DWARFYAML::emitDebugRanges(OS, Obj.DWARF);
} else if (0 == strncmp(&Sec.sectname[0], "__debug_pubnames", 16)) {
if (Obj.DWARF.PubNames)
- DWARFYAML::EmitPubSection(OS, *Obj.DWARF.PubNames,
+ DWARFYAML::emitPubSection(OS, *Obj.DWARF.PubNames,
Obj.IsLittleEndian);
} else if (0 == strncmp(&Sec.sectname[0], "__debug_pubtypes", 16)) {
if (Obj.DWARF.PubTypes)
- DWARFYAML::EmitPubSection(OS, *Obj.DWARF.PubTypes,
+ DWARFYAML::emitPubSection(OS, *Obj.DWARF.PubTypes,
Obj.IsLittleEndian);
} else if (0 == strncmp(&Sec.sectname[0], "__debug_info", 16)) {
- DWARFYAML::EmitDebugInfo(OS, Obj.DWARF);
+ DWARFYAML::emitDebugInfo(OS, Obj.DWARF);
} else if (0 == strncmp(&Sec.sectname[0], "__debug_line", 16)) {
- DWARFYAML::EmitDebugLine(OS, Obj.DWARF);
+ DWARFYAML::emitDebugLine(OS, Obj.DWARF);
}
continue;
" - AbbrCode: 0x00000000\n"
" Values:\n";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata), true);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata), true);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata));
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata));
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata));
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata));
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- Value: 0x0000000000001000
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata));
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata));
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- Value: 0x0000000000001000
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata));
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata));
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- Value: 0x0000000000001000
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata));
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata));
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
Values:
- Value: 0x0000000000001234
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata));
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata));
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(StringRef(yamldata));
+ auto ErrOrSections = DWARFYAML::emitDebugSections(StringRef(yamldata));
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
SubOpcode: DW_LNE_end_sequence
Data: 18446744073709551600
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
SubOpcode: DW_LNE_end_sequence
Data: 5
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
SubOpcode: DW_LNE_end_sequence
Data: 1
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
SubOpcode: DW_LNE_end_sequence
Data: 2
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
SubOpcode: DW_LNE_end_sequence
Data: 256
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_TRUE((bool)ErrOrSections);
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- Value: 25
)";
Expected<StringMap<std::unique_ptr<MemoryBuffer>>> Sections =
- DWARFYAML::EmitDebugSections(StringRef(yamldata), /*ApplyFixups=*/true,
+ DWARFYAML::emitDebugSections(StringRef(yamldata), /*ApplyFixups=*/true,
/*IsLittleEndian=*/true);
ASSERT_THAT_EXPECTED(Sections, Succeeded());
std::vector<uint8_t> Loclists{
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
Values:
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
SubOpcode: DW_LNE_end_sequence
Data: 3584
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
SubOpcode: DW_LNE_end_sequence
Data: 0
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);
- AbbrCode: 0x00000000
Values: []
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 4);
- AbbrCode: 0x00000000
Values: []
)";
- auto ErrOrSections = DWARFYAML::EmitDebugSections(yamldata);
+ auto ErrOrSections = DWARFYAML::emitDebugSections(yamldata);
ASSERT_THAT_EXPECTED(ErrOrSections, Succeeded());
std::unique_ptr<DWARFContext> DwarfContext =
DWARFContext::create(*ErrOrSections, 8);