summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-05-24 17:30:25 +0000
committerZachary Turner <zturner@google.com>2016-05-24 17:30:25 +0000
commitcac29ae03812a3e1c81c3eba4e9b57173d367604 (patch)
tree2afda958e104d7e789c788a261fe453bbf3b22e4 /llvm/lib/DebugInfo
parent4d2613f2762bc8a76156429bd43241d81197b301 (diff)
downloadbcm5719-llvm-cac29ae03812a3e1c81c3eba4e9b57173d367604.tar.gz
bcm5719-llvm-cac29ae03812a3e1c81c3eba4e9b57173d367604.zip
Dump symbol record details in llvm-pdbdump
This makes use of the newly introduced `CVSymbolVisitor` to dump details of each type of symbol record in the symbol streams. Future patches will bring this visitor based dumping to the publics stream, as well as creating a `SymbolDumpDelegate` to print more information about relocations etc. Differential Revision: http://reviews.llvm.org/D20545 Reviewed By: ruiu llvm-svn: 270585
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp8
-rw-r--r--llvm/lib/DebugInfo/CodeView/TypeDumper.cpp15
2 files changed, 15 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp b/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp
index ab69240f2e5..d41d7d64ae1 100644
--- a/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp
+++ b/llvm/lib/DebugInfo/CodeView/SymbolDumper.cpp
@@ -599,9 +599,9 @@ void CVSymbolDumperImpl::visitProcSym(SymbolKind Kind, ProcSym &Proc) {
void CVSymbolDumperImpl::visitScopeEndSym(SymbolKind Kind,
ScopeEndSym &ScopeEnd) {
if (Kind == SymbolKind::S_END)
- W.startLine() << "BlockEnd\n";
+ DictScope S(W, "BlockEnd");
else if (Kind == SymbolKind::S_PROC_ID_END)
- W.startLine() << "ProcEnd\n";
+ DictScope S(W, "ProcEnd");
else if (Kind == SymbolKind::S_INLINESITE_END)
DictScope S(W, "InlineSiteEnd");
@@ -648,8 +648,8 @@ void CVSymbolDumperImpl::visitUDTSym(SymbolKind Kind, UDTSym &UDT) {
void CVSymbolDumperImpl::visitUnknownSymbol(SymbolKind Kind,
ArrayRef<uint8_t> Data) {
DictScope S(W, "UnknownSym");
- W.printHex("Kind", unsigned(Kind));
- W.printHex("Size", Data.size());
+ W.printEnum("Kind", Kind, makeArrayRef(SymbolTypeNames));
+ W.printNumber("Length", Data.size());
}
bool CVSymbolDumper::dump(const SymbolIterator::Record &Record) {
diff --git a/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp b/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
index 50a7e6c841b..72e0e44ce26 100644
--- a/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
+++ b/llvm/lib/DebugInfo/CodeView/TypeDumper.cpp
@@ -656,19 +656,26 @@ void CVTypeDumper::printTypeIndex(StringRef FieldName, TypeIndex TI) {
if (!TI.isNoType())
TypeName = getTypeName(TI);
if (!TypeName.empty())
- W.printHex(FieldName, TypeName, TI.getIndex());
+ W->printHex(FieldName, TypeName, TI.getIndex());
else
- W.printHex(FieldName, TI.getIndex());
+ W->printHex(FieldName, TI.getIndex());
}
bool CVTypeDumper::dump(const TypeIterator::Record &Record) {
- CVTypeDumperImpl Dumper(*this, W, PrintRecordBytes);
+ assert(W && "printer should not be null");
+ CVTypeDumperImpl Dumper(*this, *W, PrintRecordBytes);
Dumper.visitTypeRecord(Record);
return !Dumper.hadError();
}
bool CVTypeDumper::dump(ArrayRef<uint8_t> Data) {
- CVTypeDumperImpl Dumper(*this, W, PrintRecordBytes);
+ assert(W && "printer should not be null");
+ CVTypeDumperImpl Dumper(*this, *W, PrintRecordBytes);
Dumper.visitTypeStream(Data);
return !Dumper.hadError();
}
+
+void CVTypeDumper::setPrinter(ScopedPrinter *P) {
+ static ScopedPrinter NullP(llvm::nulls());
+ W = P ? P : &NullP;
+}
OpenPOWER on IntegriCloud