llvm-project/lldb/source/Expression
Greg Clayton d6171a74f0 Make sure we can lookup re-exported symbols after recent changes to lldb_private::Symbol.
Recently lldb_private::Symbol was changed so the old code:

Address &Symbol::GetAddress();

Is now:

Address Symbol::GetAddress();

And the Address object that is returned will be invalid for non-address based symbols. When we have re-exported symbols this code would now fail:

    const Address sym_address = sym_ctx.symbol->GetAddress();

    if (!sym_address.IsValid())
        continue;

    symbol_load_addr = sym_ctx.symbol->ResolveCallableAddress(*target_sp);

    if (symbol_load_addr == LLDB_INVALID_ADDRESS)
    {
        symbol_load_addr = sym_address.GetLoadAddress(target_sp.get());
    }

It used to return an Address reference to the value of the re-exported symbol that contained no section and a zero value for Address.m_offset (since the original symbol in the symbol table had a value of zero). When a reference was returned, this meant the "sym_address.IsValid()" would return true because the Address.m_offset was not LLDB_INVALID_ADDRESS, it was zero. This was working by mistake.

The Symbol::ResolveCallableAddress(...) actually checks for reexported symbols and whole bunch of other cases and resolves the address correctly, so we should let it do its thing and not cut it off before it can resolve the address with the "if (!sym_address.IsValid()) continue;".

llvm-svn: 241282
2015-07-02 16:43:49 +00:00
..
ASTDumper.cpp Revert "Introduce a TypeSystem interface to support adding non-clang languages." 2015-06-08 23:38:06 +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 Revert "Introduce a TypeSystem interface to support adding non-clang languages." 2015-06-08 23:38:06 +00:00
ClangExpressionDeclMap.cpp Resubmitting 240466 after fixing the linux test suite failures. 2015-06-25 21:46:34 +00:00
ClangExpressionParser.cpp Fix LLDB build after r241035 2015-06-30 09:26:52 +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 Updated our use of clang::Preprocessor to reflect 2015-05-01 00:19: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 Fix typo in comment. 2015-07-01 17:41:02 +00:00
ClangUtilityFunction.cpp Reverse out r219169 related to quote handling. 2014-10-10 01:11:39 +00:00
DWARFExpression.cpp Move lldb-log.cpp to core/Logging.cpp 2015-03-18 18:20:42 +00:00
ExpressionSourceCode.cpp Made macros from modules be injected before our 2015-04-30 21:49:58 +00:00
IRDynamicChecks.cpp Revert "Update for LLVM API change in r221024" 2014-11-12 01:59:53 +00:00
IRExecutionUnit.cpp Make sure we can lookup re-exported symbols after recent changes to lldb_private::Symbol. 2015-07-02 16:43:49 +00:00
IRForTarget.cpp Fix a variety of typos. 2015-06-18 05:27:05 +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 Resubmitting 240466 after fixing the linux test suite failures. 2015-06-25 21:46:34 +00:00