Restore the ability of SBFrame::FindValue() to look for file global variables

This should clean up the new test failures caused by r201614

llvm-svn: 201710
This commit is contained in:
Enrico Granata
2014-02-19 19:35:13 +00:00
parent e3f902c32a
commit 8a2a0dfba5
3 changed files with 24 additions and 3 deletions

View File

@@ -845,6 +845,8 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
frame = exe_ctx.GetFramePtr();
if (frame)
{
VariableList variable_list;
switch (value_type)
{
case eValueTypeVariableGlobal: // global variable
@@ -852,8 +854,7 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
case eValueTypeVariableArgument: // function argument variables
case eValueTypeVariableLocal: // function local variables
{
VariableList variable_list;
SymbolContext sc (frame->GetSymbolContext (eSymbolContextBlock));
const bool can_create = true;
@@ -865,6 +866,13 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
stop_if_block_is_inlined_function,
&variable_list))
{
if (value_type == eValueTypeVariableGlobal)
{
const bool get_file_globals = true;
VariableList* frame_vars = frame->GetVariableList(get_file_globals);
if (frame_vars)
frame_vars->AppendVariablesIfUnique(variable_list);
}
ConstString const_name(name);
VariableSP variable_sp(variable_list.FindVariable(const_name,value_type));
if (variable_sp)