diff options
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r-- | lldb/source/Target/Process.cpp | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 1de322aee14..81e12a3b2f7 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1017,7 +1017,9 @@ Process::Process(Target &target, Listener &listener) : m_mod_id (), m_process_unique_id(0), m_thread_index_id (0), + m_queue_index_id (0), m_thread_id_to_index_id_map (), + m_queue_id_to_index_id_map (), m_exit_status (-1), m_exit_string (), m_thread_mutex (Mutex::eMutexTypeRecursive), @@ -1025,6 +1027,8 @@ Process::Process(Target &target, Listener &listener) : m_thread_list (this), m_extended_thread_list (this), m_extended_thread_stop_id (0), + m_queue_list (this), + m_queue_list_stop_id (0), m_notifications (), m_image_tokens (), m_listener (listener), @@ -1151,6 +1155,8 @@ Process::Finalize() m_thread_list_real.Destroy(); m_thread_list.Destroy(); m_extended_thread_list.Destroy(); + m_queue_list.Clear(); + m_queue_list_stop_id = 0; std::vector<Notifications> empty_notifications; m_notifications.swap(empty_notifications); m_image_tokens.clear(); @@ -1600,12 +1606,32 @@ Process::UpdateThreadListIfNeeded () // Clear any extended threads that we may have accumulated previously m_extended_thread_list.Clear(); m_extended_thread_stop_id = GetLastNaturalStopID (); + + m_queue_list.Clear(); + m_queue_list_stop_id = GetLastNaturalStopID (); } } } } } +void +Process::UpdateQueueListIfNeeded () +{ + if (m_system_runtime_ap.get()) + { + if (m_queue_list.GetSize() == 0 || m_queue_list_stop_id != GetLastNaturalStopID()) + { + const StateType state = GetPrivateState(); + if (StateIsStoppedState (state, true)) + { + m_system_runtime_ap->PopulateQueueList (m_queue_list); + m_queue_list_stop_id = GetLastNaturalStopID(); + } + } + } +} + ThreadSP Process::CreateOSPluginThread (lldb::tid_t tid, lldb::addr_t context) { @@ -1653,6 +1679,39 @@ Process::AssignIndexIDToThread(uint64_t thread_id) return result; } +bool +Process::HasAssignedIndexIDToQueue(queue_id_t queue_id) +{ + std::map<uint64_t, uint32_t>::iterator iterator = m_queue_id_to_index_id_map.find(queue_id); + if (iterator == m_queue_id_to_index_id_map.end()) + { + return false; + } + else + { + return true; + } +} + +uint32_t +Process::AssignIndexIDToQueue(queue_id_t queue_id) +{ + uint32_t result = 0; + std::map<uint64_t, uint32_t>::iterator iterator = m_queue_id_to_index_id_map.find(queue_id); + if (iterator == m_queue_id_to_index_id_map.end()) + { + result = ++m_queue_index_id; + m_queue_id_to_index_id_map[queue_id] = result; + } + else + { + result = iterator->second; + } + + return result; +} + + StateType Process::GetState() { @@ -5680,6 +5739,10 @@ void Process::Flush () { m_thread_list.Flush(); + m_extended_thread_list.Flush(); + m_extended_thread_stop_id = 0; + m_queue_list.Clear(); + m_queue_list_stop_id = 0; } void |