This is an archive of the discontinued LLVM Phabricator instance.

[PDB] Fix function names for private symbols in PDBs
ClosedPublic

Authored by rnk on Apr 26 2016, 4:56 PM.

Details

Summary

llvm-symbolizer wants to get linkage names of functions for historical
reasons. Linkage names are only recorded in the PDB for public symbols,
and the linkage name is apparently stored separately in some "public
symbol" record. We had a workaround in PDBContext which would look for
such symbols when the user requested linkage names.

However, when given an address that was truly in a private function and
public funciton, we would accidentally find nearby public symbols and
return those function names. The fix is to look for both function
symbols and public symbols and only prefer the public symbol name if the
addresses of the symbols agree.

Fixes PR27492

Diff Detail

Repository
rL LLVM

Event Timeline

rnk updated this revision to Diff 55131.Apr 26 2016, 4:56 PM
rnk retitled this revision from to [PDB] Fix function names for private symbols in PDBs.
rnk updated this object.
rnk added a reviewer: zturner.
rnk added a subscriber: llvm-commits.
zturner added inline comments.Apr 26 2016, 5:02 PM
lib/DebugInfo/PDB/PDBContext.cpp
113–114 ↗(On Diff #55131)

Use getVirtualAddress() or getRelativeVirtualAddress() here to simplify this conditional.

zturner accepted this revision.Apr 26 2016, 5:02 PM
zturner edited edge metadata.
This revision is now accepted and ready to land.Apr 26 2016, 5:02 PM
This revision was automatically updated to reflect the committed changes.