/// 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
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);
}
}
}
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.
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());
}