From bed6779c7a839ed6dab85d0198e105021b63552f Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Thu, 7 Jul 2016 18:25:48 +0000 Subject: Add an "experimental" setting to disable injecting local variables into expressions. This feature was added to solve a lookup problem in expressions when local variables shadow ivars. That solution requires fully realizing all local variables to evaluate any expression, and can cause significant performance problems when evaluating expressions in frames that have many complex locals. Until we get a better solution, this setting mitigates the problem when you don't have local variables that shadow ivars. llvm-svn: 274783 --- lldb/source/Expression/ExpressionSourceCode.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lldb/source/Expression/ExpressionSourceCode.cpp') diff --git a/lldb/source/Expression/ExpressionSourceCode.cpp b/lldb/source/Expression/ExpressionSourceCode.cpp index d82ed608407..2d41d1a8b44 100644 --- a/lldb/source/Expression/ExpressionSourceCode.cpp +++ b/lldb/source/Expression/ExpressionSourceCode.cpp @@ -200,7 +200,8 @@ bool ExpressionSourceCode::GetText (std::string &text, lldb::LanguageType wrappi const char *target_specific_defines = "typedef signed char BOOL;\n"; std::string module_macros; - if (Target *target = exe_ctx.GetTargetPtr()) + Target *target = exe_ctx.GetTargetPtr(); + if (target) { if (target->GetArchitecture().GetMachine() == llvm::Triple::aarch64) { @@ -278,8 +279,11 @@ bool ExpressionSourceCode::GetText (std::string &text, lldb::LanguageType wrappi ConstString object_name; if (Language::LanguageIsCPlusPlus(frame->GetLanguage())) { - lldb::VariableListSP var_list_sp = frame->GetInScopeVariableList(false, true); - AddLocalVariableDecls(var_list_sp, lldb_local_var_decls); + if (target->GetInjectLocalVariables(&exe_ctx)) + { + lldb::VariableListSP var_list_sp = frame->GetInScopeVariableList(false, true); + AddLocalVariableDecls(var_list_sp, lldb_local_var_decls); + } } } -- cgit v1.2.3