[Lldb-commits] [PATCH] D139853: [lldb/Process] Populate queues in Scripted Process

Med Ismail Bennani via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 13 07:51:06 PST 2022


mib updated this revision to Diff 482486.
mib marked an inline comment as done.
mib added a comment.

Make use of the process plugin model to avoid adding a special case on the system runtime plugin.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139853/new/

https://reviews.llvm.org/D139853

Files:
  lldb/include/lldb/Target/Process.h
  lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
  lldb/source/Plugins/Process/scripted/ScriptedProcess.h


Index: lldb/source/Plugins/Process/scripted/ScriptedProcess.h
===================================================================
--- lldb/source/Plugins/Process/scripted/ScriptedProcess.h
+++ lldb/source/Plugins/Process/scripted/ScriptedProcess.h
@@ -72,6 +72,8 @@
 
   lldb_private::StructuredData::DictionarySP GetMetadata() override;
 
+  void UpdateQueueListIfNeeded() override;
+
 protected:
   ScriptedProcess(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
                   const ScriptedMetadata &scripted_metadata, Status &error);
Index: lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
===================================================================
--- lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
+++ lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
@@ -497,6 +497,17 @@
   return metadata_sp;
 }
 
+void ScriptedProcess::UpdateQueueListIfNeeded() {
+  CheckInterpreterAndScriptObject();
+  for (ThreadSP thread_sp : Threads()) {
+    if (const char *queue_name = thread_sp->GetQueueName()) {
+      QueueSP queue_sp = std::make_shared<Queue>(
+          shared_from_this(), LLDB_INVALID_QUEUE_ID, queue_name);
+      m_queue_list.AddQueue(queue_sp);
+    }
+  }
+}
+
 ScriptedProcessInterface &ScriptedProcess::GetInterface() const {
   return m_interpreter->GetScriptedProcessInterface();
 }
Index: lldb/include/lldb/Target/Process.h
===================================================================
--- lldb/include/lldb/Target/Process.h
+++ lldb/include/lldb/Target/Process.h
@@ -2107,7 +2107,7 @@
 
   // Queue Queries
 
-  void UpdateQueueListIfNeeded();
+  virtual void UpdateQueueListIfNeeded();
 
   QueueList &GetQueueList() {
     UpdateQueueListIfNeeded();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139853.482486.patch
Type: text/x-patch
Size: 1726 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221213/f5f766e9/attachment-0001.bin>


More information about the lldb-commits mailing list