diff options
author | Sean Callanan <scallanan@apple.com> | 2014-05-23 02:30:48 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2014-05-23 02:30:48 +0000 |
commit | 25ea6a1b8e58fd956b7cc439f027b8849441842d (patch) | |
tree | 1ded8bb4d36313990f40affb2ecd8afdd47ea863 /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | ab35aa92daf1498bed8393a44ddf950d54439cab (diff) | |
download | bcm5719-llvm-25ea6a1b8e58fd956b7cc439f027b8849441842d.tar.gz bcm5719-llvm-25ea6a1b8e58fd956b7cc439f027b8849441842d.zip |
Fixed the Symbol code to resolve the callable address
of the symbol itself rather than forcing clients to do
it. This simplifies the logic for the expression
parser a great deal.
<rdar://problem/16935324>
llvm-svn: 209494
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 821dae2e515..a285a95a4dd 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -573,37 +573,27 @@ ClangExpressionDeclMap::GetFunctionAddress SymbolContext sym_ctx; sc_list.GetContextAtIndex(i, sym_ctx); - const Address *func_so_addr = NULL; bool is_indirect_function = false; + + lldb::addr_t callable_load_addr = LLDB_INVALID_ADDRESS; + if (sym_ctx.function) - func_so_addr = &sym_ctx.function->GetAddressRange().GetBaseAddress(); - else if (sym_ctx.symbol) { - if (sym_ctx.symbol->GetType() == eSymbolTypeReExported) - { - Symbol *reexported_symbol = sym_ctx.symbol->ResolveReExportedSymbol(*target); - if (reexported_symbol) - { - func_so_addr = &reexported_symbol->GetAddress(); - is_indirect_function = reexported_symbol->IsIndirect(); - } - } - else + const Address func_so_addr = sym_ctx.function->GetAddressRange().GetBaseAddress(); + if (func_so_addr.IsValid()) { - func_so_addr = &sym_ctx.symbol->GetAddress(); - is_indirect_function = sym_ctx.symbol->IsIndirect(); + callable_load_addr = func_so_addr.GetCallableLoadAddress(target, false); } } + else if (sym_ctx.symbol) + { + callable_load_addr = sym_ctx.symbol->ResolveCallableAddress(*target); + } - if (func_so_addr && func_so_addr->IsValid()) + if (callable_load_addr != LLDB_INVALID_ADDRESS) { - lldb::addr_t load_addr = func_so_addr->GetCallableLoadAddress (target, is_indirect_function); - - if (load_addr != LLDB_INVALID_ADDRESS) - { - func_addr = load_addr; - return true; - } + func_addr = callable_load_addr; + return true; } } return false; |