Skip to content

Commit 46e82ad

Browse files
[lldb] MultiMemRead fixes for 6.2 branch
This branch is missing some ADT / iterator / ArrayRef functionality from recent versions of LLVM.
1 parent a4f99fb commit 46e82ad

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2990,8 +2990,10 @@ MultiReadPointers(Process &process,
29902990

29912991
// Move the results in the slots not filled by errors from the input.
29922992
for (std::optional<addr_t> &maybe_result : final_results)
2993-
if (maybe_result)
2994-
maybe_result = results_ref.consume_front();
2993+
if (maybe_result) {
2994+
maybe_result = results_ref.front();
2995+
results_ref = results_ref.drop_front();
2996+
}
29952997

29962998
assert(results_ref.empty());
29972999
return final_results;

lldb/source/Plugins/OperatingSystem/SwiftTasks/OperatingSystemSwiftTasks.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9+
#include "llvm/ADT/Sequence.h"
910
#include "llvm/Support/Error.h"
1011
#include <optional>
1112
#if LLDB_ENABLE_SWIFT
@@ -210,8 +211,10 @@ FindTaskIds(llvm::ArrayRef<std::optional<addr_t>> maybe_task_addrs,
210211
// Move the results into the slots not filled by errors from the input.
211212
llvm::ArrayRef<std::optional<addr_t>> results_ref = read_results;
212213
for (std::optional<addr_t> &maybe_result : final_results)
213-
if (maybe_result)
214-
maybe_result = results_ref.consume_front();
214+
if (maybe_result) {
215+
maybe_result = results_ref.front();
216+
results_ref = results_ref.drop_front();
217+
}
215218
assert(results_ref.empty());
216219

217220
return final_results;
@@ -232,8 +235,11 @@ bool OperatingSystemSwiftTasks::UpdateThreadList(ThreadList &old_thread_list,
232235
llvm::SmallVector<std::optional<addr_t>> task_ids =
233236
FindTaskIds(task_addrs, *m_process);
234237

235-
for (const auto &[real_thread, task_addr, task_id] :
236-
llvm::zip(locked_core_threads, task_addrs, task_ids)) {
238+
for (uint64_t idx : llvm::seq<uint64_t>(task_addrs.size())) {
239+
auto real_thread =
240+
core_thread_list.GetThreadAtIndex(idx, /*can_update=*/false);
241+
auto task_addr = task_addrs[idx];
242+
auto task_id = task_ids[idx];
237243
// If this is not a thread running a Task, add it to the list as is.
238244
if (!task_id) {
239245
LLDB_LOG(log,

0 commit comments

Comments
 (0)