diff options
author | Zachary Turner <zturner@google.com> | 2017-03-16 20:18:41 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-03-16 20:18:41 +0000 |
commit | 02278ce09f7a661865143e1fe7983024ee0ddc93 (patch) | |
tree | ff9d5902cffc02c6d0d101abe00fff94bb761467 /llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp | |
parent | fa9e84eb6d36dc2f7c9cc4ddee2c325b2580c393 (diff) | |
download | bcm5719-llvm-02278ce09f7a661865143e1fe7983024ee0ddc93.tar.gz bcm5719-llvm-02278ce09f7a661865143e1fe7983024ee0ddc93.zip |
[llvm-pdbdump] Add support for diffing the PDB Stream.
In doing so I discovered that we completely ignore some bytes
of the PDB Stream after we "finish" loading it. These bytes
seem to specify some additional information about what kind
of data is present in the PDB. A subsequent patch will add
code to read in those fields and store their values.
llvm-svn: 297983
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp index f3f64847fcf..1ce0fe84206 100644 --- a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp @@ -51,9 +51,16 @@ Error InfoStream::reload() { Age = H->Age; Guid = H->Guid; - return NamedStreams.load(Reader); + uint32_t Offset = Reader.getOffset(); + if (auto EC = NamedStreams.load(Reader)) + return EC; + uint32_t NewOffset = Reader.getOffset(); + NamedStreamMapByteSize = NewOffset - Offset; + return Error::success(); } +uint32_t InfoStream::getStreamSize() const { return Stream->getLength(); } + uint32_t InfoStream::getNamedStreamIndex(llvm::StringRef Name) const { uint32_t Result; if (!NamedStreams.get(Name, Result)) @@ -76,6 +83,10 @@ uint32_t InfoStream::getAge() const { return Age; } PDB_UniqueId InfoStream::getGuid() const { return Guid; } +uint32_t InfoStream::getNamedStreamMapByteSize() const { + return NamedStreamMapByteSize; +} + const NamedStreamMap &InfoStream::getNamedStreams() const { return NamedStreams; } |