[CodeView] Handle Cross Module Imports and Exports.

While it's not entirely clear why a compiler or linker might
put this information into an object or PDB file, one has been
spotted in the wild which was causing llvm-pdbdump to crash.

This patch adds support for reading-writing these sections.
Since I don't know how to get one of the native tools to
generate this kind of debug info, the only test here is one
in which we feed YAML into the tool to produce a PDB and
then spit out YAML from the resulting PDB and make sure that
it matches.

llvm-svn: 304738
This commit is contained in:
Zachary Turner
2017-06-05 21:40:33 +00:00
parent 5b0bf2ff0d
commit 349c18f837
20 changed files with 664 additions and 28 deletions

View File

@@ -90,14 +90,14 @@ Error ModuleDebugStreamRef::commit() { return Error::success(); }
Expected<codeview::DebugChecksumsSubsectionRef>
ModuleDebugStreamRef::findChecksumsSubsection() const {
codeview::DebugChecksumsSubsectionRef Result;
for (const auto &SS : subsections()) {
if (SS.kind() != DebugSubsectionKind::FileChecksums)
continue;
codeview::DebugChecksumsSubsectionRef Result;
if (auto EC = Result.initialize(SS.getRecordData()))
return std::move(EC);
return Result;
}
return make_error<RawError>(raw_error_code::no_entry);
return Result;
}