summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-01-20 22:42:09 +0000
committerZachary Turner <zturner@google.com>2017-01-20 22:42:09 +0000
commit760ad4da6006422c5a6097232b5ffc72d6b906dd (patch)
treeb0f54c3f60c0a83538c23b3f3cfab7f0b23fcc1f /llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
parent60667ca0b2b95ee25dace3f8627feda5a904cd8f (diff)
downloadbcm5719-llvm-760ad4da6006422c5a6097232b5ffc72d6b906dd.tar.gz
bcm5719-llvm-760ad4da6006422c5a6097232b5ffc72d6b906dd.zip
[pdb] Write the Named Stream mapping to Yaml and binary.
Differential Revision: https://reviews.llvm.org/D28919 llvm-svn: 292665
Diffstat (limited to 'llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
index 762af6d1e5b..ccab7fe47b4 100644
--- a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -50,6 +50,7 @@
#include "llvm/DebugInfo/PDB/Raw/RawConstants.h"
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
#include "llvm/DebugInfo/PDB/Raw/RawSession.h"
+#include "llvm/DebugInfo/PDB/Raw/StringTableBuilder.h"
#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
#include "llvm/DebugInfo/PDB/Raw/TpiStreamBuilder.h"
#include "llvm/Support/COM.h"
@@ -232,6 +233,9 @@ cl::opt<bool>
cl::cat(SymbolOptions), cl::sub(RawSubcommand));
// MISCELLANEOUS OPTIONS
+cl::opt<bool> DumpStringTable("string-table", cl::desc("dump PDB String Table"),
+ cl::cat(MiscOptions), cl::sub(RawSubcommand));
+
cl::opt<bool> DumpSectionContribs("section-contribs",
cl::desc("dump section contributions"),
cl::cat(MiscOptions), cl::sub(RawSubcommand));
@@ -279,6 +283,10 @@ cl::opt<bool> StreamDirectory(
cl::opt<bool> PdbStream("pdb-stream",
cl::desc("Dump the PDB Stream (Stream 1)"),
cl::sub(PdbToYamlSubcommand), cl::init(false));
+
+cl::opt<bool> StringTable("string-table", cl::desc("Dump the PDB String Table"),
+ cl::sub(PdbToYamlSubcommand), cl::init(false));
+
cl::opt<bool> DbiStream("dbi-stream",
cl::desc("Dump the DBI Stream (Stream 2)"),
cl::sub(PdbToYamlSubcommand), cl::init(false));
@@ -345,14 +353,18 @@ static void yamlToPdb(StringRef Path) {
for (uint32_t I = 0; I < kSpecialStreamCount; ++I)
ExitOnErr(Builder.getMsfBuilder().addStream(0));
+ if (YamlObj.StringTable.hasValue()) {
+ auto &Strings = Builder.getStringTableBuilder();
+ for (auto S : *YamlObj.StringTable)
+ Strings.insert(S);
+ }
+
if (YamlObj.PdbStream.hasValue()) {
auto &InfoBuilder = Builder.getInfoBuilder();
InfoBuilder.setAge(YamlObj.PdbStream->Age);
InfoBuilder.setGuid(YamlObj.PdbStream->Guid);
InfoBuilder.setSignature(YamlObj.PdbStream->Signature);
InfoBuilder.setVersion(YamlObj.PdbStream->Version);
- for (auto &NM : YamlObj.PdbStream->NamedStreams)
- InfoBuilder.getNamedStreamsBuilder().set(NM.StreamName, NM.StreamNumber);
}
if (YamlObj.DbiStream.hasValue()) {
@@ -579,6 +591,7 @@ int main(int argc_, const char *argv_[]) {
opts::raw::DumpSectionContribs = true;
opts::raw::DumpLineInfo = true;
opts::raw::DumpFpo = true;
+ opts::raw::DumpStringTable = true;
}
if (opts::raw::CompactRecords &&
OpenPOWER on IntegriCloud