From c3a160062d5671ae7c1a3e19e09f0814ffed7352 Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Mon, 17 Jan 2011 23:42:46 +0000 Subject: 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 --- lldb/source/Expression/ClangExpressionDeclMap.cpp | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp') 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 -- cgit v1.2.3