diff options
author | Zachary Turner <zturner@google.com> | 2017-02-16 23:35:45 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-02-16 23:35:45 +0000 |
commit | 7b327d051b12f90e4650a8ac48cd3f7b3ee1c4e9 (patch) | |
tree | 8bf152120db1248d4f0a38028cda19909986f907 /llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp | |
parent | 55aaa844cb12923529c9ff128be22cdaddcce9dd (diff) | |
download | llvm-7b327d051b12f90e4650a8ac48cd3f7b3ee1c4e9.zip llvm-7b327d051b12f90e4650a8ac48cd3f7b3ee1c4e9.tar.gz llvm-7b327d051b12f90e4650a8ac48cd3f7b3ee1c4e9.tar.bz2 |
[pdb] Add the ability to resolve TypeServer PDBs.
Some PDBs or object files can contain references to other PDBs
where the real type information lives. When this happens,
all type indices in the original PDB are meaningless because
their records are not there.
With this patch we add the ability to pull type info from those
secondary PDBs.
Differential Revision: https://reviews.llvm.org/D29973
llvm-svn: 295382
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp index 02e883b..3a3692d 100644 --- a/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/PDBFile.cpp @@ -25,6 +25,7 @@ #include "llvm/DebugInfo/PDB/Native/TpiStream.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" +#include "llvm/Support/Path.h" #include <algorithm> #include <cassert> #include <cstdint> @@ -38,12 +39,18 @@ namespace { typedef FixedStreamArray<support::ulittle32_t> ulittle_array; } // end anonymous namespace -PDBFile::PDBFile(std::unique_ptr<ReadableStream> PdbFileBuffer, +PDBFile::PDBFile(StringRef Path, std::unique_ptr<ReadableStream> PdbFileBuffer, BumpPtrAllocator &Allocator) - : Allocator(Allocator), Buffer(std::move(PdbFileBuffer)) {} + : FilePath(Path), Allocator(Allocator), Buffer(std::move(PdbFileBuffer)) {} PDBFile::~PDBFile() = default; +StringRef PDBFile::getFilePath() const { return FilePath; } + +StringRef PDBFile::getFileDirectory() const { + return sys::path::parent_path(FilePath); +} + uint32_t PDBFile::getBlockSize() const { return ContainerLayout.SB->BlockSize; } uint32_t PDBFile::getFreeBlockMapBlock() const { |