Re-land "[lldb] Expose a const iterator for SymbolContextList"

Re-lands 04aa943be8 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.
This commit is contained in:
Alex Langford
2023-05-04 18:19:15 -07:00
parent 9c377c53da
commit e9eaf7b430
20 changed files with 216 additions and 358 deletions

View File

@@ -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;
}
}