================
@@ -870,6 +870,16 @@ llvm::json::Value CreateThread(lldb::SBThread &thread, 
lldb::SBFormat &format) {
   return llvm::json::Value(std::move(object));
 }
 
+llvm::json::Array GetThreads(lldb::SBProcess process, lldb::SBFormat &format) {
+  llvm::json::Array threads;
+  const uint32_t num_threads = process.GetNumThreads();
+  for (uint32_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) {
+    lldb::SBThread thread = process.GetThreadAtIndex(thread_idx);
+    threads.emplace_back(CreateThread(thread, format));
+  }
+  return threads;
----------------
clayborg wrote:

Might be nice to add a `lldb::SBThreadList` to the API and then add:
```
lldb::SBThreadList lldb::SBProcess::GetThreads();
```


https://github.com/llvm/llvm-project/pull/134339
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to