This is an archive of the discontinued LLVM Phabricator instance.

Write CodeView file checksum and line information to PDB
ClosedPublic

Authored by zturner on May 1 2017, 12:35 PM.

Details

Summary

This was originally uploaded as D32615, but some problems were discovered in the way that filenames were mapped to indices, which necessitated some preliminary refactoring. That has been done, so this is the new patch uploaded, based on top of the refactorings. Hopefully this diff is much smaller than before.

For example usage of the API, see the yamlToPdb function in llvm-pdbdump.cpp

Diff Detail

Event Timeline

zturner created this revision.May 1 2017, 12:35 PM
inglorion added inline comments.May 1 2017, 2:18 PM
llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentRecord.cpp
40

This is essentially an assert, right? Do you want this check to be performed even in noassert builds? If not, please rewrite using assert. If you do want this evaluated in noassert builds, can you replace __debugbreak with llvm_unreachable?

llvm/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
44

Do you still need the TODO or is this done now?

76

We're calling this method from both finalize() and finalizeMsfLayout(). Can we avoid having to call it twice?

zturner added inline comments.May 1 2017, 2:35 PM
llvm/lib/DebugInfo/CodeView/ModuleDebugFragmentRecord.cpp
40

Yea, this is supposed to be an unreachable. My bad.

llvm/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
44

Nope, I can remove.

76

Unfortunately no, at least not with the way the classes are currently designed. It's been something I've been thinking about for a while but I don't have a good solution yet.

I'll make the two suggested fixes offline btw, I'll wait and see if there's anything else before uploading another revision though.

inglorion added inline comments.May 1 2017, 2:39 PM
llvm/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
76

I'm ok getting the existing code in as a first cut and thinking about improving it later. Can you add a TODO so that we have something we can easily grep for?

zturner added inline comments.May 1 2017, 2:52 PM
llvm/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp
76

Sure. FWIW all of the builder classes follow the same pattern, so currently this is somewhat prevalent.

This revision was automatically updated to reflect the committed changes.