diff options
author | Greg Clayton <gclayton@apple.com> | 2013-10-31 16:59:47 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-10-31 16:59:47 +0000 |
commit | dc25a0bc648ae855f62c782fb0e42de620f90aae (patch) | |
tree | 59298d4fc012b8dd1fbd3087bd4203c70e7e3bf0 /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 13322c6edab73d18473120d12d5cf4ca9f71c179 (diff) | |
download | bcm5719-llvm-dc25a0bc648ae855f62c782fb0e42de620f90aae.tar.gz bcm5719-llvm-dc25a0bc648ae855f62c782fb0e42de620f90aae.zip |
<rdar://problem/14496092>
Fixes from code review by Jim Ingham that reinstate preferring an external vs non-external symbol when finding function addresses.
llvm-svn: 193761
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 4570e018619..87c984ddcfb 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1361,7 +1361,8 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, if (sc_list.GetSize()) { - Symbol *symbol = NULL; + Symbol *extern_symbol = NULL; + Symbol *non_extern_symbol = NULL; for (uint32_t index = 0, num_indices = sc_list.GetSize(); index < num_indices; @@ -1390,17 +1391,29 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, else if (sym_ctx.symbol) { if (sym_ctx.symbol->GetType() == eSymbolTypeReExported) - symbol = sym_ctx.symbol->ResolveReExportedSymbol(*target); + { + sym_ctx.symbol = sym_ctx.symbol->ResolveReExportedSymbol(*target); + if (sym_ctx.symbol == NULL) + continue; + } + + if (sym_ctx.symbol->IsExternal()) + extern_symbol = sym_ctx.symbol; else - symbol = sym_ctx.symbol; + non_extern_symbol = sym_ctx.symbol; } } if (!context.m_found.function_with_type_info) { - if (symbol) + if (extern_symbol) + { + AddOneFunction (context, NULL, extern_symbol, current_id); + context.m_found.function = true; + } + else if (non_extern_symbol) { - AddOneFunction (context, NULL, symbol, current_id); + AddOneFunction (context, NULL, non_extern_symbol, current_id); context.m_found.function = true; } } |