llvm-project/lldb/source/Expression
Greg Clayton 12ba733ce8 When we have a symbol, like "NSLog" that we try to call in an expression, make sure we prioritize the external symbols over the internal one.
This is a temporary fix until a more comprehensive fix can be made for finding functions that we call in expressions.

We find "NSLog" in ClangExpressionDeclMap::FindExternalVisibleDecls() in after a call to target->GetImages().FindFunctions(...). Note that there are two symbols: NSLog from CFNetwork which is not external, and NSLog from Foundation which _is_ external. We do something with the external symbol with:

                    if (extern_symbol)
                    {
                        AddOneFunction (context, NULL, extern_symbol, current_id);
                        context.m_found.function = true;
                    }

Then later we try to lookup the _Z5NSLogP8NSStringz name and we don't find it so we call ClangExpressionDeclMap::GetFunctionAddress() with "_Z5NSLogP8NSStringz" as the name and the sc_list_size is zero at the "if" statement at line 568 because we don't find the mangled name and we extract the basename "NSLog" and call:

            FindCodeSymbolInContext(ConstString(basename), m_parser_vars->m_sym_ctx, sc_list);
            sc_list_size = sc_list.GetSize();

and we get a list size of two again, and we proceed to search for the symbol again, this time ignoring the external vs non-external-ness of the symbols that we find. This fix ensures we prioritize the external symbol until we get a real fix from Sean Callanan when he gets back to make sure we don't do multiple lookups for the same symbol we already resolved.

<rdar://problem/19879282>

llvm-svn: 231420
2015-03-05 23:12:02 +00:00
..
ASTDumper.cpp Huge change to clean up types. 2013-07-11 22:46:58 +00:00
ASTResultSynthesizer.cpp In commit clang r226096, DefinitionRequired has been removed. Do the same in lldb implementation 2015-01-15 11:50:50 +00:00
ASTStructExtractor.cpp In commit clang r226096, DefinitionRequired has been removed. Do the same in lldb implementation 2015-01-15 11:50:50 +00:00
CMakeLists.txt Added CMake support so all the Clang modules code 2014-12-05 01:31:55 +00:00
ClangASTSource.cpp Don't #include ClangPersistentVariables.h from Process.h 2015-03-03 21:05:17 +00:00
ClangExpressionDeclMap.cpp When we have a symbol, like "NSLog" that we try to call in an expression, make sure we prioritize the external symbols over the internal one. 2015-03-05 23:12:02 +00:00
ClangExpressionParser.cpp Don't #include FormatManager.h from Debugger.h 2015-03-03 23:11:11 +00:00
ClangExpressionVariable.cpp Add the ability for an SBValue to create a persisted version of itself. 2014-12-08 23:13:56 +00:00
ClangFunction.cpp ClangFunction: Fix destruction order of parser and execution unit 2014-12-10 04:59:18 +00:00
ClangModulesDeclVendor.cpp Fixed bugs in the multi-threaded access in HostInfoBase. Prior to this fix, static bool variables were used but this is not sufficient. We now use std::call_once in all places where the previous static bool code was used to try to implement thread safety. 2015-02-03 02:05:44 +00:00
ClangPersistentVariables.cpp I have brought LLDB up-to-date with top of tree 2012-02-04 08:49:35 +00:00
ClangUserExpression.cpp Don't #include clang headers from BreakpointLocation.h 2015-03-04 17:43:00 +00:00
ClangUtilityFunction.cpp Reverse out r219169 related to quote handling. 2014-10-10 01:11:39 +00:00
DWARFExpression.cpp Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address 2015-03-05 02:42:06 +00:00
ExpressionSourceCode.cpp Update ExpressionSourceCode::GetText() to match the 2015-01-22 06:31:58 +00:00
IRDynamicChecks.cpp Revert "Update for LLVM API change in r221024" 2014-11-12 01:59:53 +00:00
IRExecutionUnit.cpp Don't #include FormatManager.h from Debugger.h 2015-03-03 23:11:11 +00:00
IRForTarget.cpp Fixed an infinite recursion bug that could happen when using python operating system plug-ins where we would ask the operating system plug-in to update its threads and this would cause the plugin to run an expression which would eventually run IRForTarget::CreateResultVariable() which would try to get the selected thread and cause re-entrant bug. 2015-02-27 00:12:22 +00:00
IRInterpreter.cpp remove trailing whitespace + remove some useless comments 2014-07-06 17:54:58 +00:00
IRMemoryMap.cpp Dont' use a random probe & alloc strategy for the IRMemoryMap. 2014-07-09 16:42:27 +00:00
Makefile remove trailing whitespace + remove some useless comments 2014-07-06 17:54:58 +00:00
Materializer.cpp Don't #include ClangPersistentVariables.h from Process.h 2015-03-03 21:05:17 +00:00