diff options
author | Reid Kleckner <rnk@google.com> | 2016-01-14 19:20:17 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-01-14 19:20:17 +0000 |
commit | e9ab3498f3dada67659871617d4e47e8c2a41bc9 (patch) | |
tree | d3c9d09682e5373382a58d5d53a4583555d908ef /llvm/tools/llvm-readobj/COFFDumper.cpp | |
parent | 1f242d6a776aa6759af39ce4581dc7a015da9f72 (diff) | |
download | bcm5719-llvm-e9ab3498f3dada67659871617d4e47e8c2a41bc9.tar.gz bcm5719-llvm-e9ab3498f3dada67659871617d4e47e8c2a41bc9.zip |
[codeview] Dump CodeView inlinee lines subsection
llvm-svn: 257790
Diffstat (limited to 'llvm/tools/llvm-readobj/COFFDumper.cpp')
-rw-r--r-- | llvm/tools/llvm-readobj/COFFDumper.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index e521c3a8fa5..b600fa63261 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -25,6 +25,7 @@ #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringSet.h" #include "llvm/DebugInfo/CodeView/CodeView.h" +#include "llvm/DebugInfo/CodeView/Line.h" #include "llvm/DebugInfo/CodeView/TypeIndex.h" #include "llvm/DebugInfo/CodeView/TypeRecord.h" #include "llvm/DebugInfo/CodeView/SymbolRecord.h" @@ -91,6 +92,8 @@ private: const SectionRef &Section, StringRef SectionContents); + void printCodeViewInlineeLines(StringRef Subsection); + void printMemberAttributes(MemberAttributes Attrs); void printRelocatedField(StringRef Label, const coff_section *Sec, @@ -991,6 +994,11 @@ void COFFDumper::printCodeViewSymbolSection(StringRef SectionName, case ModuleSubstreamKind::Symbols: printCodeViewSymbolsSubsection(Contents, Section, SectionContents); break; + + case ModuleSubstreamKind::InlineeLines: + printCodeViewInlineeLines(Contents); + break; + case ModuleSubstreamKind::Lines: { // Holds a PC to file:line table. Some data to parse this subsection is // stored in the other subsections, so just check sanity and store the @@ -1685,6 +1693,34 @@ void COFFDumper::printCodeViewSymbolsSubsection(StringRef Subsection, } } +void COFFDumper::printCodeViewInlineeLines(StringRef Subsection) { + StringRef Data = Subsection; + uint32_t Signature; + error(consumeUInt32(Data, Signature)); + bool HasExtraFiles = Signature == unsigned(InlineeLinesSignature::ExtraFiles); + + while (!Data.empty()) { + const InlineeSourceLine *ISL; + error(consumeObject(Data, ISL)); + DictScope S(W, "InlineeSourceLine"); + printTypeIndex("Inlinee", ISL->Inlinee); + W.printHex("FileID", ISL->FileID); + W.printNumber("SourceLineNum", ISL->SourceLineNum); + + if (HasExtraFiles) { + uint32_t ExtraFileCount; + error(consumeUInt32(Data, ExtraFileCount)); + W.printNumber("ExtraFileCount", ExtraFileCount); + ListScope ExtraFiles(W, "ExtraFiles"); + for (unsigned I = 0; I < ExtraFileCount; ++I) { + uint32_t FileID; + error(consumeUInt32(Data, FileID)); + W.printHex("FileID", FileID); + } + } + } +} + StringRef getRemainingTypeBytes(const TypeRecordPrefix *Rec, const char *Start) { ptrdiff_t StartOffset = Start - reinterpret_cast<const char *>(Rec); size_t RecSize = Rec->Len + 2; |