summaryrefslogtreecommitdiff
path: root/tools/llvm-pdbutil
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-08-17 20:04:31 +0000
committerZachary Turner <zturner@google.com>2017-08-17 20:04:31 +0000
commit54e28fe2aaad14fa2ea665cd0bff49a218a4c8b6 (patch)
tree8b2e45e06d544ee69d5ab3f22f08ab597530e32c /tools/llvm-pdbutil
parent35adac2ab6b6648425ee68e2c08c4a38a7f298b1 (diff)
Fix a few minor issues when dumping symbols.
1) We weren't handling symbol types that weren't able to parse, even if we knew what the leaf type was. This was triggering when trying to dump /DEBUG:FASTLINK PDBs, where we expect a certain symbol to show up, but we just don't know how to parse it. 2) We lost the code for dumping record bytes, so this was added back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311116 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-pdbutil')
-rw-r--r--tools/llvm-pdbutil/MinimalSymbolDumper.cpp5
-rw-r--r--tools/llvm-pdbutil/MinimalSymbolDumper.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/tools/llvm-pdbutil/MinimalSymbolDumper.cpp b/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
index 678376b5957..a6816bde0ea 100644
--- a/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
+++ b/tools/llvm-pdbutil/MinimalSymbolDumper.cpp
@@ -29,6 +29,7 @@ static StringRef getSymbolKindName(SymbolKind K) {
#define SYMBOL_RECORD(EnumName, value, name) \
case EnumName: \
return #EnumName;
+#define CV_SYMBOL(EnumName, value) SYMBOL_RECORD(EnumName, value, EnumName)
#include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
default:
llvm_unreachable("Unknown symbol kind!");
@@ -385,6 +386,10 @@ Error MinimalSymbolDumper::visitSymbolBegin(codeview::CVSymbol &Record,
}
Error MinimalSymbolDumper::visitSymbolEnd(CVSymbol &Record) {
+ if (RecordBytes) {
+ AutoIndent Indent(P, 7);
+ P.formatBinary("bytes", Record.content(), 0);
+ }
P.Unindent();
return Error::success();
}
diff --git a/tools/llvm-pdbutil/MinimalSymbolDumper.h b/tools/llvm-pdbutil/MinimalSymbolDumper.h
index a140af74b69..d9e9861d5b3 100644
--- a/tools/llvm-pdbutil/MinimalSymbolDumper.h
+++ b/tools/llvm-pdbutil/MinimalSymbolDumper.h
@@ -25,7 +25,7 @@ public:
MinimalSymbolDumper(LinePrinter &P, bool RecordBytes,
codeview::LazyRandomTypeCollection &Ids,
codeview::LazyRandomTypeCollection &Types)
- : P(P), Ids(Ids), Types(Types) {}
+ : P(P), RecordBytes(RecordBytes), Ids(Ids), Types(Types) {}
Error visitSymbolBegin(codeview::CVSymbol &Record) override;
Error visitSymbolBegin(codeview::CVSymbol &Record, uint32_t Offset) override;
@@ -44,6 +44,7 @@ private:
std::string idIndex(codeview::TypeIndex TI) const;
LinePrinter &P;
+ bool RecordBytes;
codeview::LazyRandomTypeCollection &Ids;
codeview::LazyRandomTypeCollection &Types;
};