diff options
author | Fangrui Song <maskray@google.com> | 2019-04-04 11:08:45 +0000 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2019-04-04 11:08:45 +0000 |
commit | e2622b3e331e26a34936c4aa3cc770267f31596e (patch) | |
tree | 3b0513a66d2090f891f7e89931dc88d2e85e5d72 /llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | |
parent | 094c72660a30c06085b86b7115165f6cc687f662 (diff) | |
download | llvm-e2622b3e331e26a34936c4aa3cc770267f31596e.zip llvm-e2622b3e331e26a34936c4aa3cc770267f31596e.tar.gz llvm-e2622b3e331e26a34936c4aa3cc770267f31596e.tar.bz2 |
[Symbolize] Keep SymbolDescs with the same address and improve getNameFromSymbolTable heuristic
I'll follow up with better heuristics or tests.
llvm-svn: 357683
Diffstat (limited to 'llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp index fc09be2..889b0c1 100644 --- a/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp +++ b/llvm/lib/DebugInfo/Symbolize/SymbolizableObjectFile.cpp @@ -198,7 +198,10 @@ bool SymbolizableObjectFile::getNameFromSymbolTable(SymbolRef::Type Type, const auto &SymbolMap = Type == SymbolRef::ST_Function ? Functions : Objects; if (SymbolMap.empty()) return false; - SymbolDesc SD = { Address, Address }; + SymbolDesc SD = {Address, UINT64_C(-1)}; + // SymbolDescs are sorted by (Addr,Size), if several SymbolDescs share the + // same Addr, pick the one with the largest Size. This helps us avoid symbols + // with no size information (Size=0). auto SymbolIterator = SymbolMap.upper_bound(SD); if (SymbolIterator == SymbolMap.begin()) return false; |