aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-05-20 19:55:17 +0000
committerRui Ueyama <ruiu@google.com>2016-05-20 19:55:17 +0000
commit0fcd82605e448f52d80de4c74bd0a19376b9052e (patch)
treed4a605b46337baaea7bd2dcb1ed1f50559876dc6 /llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
parentf7449a179b5398295ece62dbcc250686179a6dfd (diff)
downloadllvm-0fcd82605e448f52d80de4c74bd0a19376b9052e.zip
llvm-0fcd82605e448f52d80de4c74bd0a19376b9052e.tar.gz
llvm-0fcd82605e448f52d80de4c74bd0a19376b9052e.tar.bz2
pdbdump: print out symbol names referred by publics stream.
DBI stream contains a stream number of the symbol record stream. Symbol record streams is an array of length-type-value members. Each member represents one symbol. Publics stream contains offsets to the symbol record stream. This patch is to print out all symbols that are referenced by the publics stream. Note that even with this patch, llvm-pdbdump cannot dump all the information in a publics stream since it contains more information than symbol names. I'll improve it in followup patches. Differential Revision: http://reviews.llvm.org/D20480 llvm-svn: 270262
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
index d587704..a8143a9 100644
--- a/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
+++ b/llvm/lib/DebugInfo/PDB/Raw/PDBFile.cpp
@@ -13,6 +13,7 @@
#include "llvm/DebugInfo/PDB/Raw/InfoStream.h"
#include "llvm/DebugInfo/PDB/Raw/PublicsStream.h"
#include "llvm/DebugInfo/PDB/Raw/RawError.h"
+#include "llvm/DebugInfo/PDB/Raw/SymbolStream.h"
#include "llvm/DebugInfo/PDB/Raw/TpiStream.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/MemoryBuffer.h"
@@ -307,3 +308,17 @@ Expected<PublicsStream &> PDBFile::getPDBPublicsStream() {
}
return *Publics;
}
+
+Expected<SymbolStream &> PDBFile::getPDBSymbolStream() {
+ if (!Symbols) {
+ auto DbiS = getPDBDbiStream();
+ if (auto EC = DbiS.takeError())
+ return std::move(EC);
+ uint32_t SymbolStreamNum = DbiS->getSymRecordStreamIndex();
+
+ Symbols.reset(new SymbolStream(*this, SymbolStreamNum));
+ if (auto EC = Symbols->reload())
+ return std::move(EC);
+ }
+ return *Symbols;
+}