[Lldb-commits] [lldb] [lldb-dap] Migrating 'threads' request to structured types. (PR #142510)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Wed Jun 4 15:06:50 PDT 2025
================
@@ -110,4 +116,50 @@ std::string GetLoadAddressString(const lldb::addr_t addr) {
return "0x" + llvm::utohexstr(addr, false, 16);
}
+protocol::Thread CreateThread(lldb::SBThread &thread, lldb::SBFormat &format) {
+ std::string name;
+ lldb::SBStream stream;
+ if (format && thread.GetDescriptionWithFormat(format, stream).Success()) {
+ name = stream.GetData();
+ } else {
+ llvm::StringRef thread_name(thread.GetName());
+ llvm::StringRef queue_name(thread.GetQueueName());
+
+ if (!thread_name.empty()) {
+ name = thread_name.str();
+ } else if (!queue_name.empty()) {
+ auto kind = thread.GetQueue().GetKind();
+ std::string queue_kind_label = "";
+ if (kind == lldb::eQueueKindSerial) {
+ queue_kind_label = " (serial)";
+ } else if (kind == lldb::eQueueKindConcurrent) {
+ queue_kind_label = " (concurrent)";
+ }
----------------
JDevlieghere wrote:
```suggestion
if (kind == lldb::eQueueKindSerial)
queue_kind_label = " (serial)";
else if (kind == lldb::eQueueKindConcurrent)
queue_kind_label = " (concurrent)";
```
https://github.com/llvm/llvm-project/pull/142510
More information about the lldb-commits
mailing list