[PATCH] D23145: pdbdump: Write a free page map to page 1 or page 2.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 18:13:22 PDT 2016


zturner added inline comments.

================
Comment at: lib/DebugInfo/MSF/MSFBuilder.cpp:261
@@ +260,3 @@
+  for (uint32_t BlockNumber : StreamData[0].second)
+    L.FreePageMap[BlockNumber] = 0;
+
----------------
Can we use false instead of 0?

================
Comment at: lib/DebugInfo/PDB/Raw/PDBFileBuilder.cpp:126
@@ +125,3 @@
+  // Write free page map.
+  Writer.setOffset(Layout.SB->BlockSize * Layout.SB->FreeBlockMapBlock);
+  if (auto EC = Writer.writeArray(ArrayRef<uint8_t>(toUint8Vector(Layout.FreePageMap))))
----------------
To fix the page 0 problem, how about this:

```
auto L = Layout.FreePageMap;
for (uint32_t BlockNumber : Layout.StreamMap[0].second)
  L[BlockNumber] = true;
```

and then write `L` instead of `Layout.FreePageMap`?


https://reviews.llvm.org/D23145





More information about the llvm-commits mailing list