diff options
Diffstat (limited to 'lldb/source/Expression/ExpressionSourceCode.cpp')
-rw-r--r-- | lldb/source/Expression/ExpressionSourceCode.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lldb/source/Expression/ExpressionSourceCode.cpp b/lldb/source/Expression/ExpressionSourceCode.cpp index d19321a429e..a146472c26c 100644 --- a/lldb/source/Expression/ExpressionSourceCode.cpp +++ b/lldb/source/Expression/ExpressionSourceCode.cpp @@ -178,7 +178,8 @@ static void AddLocalVariableDecls(const lldb::VariableListSP &var_list_sp, bool ExpressionSourceCode::GetText(std::string &text, lldb::LanguageType wrapping_language, bool static_method, - ExecutionContext &exe_ctx) const { + ExecutionContext &exe_ctx, + bool add_locals) const { const char *target_specific_defines = "typedef signed char BOOL;\n"; std::string module_macros; @@ -251,12 +252,13 @@ bool ExpressionSourceCode::GetText(std::string &text, } } - ConstString object_name; - if (Language::LanguageIsCPlusPlus(frame->GetLanguage())) { - if (target->GetInjectLocalVariables(&exe_ctx)) { - lldb::VariableListSP var_list_sp = - frame->GetInScopeVariableList(false, true); - AddLocalVariableDecls(var_list_sp, lldb_local_var_decls); + if (add_locals) { + if (Language::LanguageIsCPlusPlus(frame->GetLanguage())) { + if (target->GetInjectLocalVariables(&exe_ctx)) { + lldb::VariableListSP var_list_sp = + frame->GetInScopeVariableList(false, true); + AddLocalVariableDecls(var_list_sp, lldb_local_var_decls); + } } } } |