aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-02-10 22:43:25 +0000
committerZachary Turner <zturner@google.com>2015-02-10 22:43:25 +0000
commita5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9 (patch)
tree9012681968824b47f3c3f208cd91fa82cf48aa5d /llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
parentca19485f08fc41bb7de5be925c06735937b3ea50 (diff)
downloadllvm-a5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9.zip
llvm-a5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9.tar.gz
llvm-a5549178f12d3d4dad72e1ab8efbb6fc9ed0d2c9.tar.bz2
Rewrite llvm-pdbdump in terms of LLVMDebugInfoPDB.
This makes llvm-pdbdump available on all platforms, although it will currently fail to create a dumper if there is no PDB reader implementation for the current platform. It implements dumping of compilands and children, which is less information than was previously available, but it has to be rewritten from scratch using the new set of interfaces, so the rest of the functionality will be added back in subsequent commits. llvm-svn: 228755
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
index 494c51c..c058949 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
@@ -9,6 +9,8 @@
#include <utility>
+#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
+#include "llvm/DebugInfo/PDB/PDBExtras.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
#include "llvm/Support/ConvertUTF.h"
@@ -21,5 +23,28 @@ PDBSymbolExe::PDBSymbolExe(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
: PDBSymbol(PDBSession, std::move(Symbol)) {}
-void PDBSymbolExe::dump(llvm::raw_ostream &OS) const {
+void PDBSymbolExe::dump(raw_ostream &OS, int Indent,
+ PDB_DumpLevel Level) const {
+ std::string FileName(getSymbolsFileName());
+
+ OS << "Summary for " << FileName << "\n";
+
+ TagStats Stats;
+ auto ChildrenEnum = getChildStats(Stats);
+ OS << stream_indent(Indent + 2) << "Children: " << Stats << "\n";
+
+ uint64_t FileSize = 0;
+ if (!llvm::sys::fs::file_size(FileName, FileSize))
+ OS << " Size: " << FileSize << " bytes\n";
+ else
+ OS << " Size: (Unable to obtain file size)\n";
+ PDB_UniqueId Guid = getGuid();
+ OS << " Guid: " << Guid << "\n";
+ OS << " Age: " << getAge() << "\n";
+ OS << " Attributes: ";
+ if (hasCTypes())
+ OS << "HasCTypes ";
+ if (hasPrivateSymbols())
+ OS << "HasPrivateSymbols ";
+ OS << "\n";
}