[PATCH] D22974: pdbdump: Dump Free Page Map contents.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 13:41:34 PDT 2016


zturner added inline comments.

================
Comment at: lib/DebugInfo/PDB/Raw/PDBFile.cpp:52
@@ +51,3 @@
+// because otherwise the result would be large, as most pages are unused.)
+Expected<std::vector<uint32_t>> PDBFile::getUsedBlockList() const {
+  uint64_t Offset = ContainerLayout.SB->FreeBlockMapBlock * getBlockSize();
----------------
ruiu wrote:
> zturner wrote:
> > How about adding another field to the `MsfLayout` class called `FreePageMap`?  You will need to set the value in `MsfBuilder::build()` before returning, and you will also need to set it in `PDBFile::parseFileHeaders()`.
> > 
> > This way you wouldn't need to return an `Expected<std::vector<uint32_t>>` but rather a `const BitVector&`, and the reading / writing code would share the same common structures.
> What is a bit annoying is that BitVector doesn't provide a way to map itself onto an existing bitmap, so I need to examine each bit and flip a bit in a BitVector. But, because the number of bits we have here is small anyways, it is probably okay to copy bit by bit. I'll try to add BitVector to MsfLayout.
It seems like we could just add a new constructor to the `BitVector` class like this:

`BitVector(BitWord *Buffer, uint32_t NumBits)`;


https://reviews.llvm.org/D22974





More information about the llvm-commits mailing list