[PDB] Fix function names for private symbols in PDBs
authorReid Kleckner <rnk@google.com>
Wed, 27 Apr 2016 16:10:29 +0000 (16:10 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 27 Apr 2016 16:10:29 +0000 (16:10 +0000)
commit0336cc05e718cd394cfd22ab519f9a9a4c998b08
treef9a992b369a5c359b90467a097be779c83825a64
parent5b759f82fa0a48eb828d59efd5fa2b923eb94a3d
[PDB] Fix function names for private symbols in PDBs

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

Reviewers: zturner

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19571

llvm-svn: 267732
llvm/lib/DebugInfo/PDB/PDBContext.cpp
llvm/test/tools/llvm-symbolizer/pdb/Inputs/test.cpp
llvm/test/tools/llvm-symbolizer/pdb/Inputs/test.exe
llvm/test/tools/llvm-symbolizer/pdb/Inputs/test.pdb
llvm/test/tools/llvm-symbolizer/pdb/pdb.test