[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 08:15:16 PST 2022


mib updated this revision to Diff 482495.

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
@@ -20,6 +20,7 @@
 #include "lldb/Interpreter/ScriptInterpreter.h"
 #include "lldb/Interpreter/ScriptedMetadata.h"
 #include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Target/Queue.h"
 #include "lldb/Target/RegisterContext.h"
 #include "lldb/Utility/LLDBLog.h"
 #include "lldb/Utility/State.h"
@@ -497,6 +498,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>(
+          m_process->shared_from_this(), thread_sp->GetQueueID(), 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.482495.patch
Type: text/x-patch
Size: 2039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221213/894295e5/attachment.bin>


More information about the lldb-commits mailing list