diff options
author | Alex Langford <alangford@apple.com> | 2023-05-04 18:19:15 -0700 |
---|---|---|
committer | Alex Langford <alangford@apple.com> | 2023-05-05 11:19:21 -0700 |
commit | e9eaf7b430ee69e8ef145884cbc8fa3ef8bd3237 (patch) | |
tree | 54729f00ee50f97d280b5a0e7b8b14b2b6c878d3 /lldb/source/API/SBThread.cpp | |
parent | 9c377c53da4771389fbd65e99e1615d99c257bdf (diff) | |
download | llvm-e9eaf7b430ee69e8ef145884cbc8fa3ef8bd3237.zip llvm-e9eaf7b430ee69e8ef145884cbc8fa3ef8bd3237.tar.gz llvm-e9eaf7b430ee69e8ef145884cbc8fa3ef8bd3237.tar.bz2 |
Re-land "[lldb] Expose a const iterator for SymbolContextList"
Re-lands 04aa943be8ed5c03092e2a90112ac638360ec253 with modifications
to fix tests.
I originally reverted this because it caused a test to fail on Linux.
The problem was that I inverted a condition on accident.
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r-- | lldb/source/API/SBThread.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index ef8a0ab..35cc45d 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -847,20 +847,14 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, SymbolContextList sc_list; frame_sc.comp_unit->ResolveSymbolContext(location_spec, eSymbolContextLineEntry, sc_list); - const uint32_t num_matches = sc_list.GetSize(); - if (num_matches > 0) { - SymbolContext sc; - for (uint32_t i = 0; i < num_matches; ++i) { - if (sc_list.GetContextAtIndex(i, sc)) { - addr_t step_addr = - sc.line_entry.range.GetBaseAddress().GetLoadAddress(target); - if (step_addr != LLDB_INVALID_ADDRESS) { - if (fun_range.ContainsLoadAddress(step_addr, target)) - step_over_until_addrs.push_back(step_addr); - else - all_in_function = false; - } - } + for (const SymbolContext &sc : sc_list) { + addr_t step_addr = + sc.line_entry.range.GetBaseAddress().GetLoadAddress(target); + if (step_addr != LLDB_INVALID_ADDRESS) { + if (fun_range.ContainsLoadAddress(step_addr, target)) + step_over_until_addrs.push_back(step_addr); + else + all_in_function = false; } } |