This is an archive of the discontinued LLVM Phabricator instance.

[Symbolize] Check if the PE file has a PDB and emit an error if we can't load it
ClosedPublic

Authored by rnk on Jun 3 2016, 12:48 PM.

Details

Summary

Previously we would try to load PDBs for every PE executable we tried to
symbolize. If that failed, we would fall back to DWARF. If there wasn't
any DWARF, we'd print mostly useless symbol information using the export
table.

With this change, we only try to load PDBs for executables that claim to
have them. If that fails, we can now print an error rather than falling
back silently. This should make it a lot easier to diagnose and fix
common symbolization issues, such as not having DIA or not having a PDB.

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 59605.Jun 3 2016, 12:48 PM
rnk retitled this revision from to [Symbolize] Check if the PE file has a PDB and emit an error if we can't load it.
rnk updated this object.
rnk added reviewers: zturner, eugenis.
rnk added a subscriber: llvm-commits.
zturner added inline comments.Jun 3 2016, 12:55 PM
lib/DebugInfo/Symbolize/Symbolize.cpp
56–60 ↗(On Diff #59605)

I think this is usually written:

SymbolizableModule *Info = nullptr;
if (auto InfoOrErr = getOrCreateModuleInfo(ModuleName))
  Info = InfoOrErr.get();
else
  return InfoOrErr;

Almost wonder if we need a macro for this considering how frequently we do it.

rnk updated this revision to Diff 59606.Jun 3 2016, 1:04 PM
rnk marked an inline comment as done.
  • Use the standard error return check
zturner accepted this revision.Jun 3 2016, 1:19 PM
zturner edited edge metadata.
This revision is now accepted and ready to land.Jun 3 2016, 1:19 PM
This revision was automatically updated to reflect the committed changes.