summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-04-26 18:42:34 +0000
committerZachary Turner <zturner@google.com>2016-04-26 18:42:34 +0000
commit53a65ba5c98ca29c568ff18fe14e11ce6ff53b43 (patch)
treed49e2aae51f3aab0f7882005430c701e0504705c /llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
parent35c913dd4cd51ca0cb816e1ec60d16bc205b74fb (diff)
downloadbcm5719-llvm-53a65ba5c98ca29c568ff18fe14e11ce6ff53b43.tar.gz
bcm5719-llvm-53a65ba5c98ca29c568ff18fe14e11ce6ff53b43.zip
Parse and dump PDB DBI Stream Header Information
The DBI stream contains a lot of bookkeeping information for other streams. In particular it contains information about section contributions and linked modules. This patch is a first attempt at parsing some of the information out of the DBI stream. It currently only parses and dumps the headers of the DBI stream, so none of the module data or section contribution data is pulled out. This is just a proof of concept that we understand the basic properties of the DBI stream's metadata, and followup patches will try to extract more detailed information out. Differential Revision: http://reviews.llvm.org/D19500 Reviewed By: majnemer, ruiu llvm-svn: 267585
Diffstat (limited to 'llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
index c9c78a97110..4f24e058f21 100644
--- a/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
+++ b/llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
@@ -35,6 +35,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
#include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
+#include "llvm/DebugInfo/PDB/Raw/PDBDbiStream.h"
#include "llvm/DebugInfo/PDB/Raw/PDBFile.h"
#include "llvm/DebugInfo/PDB/Raw/PDBInfoStream.h"
#include "llvm/DebugInfo/PDB/Raw/PDBStream.h"
@@ -234,10 +235,7 @@ static void dumpStructure(RawSession &RS) {
}
}
- PDBInfoStream InfoStream(File);
- if (auto EC = InfoStream.reload())
- reportError("", EC);
-
+ PDBInfoStream &InfoStream = File.getPDBInfoStream();
outs() << "Version: " << InfoStream.getVersion() << '\n';
outs() << "Signature: ";
outs().write_hex(InfoStream.getSignature()) << '\n';
@@ -264,6 +262,22 @@ static void dumpStructure(RawSession &RS) {
if (NameStreamSignature != 0xeffeeffe || NameStreamVersion != 1)
reportError("", std::make_error_code(std::errc::not_supported));
}
+
+ PDBDbiStream &DbiStream = File.getPDBDbiStream();
+ outs() << "Dbi Version: " << DbiStream.getDbiVersion() << '\n';
+ outs() << "Age: " << DbiStream.getAge() << '\n';
+ outs() << "Incremental Linking: " << DbiStream.isIncrementallyLinked()
+ << '\n';
+ outs() << "Has CTypes: " << DbiStream.hasCTypes() << '\n';
+ outs() << "Is Stripped: " << DbiStream.isStripped() << '\n';
+ outs() << "Machine Type: " << DbiStream.getMachineType() << '\n';
+ outs() << "Number of Symbols: " << DbiStream.getNumberOfSymbols() << '\n';
+
+ uint16_t Major = DbiStream.getBuildMajorVersion();
+ uint16_t Minor = DbiStream.getBuildMinorVersion();
+ outs() << "Toolchain Version: " << Major << "." << Minor << '\n';
+ outs() << "mspdb" << Major << Minor << ".dll version: " << Major << "."
+ << Minor << "." << DbiStream.getPdbDllVersion() << '\n';
}
static void dumpInput(StringRef Path) {
OpenPOWER on IntegriCloud