diff options
author | Zachary Turner <zturner@google.com> | 2018-03-30 17:16:50 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2018-03-30 17:16:50 +0000 |
commit | d5cf5cf637918664c6de75c0685786acb2a2b92c (patch) | |
tree | da6a5622ec4166360922f051c7b09b7ec892d1be /llvm/lib/DebugInfo/PDB | |
parent | 0945ad6643e240bb9fb5c89b3abdfa0f9b9bfac2 (diff) | |
download | bcm5719-llvm-d5cf5cf637918664c6de75c0685786acb2a2b92c.tar.gz bcm5719-llvm-d5cf5cf637918664c6de75c0685786acb2a2b92c.zip |
[llvm-pdbutil] Dig deeper into the PDB and DBI streams when explaining.
This will show more detail when using `llvm-pdbutil explain` on an
offset in the DBI or PDB streams. Specifically, it will dig into
individual header fields and substreams to give a more precise
description of what the byte represents.
llvm-svn: 328878
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp index b4f217abf85..e9ae5a1a193 100644 --- a/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/InfoStream.cpp @@ -21,19 +21,18 @@ using namespace llvm::msf; using namespace llvm::pdb; InfoStream::InfoStream(std::unique_ptr<MappedBlockStream> Stream) - : Stream(std::move(Stream)) {} + : Stream(std::move(Stream)), Header(nullptr) {} Error InfoStream::reload() { BinaryStreamReader Reader(*Stream); - const InfoStreamHeader *H; - if (auto EC = Reader.readObject(H)) + if (auto EC = Reader.readObject(Header)) return joinErrors( std::move(EC), make_error<RawError>(raw_error_code::corrupt_file, "PDB Stream does not contain a header.")); - switch (H->Version) { + switch (Header->Version) { case PdbImplVC70: case PdbImplVC80: case PdbImplVC110: @@ -44,11 +43,6 @@ Error InfoStream::reload() { "Unsupported PDB stream version."); } - Version = H->Version; - Signature = H->Signature; - Age = H->Age; - Guid = H->Guid; - uint32_t Offset = Reader.getOffset(); if (auto EC = NamedStreams.load(Reader)) return EC; @@ -108,14 +102,16 @@ bool InfoStream::containsIdStream() const { } PdbRaw_ImplVer InfoStream::getVersion() const { - return static_cast<PdbRaw_ImplVer>(Version); + return static_cast<PdbRaw_ImplVer>(uint32_t(Header->Version)); } -uint32_t InfoStream::getSignature() const { return Signature; } +uint32_t InfoStream::getSignature() const { + return uint32_t(Header->Signature); +} -uint32_t InfoStream::getAge() const { return Age; } +uint32_t InfoStream::getAge() const { return uint32_t(Header->Age); } -GUID InfoStream::getGuid() const { return Guid; } +GUID InfoStream::getGuid() const { return Header->Guid; } uint32_t InfoStream::getNamedStreamMapByteSize() const { return NamedStreamMapByteSize; |