diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-17 20:45:01 +0000 |
| commit | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch) | |
| tree | 4adf86a776049cbf7f69a1929c4babcbbef925eb /lldb/source/Target/StackFrame.cpp | |
| parent | 7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff) | |
Notes
Diffstat (limited to 'lldb/source/Target/StackFrame.cpp')
| -rw-r--r-- | lldb/source/Target/StackFrame.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 5e5a596e471d..5c6ea7a03933 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -573,8 +573,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( if (!var_sp && (options & eExpressionPathOptionsInspectAnonymousUnions)) { // Check if any anonymous unions are there which contain a variable with // the name we need - for (size_t i = 0; i < variable_list->GetSize(); i++) { - VariableSP variable_sp = variable_list->GetVariableAtIndex(i); + for (const VariableSP &variable_sp : *variable_list) { if (!variable_sp) continue; if (!variable_sp->GetName().IsEmpty()) @@ -1529,11 +1528,9 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg, : Instruction::Operand::BuildDereference( Instruction::Operand::BuildRegister(reg)); - for (size_t vi = 0, ve = variables.GetSize(); vi != ve; ++vi) { - VariableSP var_sp = variables.GetVariableAtIndex(vi); - if (var_sp->LocationExpression().MatchesOperand(frame, op)) { + for (VariableSP var_sp : variables) { + if (var_sp->LocationExpression().MatchesOperand(frame, op)) return frame.GetValueObjectForFrameVariable(var_sp, eNoDynamicValues); - } } const uint32_t current_inst = |
