diff options
author | Shafik Yaghmour <syaghmour@apple.com> | 2018-09-20 17:06:34 +0000 |
---|---|---|
committer | Shafik Yaghmour <syaghmour@apple.com> | 2018-09-20 17:06:34 +0000 |
commit | e23d0b636ca317347e84b3006a89eb185a130983 (patch) | |
tree | e7996dd12ef9f139aaf2b502c99462f0eaac117d /lldb/source/API/SBFrame.cpp | |
parent | 6d0e4fce1accff627f01313dda6e100b0bce09a3 (diff) | |
download | bcm5719-llvm-e23d0b636ca317347e84b3006a89eb185a130983.tar.gz bcm5719-llvm-e23d0b636ca317347e84b3006a89eb185a130983.zip |
Refactor FindVariable() core functionality into StackFrame out of SBFrame
rdar://problem/14365983
Patch by Shafik Yaghmour
Differential Revision: https://reviews.llvm.org/D52247
llvm-svn: 342663
Diffstat (limited to 'lldb/source/API/SBFrame.cpp')
-rw-r--r-- | lldb/source/API/SBFrame.cpp | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index 5762a75f33d..05e629cbafa 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -666,28 +666,10 @@ SBValue SBFrame::FindVariable(const char *name, if (stop_locker.TryLock(&process->GetRunLock())) { frame = exe_ctx.GetFramePtr(); if (frame) { - VariableList variable_list; - SymbolContext sc(frame->GetSymbolContext(eSymbolContextBlock)); - - if (sc.block) { - const bool can_create = true; - const bool get_parent_variables = true; - const bool stop_if_block_is_inlined_function = true; + value_sp = frame->FindVariable(ConstString(name)); - if (sc.block->AppendVariables( - can_create, get_parent_variables, - stop_if_block_is_inlined_function, - [frame](Variable *v) { return v->IsInScope(frame); }, - &variable_list)) { - var_sp = variable_list.FindVariable(ConstString(name)); - } - } - - if (var_sp) { - value_sp = - frame->GetValueObjectForFrameVariable(var_sp, eNoDynamicValues); + if (value_sp) sb_value.SetSP(value_sp, use_dynamic); - } } else { if (log) log->Printf("SBFrame::FindVariable () => error: could not " |