forked from OSchip/llvm-project
Fix SBFrame::FindValue for when only global variables exist.
Summary: sc.block->AppendVariables(...) returns 0 if there are no arguments or local variables, but we still need to check for global variables. Test Plan: ``` $ cat test.cpp int i; int main() { } $ lldb test -o 'b main' -o r (lldb) script >>> print lldb.frame.FindValue('i', lldb.eValueTypeVariableGlobal) (int) i = 0 # as opposed to "No value" ``` Reviewers: jingham, ovyalov, vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8464 llvm-svn: 232767
This commit is contained in:
parent
a7f8c46439
commit
0efb51a072
|
@ -876,11 +876,11 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
|
||||||
const bool get_parent_variables = true;
|
const bool get_parent_variables = true;
|
||||||
const bool stop_if_block_is_inlined_function = true;
|
const bool stop_if_block_is_inlined_function = true;
|
||||||
|
|
||||||
if (sc.block && sc.block->AppendVariables (can_create,
|
if (sc.block)
|
||||||
|
sc.block->AppendVariables(can_create,
|
||||||
get_parent_variables,
|
get_parent_variables,
|
||||||
stop_if_block_is_inlined_function,
|
stop_if_block_is_inlined_function,
|
||||||
&variable_list))
|
&variable_list);
|
||||||
{
|
|
||||||
if (value_type == eValueTypeVariableGlobal)
|
if (value_type == eValueTypeVariableGlobal)
|
||||||
{
|
{
|
||||||
const bool get_file_globals = true;
|
const bool get_file_globals = true;
|
||||||
|
@ -894,8 +894,6 @@ SBFrame::FindValue (const char *name, ValueType value_type, lldb::DynamicValueTy
|
||||||
{
|
{
|
||||||
value_sp = frame->GetValueObjectForFrameVariable(variable_sp, eNoDynamicValues);
|
value_sp = frame->GetValueObjectForFrameVariable(variable_sp, eNoDynamicValues);
|
||||||
sb_value.SetSP(value_sp, use_dynamic);
|
sb_value.SetSP(value_sp, use_dynamic);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue