diff options
author | Zachary Turner <zturner@google.com> | 2017-08-02 22:25:52 +0000 |
---|---|---|
committer | Zachary Turner <zturner@google.com> | 2017-08-02 22:25:52 +0000 |
commit | c3d8eec9e9a96be8ab87dea895f5ee452347192d (patch) | |
tree | 5615cbaef219918c97504e38e9680b7f1a807127 /llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp | |
parent | a2f57be26073562b40e8ea2bd76aa4f1d3142f61 (diff) | |
download | bcm5719-llvm-c3d8eec9e9a96be8ab87dea895f5ee452347192d.tar.gz bcm5719-llvm-c3d8eec9e9a96be8ab87dea895f5ee452347192d.zip |
[pdbutil] Add a command to dump the FPM.
Recently problems have been discovered in the way we write the FPM
(free page map). In order to fix this, we first need to establish
a baseline about what a correct FPM looks like using an MSVC
generated PDB, so that we can then make our own generated PDBs
match. And in order to do this, the dumper needs a mode where it
can dump an FPM so that we can write tests for it.
This patch adds a command to dump the FPM, as well as a test against
a known-good PDB.
llvm-svn: 309894
Diffstat (limited to 'llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp index e45f4ae0ed9..2a200edeaf7 100644 --- a/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp +++ b/llvm/lib/DebugInfo/MSF/MappedBlockStream.cpp @@ -11,7 +11,6 @@ #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/STLExtras.h" #include "llvm/DebugInfo/MSF/MSFCommon.h" -#include "llvm/DebugInfo/MSF/MSFStreamLayout.h" #include "llvm/Support/Endian.h" #include "llvm/Support/Error.h" #include "llvm/Support/MathExtras.h" @@ -36,19 +35,6 @@ public: } // end anonymous namespace -static void initializeFpmStreamLayout(const MSFLayout &Layout, - MSFStreamLayout &FpmLayout) { - uint32_t NumFpmIntervals = msf::getNumFpmIntervals(Layout); - support::ulittle32_t FpmBlock = Layout.SB->FreeBlockMapBlock; - assert(FpmBlock == 1 || FpmBlock == 2); - while (NumFpmIntervals > 0) { - FpmLayout.Blocks.push_back(FpmBlock); - FpmBlock += msf::getFpmIntervalLength(Layout); - --NumFpmIntervals; - } - FpmLayout.Length = msf::getFullFpmByteSize(Layout); -} - using Interval = std::pair<uint32_t, uint32_t>; static Interval intersect(const Interval &I1, const Interval &I2) { @@ -95,8 +81,7 @@ std::unique_ptr<MappedBlockStream> MappedBlockStream::createFpmStream(const MSFLayout &Layout, BinaryStreamRef MsfData, BumpPtrAllocator &Allocator) { - MSFStreamLayout SL; - initializeFpmStreamLayout(Layout, SL); + MSFStreamLayout SL(getFpmStreamLayout(Layout)); return createStream(Layout.SB->BlockSize, SL, MsfData, Allocator); } @@ -363,8 +348,7 @@ std::unique_ptr<WritableMappedBlockStream> WritableMappedBlockStream::createFpmStream(const MSFLayout &Layout, WritableBinaryStreamRef MsfData, BumpPtrAllocator &Allocator) { - MSFStreamLayout SL; - initializeFpmStreamLayout(Layout, SL); + MSFStreamLayout SL(getFpmStreamLayout(Layout)); return createStream(Layout.SB->BlockSize, SL, MsfData, Allocator); } |