mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-10-08 11:44:05 +00:00
[lldb/Process] Populate queues in Scripted Process
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 Differential Revision: https://reviews.llvm.org/D139853 Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
This commit is contained in:
parent
6b26e1dad9
commit
44b81f621c
@ -2116,7 +2116,7 @@ public:
|
||||
|
||||
// Queue Queries
|
||||
|
||||
void UpdateQueueListIfNeeded();
|
||||
virtual void UpdateQueueListIfNeeded();
|
||||
|
||||
QueueList &GetQueueList() {
|
||||
UpdateQueueListIfNeeded();
|
||||
|
@ -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 @@ lldb_private::StructuredData::DictionarySP ScriptedProcess::GetMetadata() {
|
||||
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();
|
||||
}
|
||||
|
@ -72,6 +72,8 @@ public:
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user