This is an archive of the discontinued LLVM Phabricator instance.

[PDB] Fix alignment of symbol record string
AbandonedPublic

Authored by zturner on May 31 2017, 5:01 PM.

Details

Reviewers
inglorion
Summary

The symbol record substream needs to be written at a multiple of 4 bytes. This is because the next field that is read is the beginning of the module debug subsections (checksums, lines, etc) and the first field is a uint32.

I found this by round-tripping empty.pdb from the test folder and seeing it give me an error. To determine the correct fix, I stepped through the reading code of empty.pdb and saw that the Symbol Record Substream consisted of 208 bytes, a multiple of 4. This is the value that the header reported for the "symbol record substream size", as well as the number of subsequent bytes we read and attributed to the symbol record substream. When I converted this file to yaml, and then converted it back to pdb, we were writing 206 bytes for this value, and then writing 206 bytes of data.

Diff Detail

Event Timeline

zturner created this revision.May 31 2017, 5:01 PM
inglorion edited edge metadata.Jun 6 2017, 2:53 PM

This change is no longer necessary, right?

zturner abandoned this revision.Jun 6 2017, 3:05 PM