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

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 13:33:48 PDT 2016


ruiu added inline comments.

================
Comment at: lib/DebugInfo/PDB/Raw/PDBFile.cpp:53-56
@@ +52,6 @@
+Expected<std::vector<uint32_t>> PDBFile::getUsedBlockList() const {
+  uint64_t Offset = ContainerLayout.SB->FreeBlockMapBlock * getBlockSize();
+  ArrayRef<uint8_t> Result;
+  if (auto EC = Buffer->readBytes(Offset, getBlockSize(), Result))
+    return std::move(EC);
+
----------------
zturner wrote:
> majnemer wrote:
> > majnemer wrote:
> > > majnemer wrote:
> > > > zturner wrote:
> > > > > majnemer wrote:
> > > > > > This will only read a single block right?
> > > > > > If the block size was 4 KB, would that mean that the FPM can only account for 128 MB?
> > > > > > This seems small.
> > > > > > 
> > > > > > Microsoft's code suggests that the FPM could span two blocks:
> > > > > > https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L222
> > > > > It doesn't span 2 pages.  But it's *either* page 1 or page 2.  Which one it is depends on the second field in the super block.  But whichever one it is, it's only that 1 page.  
> > > > I don't think that's right:
> > > > https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L172
> > > Also:
> > > https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L38
> > Hmm, but there is also:
> > > In the interest of the on-disk size of the file, the FPM has been split across the file at regular intervals, with new intervals introduced as needed.
> > 
> > https://github.com/Microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L49
> Yea, but read the very next line:
> 
> ```According to hdr.pnFpm, the first or the second free page map is valid.```
> 
> What I'm not sure about is this line:
> 
> ```In the interest of the on-disk size of the file, the FPM has been split across the file at regular intervals, with new intervals introduced as needed```
At least, the test PDB file I was using contains a seemingly valid FPM in FPM2, and FPM1 contents doesn't seem to make sense.


https://reviews.llvm.org/D22974





More information about the llvm-commits mailing list