This is an archive of the discontinued LLVM Phabricator instance.

Do not pass a superblock to PDBFileBuilder.
ClosedPublic

Authored by ruiu on Sep 30 2016, 10:01 AM.

Details

Summary

When we create a PDB file using PDBFileBuilder, the information
in the superblock, such as the size of the resulting file, is not
available.

Previously, PDBFileBuilder::initialize took a superblock assuming
that all the members of the struct are correct. That is useful when
you want to restore the exact information from a YAML file, but
that's probably the only use case in which that is useful.
When we are creating a PDB file on the fly, we have to backfill the
members.

This patch redefines PDBFileBuilder::initialize to take only a
block size. Now all the other members are left as default values,
so that they'll be updated when commit() is called.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu updated this revision to Diff 73079.Sep 30 2016, 10:01 AM
ruiu retitled this revision from to Do not pass a superblock to PDBFileBuilder..
ruiu updated this object.
ruiu added a reviewer: zturner.
ruiu added a subscriber: llvm-commits.
zturner added inline comments.Sep 30 2016, 10:19 AM
test/DebugInfo/PDB/pdbdump-readwrite.test
8 ↗(On Diff #73079)

Is the only difference in the two check prefixes the number of blocks? If so I would just delete the value and leave one check statement (see the NumDirectoryBytes field, or the NumStreams field, for example.

ruiu added inline comments.Sep 30 2016, 1:52 PM
test/DebugInfo/PDB/pdbdump-readwrite.test
8 ↗(On Diff #73079)

FreeBlockMap and NumBlocks were different.

ruiu updated this revision to Diff 73132.Sep 30 2016, 1:53 PM
  • Merged two test CHECKs.
ruiu added a comment.Sep 30 2016, 1:55 PM

I wonder if we need BlockSize parameter. Is there any situation you want to create a PDB file with a smaller block size?

zturner accepted this revision.Sep 30 2016, 1:58 PM
zturner edited edge metadata.
This revision is now accepted and ready to land.Sep 30 2016, 1:58 PM
This revision was automatically updated to reflect the committed changes.