diff options
-rw-r--r-- | lldb/include/lldb/Target/StackFrame.h | 2 | ||||
-rw-r--r-- | lldb/source/Expression/ExpressionSourceCode.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Target/StackFrame.cpp | 7 |
3 files changed, 7 insertions, 4 deletions
diff --git a/lldb/include/lldb/Target/StackFrame.h b/lldb/include/lldb/Target/StackFrame.h index f021cbac606..b44340e91be 100644 --- a/lldb/include/lldb/Target/StackFrame.h +++ b/lldb/include/lldb/Target/StackFrame.h @@ -289,7 +289,7 @@ public: /// A pointer to a list of variables. //------------------------------------------------------------------ lldb::VariableListSP - GetInScopeVariableList (bool get_file_globals); + GetInScopeVariableList (bool get_file_globals, bool must_have_valid_location = false); //------------------------------------------------------------------ /// Create a ValueObject for a variable name / pathname, possibly diff --git a/lldb/source/Expression/ExpressionSourceCode.cpp b/lldb/source/Expression/ExpressionSourceCode.cpp index d5e2cdb48ca..14e98105b8a 100644 --- a/lldb/source/Expression/ExpressionSourceCode.cpp +++ b/lldb/source/Expression/ExpressionSourceCode.cpp @@ -278,7 +278,7 @@ 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); + lldb::VariableListSP var_list_sp = frame->GetInScopeVariableList(false, true); AddLocalVariableDecls(var_list_sp, lldb_local_var_decls); } } diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 7a566092e03..d63fa132bc3 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -571,7 +571,7 @@ StackFrame::GetVariableList (bool get_file_globals) } VariableListSP -StackFrame::GetInScopeVariableList (bool get_file_globals) +StackFrame::GetInScopeVariableList (bool get_file_globals, bool must_have_valid_location) { Mutex::Locker locker(m_mutex); // We can't fetch variable information for a history stack frame. @@ -589,7 +589,10 @@ StackFrame::GetInScopeVariableList (bool get_file_globals) m_sc.block->AppendVariables (can_create, get_parent_variables, stop_if_block_is_inlined_function, - [this](Variable* v) { return v->IsInScope(this); }, + [this, must_have_valid_location](Variable* v) + { + return v->IsInScope(this) && (!must_have_valid_location || v->LocationIsValidForFrame(this)); + }, var_list_sp.get()); } |