mib created this revision. mib added reviewers: jingham, bulbazord. mib added a project: LLDB. Herald added a subscriber: JDevlieghere. Herald added a project: All. mib requested review of this revision. Herald added a subscriber: lldb-commits.
This patch enhances queue support in Scripted Processes. Scripted Threads could already report their queue name if they had one, but this information was only surfaced when getting the process and thread status. However, no queue was create and added to the scripted process queue list. This patch improves that by creating a queue from the scripted thread queue name. For now, it uses an invalid queue id, since the scripted thread doesn't expose this capability yet, but this could easily be supported if the queue id information is available. rdar://98844004 Signed-off-by: Med Ismail Bennani <medismail.benn...@gmail.com> Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D139853 Files: lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp Index: lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -754,6 +754,7 @@ // queues with pending or running items by default - but the magic com.apple // .main-thread queue on thread 1 is always around. + bool is_scripted_process = m_process->GetPluginName() == "ScriptedProcess"; for (ThreadSP thread_sp : m_process->Threads()) { if (thread_sp->GetAssociatedWithLibdispatchQueue() != eLazyBoolNo) { if (thread_sp->GetQueueID() != LLDB_INVALID_QUEUE_ID) { @@ -777,6 +778,13 @@ } } } + if (is_scripted_process) { + if (const char *queue_name = thread_sp->GetQueueName()) { + QueueSP queue_sp = std::make_shared<Queue>( + m_process->shared_from_this(), LLDB_INVALID_QUEUE_ID, queue_name); + queue_list.AddQueue(queue_sp); + } + } } }
Index: lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp =================================================================== --- lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -754,6 +754,7 @@ // queues with pending or running items by default - but the magic com.apple // .main-thread queue on thread 1 is always around. + bool is_scripted_process = m_process->GetPluginName() == "ScriptedProcess"; for (ThreadSP thread_sp : m_process->Threads()) { if (thread_sp->GetAssociatedWithLibdispatchQueue() != eLazyBoolNo) { if (thread_sp->GetQueueID() != LLDB_INVALID_QUEUE_ID) { @@ -777,6 +778,13 @@ } } } + if (is_scripted_process) { + if (const char *queue_name = thread_sp->GetQueueName()) { + QueueSP queue_sp = std::make_shared<Queue>( + m_process->shared_from_this(), LLDB_INVALID_QUEUE_ID, queue_name); + queue_list.AddQueue(queue_sp); + } + } } }
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits