diff options
author | Zachary Turner <zturner@google.com> | 2017-06-30 21:35:00 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-06-30 21:35:00 +0000 |
commit | af8c75a8c0dd3b86e67c28089ab61aea565c5f95 (patch) | |
tree | 77b0ae71a4cc9221df4a9de8e567110e40a8dd9d /llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp | |
parent | 45a7462094fc204487b71de767fd87eb28a056e6 (diff) | |
download | bcm5719-llvm-af8c75a8c0dd3b86e67c28089ab61aea565c5f95.tar.gz bcm5719-llvm-af8c75a8c0dd3b86e67c28089ab61aea565c5f95.zip |
[llvm-pdbutil] Output the symbol offset when dumping.
Type records have a unique type index, but symbol records do
not. Instead, symbol records refer to other symbol records
by referencing their offset in the symbol stream. In a sense
this is the analogue of the TypeIndex, but we are not printing
it in the dumper. Printing it not only gives us more useful
information when manually investigating the contents of a PDB,
but also allows us to write better tests by enabling us to
verify that fields that reference other symbol records do
so correctly.
Differential Revision: https://reviews.llvm.org/D34906
llvm-svn: 306890
Diffstat (limited to 'llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp')
-rw-r--r-- | llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp index 3a956c9f64f..a1f919b4dd0 100644 --- a/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp +++ b/llvm/tools/llvm-pdbutil/DumpOutputStyle.cpp @@ -834,7 +834,8 @@ Error DumpOutputStyle::dumpModuleSyms() { Pipeline.addCallbackToPipeline(Deserializer); Pipeline.addCallbackToPipeline(Dumper); CVSymbolVisitor Visitor(Pipeline); - if (auto EC = Visitor.visitSymbolStream(ModS.getSymbolArray())) { + auto SS = ModS.getSymbolsSubstream(); + if (auto EC = Visitor.visitSymbolStream(ModS.getSymbolArray(), SS.Offset)) { P.formatLine("Error while processing symbol records. {0}", toString(std::move(EC))); continue; @@ -863,13 +864,14 @@ Error DumpOutputStyle::dumpPublics() { Pipeline.addCallbackToPipeline(Deserializer); Pipeline.addCallbackToPipeline(Dumper); CVSymbolVisitor Visitor(Pipeline); + auto ExpectedSymbols = Publics.getSymbolArray(); if (!ExpectedSymbols) { P.formatLine("Could not read public symbol record stream"); return Error::success(); } - if (auto EC = Visitor.visitSymbolStream(*ExpectedSymbols)) + if (auto EC = Visitor.visitSymbolStream(*ExpectedSymbols, 0)) P.formatLine("Error while processing public symbol records. {0}", toString(std::move(EC))); |