summaryrefslogtreecommitdiffstats
path: root/llvm/tools/dsymutil/MachODebugMapParser.cpp
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-10-06 17:43:37 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-10-06 17:43:37 +0000
commitb468fd64f9aa12d60b20ccfb576dbec470585026 (patch)
treec4ca6a1e1a9bb64e9f6f23e2dcc9584af738ef12 /llvm/tools/dsymutil/MachODebugMapParser.cpp
parentde42c29a68bc4ab1143f6a1e76beda49ca6cde7a (diff)
downloadbcm5719-llvm-b468fd64f9aa12d60b20ccfb576dbec470585026.tar.gz
bcm5719-llvm-b468fd64f9aa12d60b20ccfb576dbec470585026.zip
[dsymutil] Emit valid debug locations when no symbol flags are set
Summary: swiftc emits symbols without flags set, which led dsymutil to ignore them when searching for global symbols, causing dwarf location data to be omitted. Xcode's dsymutil handles this case correctly, and emits valid location data. Add this functionality to llvm-dsymutil by allowing parsing of symbols with no flags set. Reviewers: aprantl, friss, JDevlieghere Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D38587 llvm-svn: 315082
Diffstat (limited to 'llvm/tools/dsymutil/MachODebugMapParser.cpp')
-rw-r--r--llvm/tools/dsymutil/MachODebugMapParser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/dsymutil/MachODebugMapParser.cpp b/llvm/tools/dsymutil/MachODebugMapParser.cpp
index 79b19137119..0cd6a89cc01 100644
--- a/llvm/tools/dsymutil/MachODebugMapParser.cpp
+++ b/llvm/tools/dsymutil/MachODebugMapParser.cpp
@@ -482,7 +482,9 @@ void MachODebugMapParser::loadMainBinarySymbols(
// are the only ones that need to be queried because the address
// of common data won't be described in the debug map. All other
// addresses should be fetched for the debug map.
- if (!(Sym.getFlags() & SymbolRef::SF_Global))
+ uint8_t SymType =
+ MainBinary.getSymbolTableEntry(Sym.getRawDataRefImpl()).n_type;
+ if (!(SymType & (MachO::N_EXT | MachO::N_PEXT)))
continue;
Expected<section_iterator> SectionOrErr = Sym.getSection();
if (!SectionOrErr) {
OpenPOWER on IntegriCloud