[codeview] Dump CodeView inlinee lines subsection
llvm-svn: 257790
diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp
index e521c3a..b600fa6 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 @@
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 @@
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::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;