Page MenuHomePhabricator

[NativePDB] Fix access to both old & new fpo data entries from dbi stream
ClosedPublic

Authored by leonid.mashinskiy on Jan 15 2019, 8:05 AM.

Details

Summary

This patch fixes access to fpo streams in native pdb from DbiStream and makes code consistent with DbiStreamBuilder.

Required for D55122

Diff Detail

Repository
rL LLVM

Event Timeline

LGTM except the comment. Let's also wait for what Zachary will say.

lib/DebugInfo/PDB/Native/DbiStream.cpp
322–339 ↗(On Diff #181790)

May be it would be worth to create a private method for this to avoid duplication (e.g. CreateIndexedStreamForHeaderType)?

leonid.mashinskiy marked an inline comment as done.

Sorry about this, it slipped off my radar.

Two things I think we should do:

  1. Dump these records as part of llvm-pdbutil dump -fpo
  1. Using the results of #1, we can add a test for this. Check in a very small PDB that was built with /nodefaultlib by linking in an assembly file with a .debug$F section (if you can't figure out how to produce one, libcmtd has some. You can just use obj2yaml on them and strip out everything but the .debug$F section). This resulting PDB shoudl have both new and old fpo records, then we can test the output using llvm-pdbutil dump -fpo.
  • used new fpo related methods from DbiStream in llvm-pdbutil
  • added test to check fpo data using llvm-pdbutil

Please note that diff contains artificially constructed binary pdb file for test

zturner accepted this revision.Jan 29 2019, 10:03 AM
This revision is now accepted and ready to land.Jan 29 2019, 10:03 AM

Thank you for the review!
Please, commit this for me? I have no commit access but I need to attach pdb from patch that phabricator removed from raw diff.

This revision was automatically updated to reflect the committed changes.