summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangExpressionDeclMap.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-01-17 23:42:46 +0000
committerSean Callanan <scallanan@apple.com>2011-01-17 23:42:46 +0000
commitc3a160062d5671ae7c1a3e19e09f0814ffed7352 (patch)
tree2beb7a04e297269b7167bb7644e381e5078fa65b /lldb/source/Expression/ClangExpressionDeclMap.cpp
parent5caed4e8a878a07b25d13ed355e7d049bbbe4ec4 (diff)
downloadbcm5719-llvm-c3a160062d5671ae7c1a3e19e09f0814ffed7352.tar.gz
bcm5719-llvm-c3a160062d5671ae7c1a3e19e09f0814ffed7352.zip
Added support for the fragile ivars provided by
Apple's Objective-C 2.0 runtime. They are enabled if the Objective-C runtime has the proper version. llvm-svn: 123694
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index 08468faf1fd..f9962421c15 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -452,6 +452,36 @@ ClangExpressionDeclMap::GetFunctionAddress
return true;
}
+bool
+ClangExpressionDeclMap::GetSymbolAddress
+(
+ const ConstString &name,
+ uint64_t &ptr
+)
+{
+ assert (m_parser_vars.get());
+
+ // Back out in all cases where we're not fully initialized
+ if (m_parser_vars->m_exe_ctx->target == NULL)
+ return false;
+
+ SymbolContextList sc_list;
+
+ m_parser_vars->m_exe_ctx->target->GetImages().FindSymbolsWithNameAndType(name, lldb::eSymbolTypeAny, sc_list);
+
+ if (!sc_list.GetSize())
+ return false;
+
+ SymbolContext sym_ctx;
+ sc_list.GetContextAtIndex(0, sym_ctx);
+
+ const Address *sym_address = &sym_ctx.symbol->GetAddressRangeRef().GetBaseAddress();
+
+ ptr = sym_address->GetLoadAddress (m_parser_vars->m_exe_ctx->target);
+
+ return true;
+}
+
// Interface for CommandObjectExpression
bool
OpenPOWER on IntegriCloud