diff options
author | Rui Ueyama <ruiu@google.com> | 2016-06-06 18:39:21 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2016-06-06 18:39:21 +0000 |
commit | ef2b48848256ce6e87ccd393d5a9cbb56a3042ef (patch) | |
tree | d90530af5768c85c13bf502446baf9999c0d34b2 /llvm/lib/DebugInfo/PDB | |
parent | 77ea344786abf9e96805641868dcd04f59e452ad (diff) | |
download | bcm5719-llvm-ef2b48848256ce6e87ccd393d5a9cbb56a3042ef.tar.gz bcm5719-llvm-ef2b48848256ce6e87ccd393d5a9cbb56a3042ef.zip |
[pdbdump] Print out New FPO stream contents.
The data strucutre in the new FPO stream is described in the
PE/COFF spec. There is one record per function if frame pointer
is omitted.
Differential Revision: http://reviews.llvm.org/D20999
llvm-svn: 271926
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp index e79d6572be1..b1c571bf78c 100644 --- a/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Raw/DbiStream.cpp @@ -186,9 +186,10 @@ Error DbiStream::reload() { return EC; if (auto EC = initializeSectionMapData()) return EC; - if (auto EC = initializeFileInfo()) return EC; + if (auto EC = initializeFpoRecords()) + return EC; if (Reader.bytesRemaining() > 0) return make_error<RawError>(raw_error_code::corrupt_file, @@ -252,6 +253,10 @@ DbiStream::getSectionHeaders() { return SectionHeaders; } +codeview::FixedStreamArray<object::FpoData> DbiStream::getFpoRecords() { + return FpoRecords; +} + ArrayRef<ModuleInfoEx> DbiStream::modules() const { return ModuleInfos; } codeview::FixedStreamArray<SecMapEntry> DbiStream::getSectionMap() const { return SectionMap; @@ -300,6 +305,24 @@ Error DbiStream::initializeSectionHeadersData() { return Error::success(); } +// Initializes this->Fpos. +Error DbiStream::initializeFpoRecords() { + uint32_t StreamNum = getDebugStreamIndex(DbgHeaderType::NewFPO); + FpoStream.reset(new MappedBlockStream(StreamNum, Pdb)); + + size_t StreamLen = FpoStream->getLength(); + if (StreamLen % sizeof(object::FpoData)) + return make_error<RawError>(raw_error_code::corrupt_file, + "Corrupted New FPO stream."); + + size_t NumRecords = StreamLen / sizeof(object::FpoData); + codeview::StreamReader Reader(*FpoStream); + if (auto EC = Reader.readArray(FpoRecords, NumRecords)) + return make_error<RawError>(raw_error_code::corrupt_file, + "Corrupted New FPO stream."); + return Error::success(); +} + Error DbiStream::initializeSectionMapData() { StreamReader SMReader(SecMapSubstream); const SecMapHeader *Header; |