LLDB mainline
|
#include <ThreadList.h>
Classes | |
class | ExpressionExecutionThreadPusher |
Public Member Functions | |
ThreadList (Process *process) | |
ThreadList (const ThreadList &rhs) | |
~ThreadList () override | |
const ThreadList & | operator= (const ThreadList &rhs) |
uint32_t | GetSize (bool can_update=true) |
lldb::ThreadSP | GetSelectedThread () |
lldb::ThreadSP | GetExpressionExecutionThread () |
bool | SetSelectedThreadByID (lldb::tid_t tid, bool notify=false) |
bool | SetSelectedThreadByIndexID (uint32_t index_id, bool notify=false) |
void | Clear () |
void | Flush () |
void | Destroy () |
lldb::ThreadSP | GetThreadAtIndex (uint32_t idx, bool can_update=true) |
lldb::ThreadSP | FindThreadByID (lldb::tid_t tid, bool can_update=true) |
lldb::ThreadSP | FindThreadByProtocolID (lldb::tid_t tid, bool can_update=true) |
lldb::ThreadSP | RemoveThreadByID (lldb::tid_t tid, bool can_update=true) |
lldb::ThreadSP | RemoveThreadByProtocolID (lldb::tid_t tid, bool can_update=true) |
lldb::ThreadSP | FindThreadByIndexID (uint32_t index_id, bool can_update=true) |
lldb::ThreadSP | GetThreadSPForThreadPtr (Thread *thread_ptr) |
lldb::ThreadSP | GetBackingThread (const lldb::ThreadSP &real_thread) |
bool | ShouldStop (Event *event_ptr) |
Vote | ShouldReportStop (Event *event_ptr) |
Vote | ShouldReportRun (Event *event_ptr) |
void | RefreshStateAfterStop () |
bool | WillResume () |
The thread list asks tells all the threads it is about to resume. | |
void | DidResume () |
void | DidStop () |
void | DiscardThreadPlans () |
uint32_t | GetStopID () const |
void | SetStopID (uint32_t stop_id) |
std::recursive_mutex & | GetMutex () const override |
void | Update (ThreadList &rhs) |
![]() | |
ThreadCollection () | |
ThreadCollection (collection threads) | |
virtual | ~ThreadCollection ()=default |
uint32_t | GetSize () |
void | AddThread (const lldb::ThreadSP &thread_sp) |
void | AddThreadSortedByIndexID (const lldb::ThreadSP &thread_sp) |
void | InsertThread (const lldb::ThreadSP &thread_sp, uint32_t idx) |
lldb::ThreadSP | GetThreadAtIndex (uint32_t idx) |
virtual ThreadIterable | Threads () |
virtual std::recursive_mutex & | GetMutex () const |
Protected Member Functions | |
void | PushExpressionExecutionThread (lldb::tid_t tid) |
void | PopExpressionExecutionThread (lldb::tid_t tid) |
void | SetShouldReportStop (Vote vote) |
void | NotifySelectedThreadChanged (lldb::tid_t tid) |
Protected Attributes | |
Process * | m_process |
The process that manages this thread list. | |
uint32_t | m_stop_id |
The process stop ID that this thread list is valid for. | |
lldb::tid_t | m_selected_tid |
For targets that need the notion of a current thread. | |
std::vector< lldb::tid_t > | m_expression_tid_stack |
![]() | |
collection | m_threads |
std::recursive_mutex | m_mutex |
Private Member Functions | |
ThreadList ()=delete | |
Friends | |
class | Process |
Additional Inherited Members | |
![]() | |
typedef std::vector< lldb::ThreadSP > | collection |
typedef LockingAdaptedIterable< collection, lldb::ThreadSP, vector_adapter, std::recursive_mutex > | ThreadIterable |
Definition at line 26 of file ThreadList.h.
ThreadList::ThreadList | ( | Process * | process | ) |
Definition at line 26 of file ThreadList.cpp.
ThreadList::ThreadList | ( | const ThreadList & | rhs | ) |
Definition at line 30 of file ThreadList.cpp.
|
override |
Definition at line 54 of file ThreadList.cpp.
References Clear().
|
privatedelete |
void ThreadList::Clear | ( | ) |
Definition at line 471 of file ThreadList.cpp.
References GetMutex(), LLDB_INVALID_THREAD_ID, m_selected_tid, m_stop_id, and lldb_private::ThreadCollection::m_threads.
Referenced by lldb_private::ProcessTrace::Clear(), ProcessElfCore::Clear(), lldb_private::process_gdb_remote::ProcessGDBRemote::Clear(), ProcessMachCore::Clear(), ProcessKDP::Clear(), lldb_private::minidump::ProcessMinidump::Clear(), lldb_private::ScriptedProcess::Clear(), lldb_private::Process::CompleteAttach(), lldb_private::Process::LoadOperatingSystemPlugin(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetLastStopPacket(), lldb_private::Process::UpdateThreadListIfNeeded(), lldb_private::Process::~Process(), and ~ThreadList().
void ThreadList::Destroy | ( | ) |
Definition at line 478 of file ThreadList.cpp.
References GetMutex(), and lldb_private::ThreadCollection::m_threads.
Referenced by lldb_private::Process::Finalize().
void ThreadList::DidResume | ( | ) |
Definition at line 655 of file ThreadList.cpp.
References lldb::eStateSuspended, GetMutex(), and lldb_private::ThreadCollection::m_threads.
Referenced by lldb_private::Process::PrivateResume().
void ThreadList::DidStop | ( | ) |
Definition at line 667 of file ThreadList.cpp.
References GetMutex(), lldb_private::ThreadCollection::m_threads, and lldb_private::StateIsRunningState().
Referenced by lldb_private::Process::SetPrivateState().
void ThreadList::DiscardThreadPlans | ( | ) |
Definition at line 502 of file ThreadList.cpp.
References GetMutex(), and lldb_private::ThreadCollection::m_threads.
Referenced by lldb_private::Process::DestroyImpl(), lldb_private::Process::Detach(), lldb_private::Process::DidExec(), and lldb_private::Process::RunPrivateStateThread().
ThreadSP ThreadList::FindThreadByID | ( | lldb::tid_t | tid, |
bool | can_update = true |
||
) |
Definition at line 103 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::CommandObjectIterateOverThreads::BucketThread(), lldb_private::trace_intel_pt::TraceIntelPT::DoRefreshLiveProcessState(), lldb_private::ThreadPlanStackMap::DumpPlans(), lldb_private::ThreadPlanStackMap::DumpPlansForTID(), GetExpressionExecutionThread(), GetSelectedThread(), lldb_private::ThreadPlan::GetThread(), lldb_private::ThreadPlanTracer::GetThread(), CommandObjectThreadBacktrace::HandleOneThread(), CommandObjectThreadInfo::HandleOneThread(), CommandObjectThreadException::HandleOneThread(), CommandObjectThreadSiginfo::HandleOneThread(), CommandObjectTraceDumpInfo::HandleOneThread(), NotifySelectedThreadChanged(), lldb_private::ThreadPlanStackMap::PrunePlansForTID(), SetSelectedThreadByID(), and lldb_private::ThreadPlanStackMap::Update().
ThreadSP ThreadList::FindThreadByIndexID | ( | uint32_t | index_id, |
bool | can_update = true |
||
) |
Definition at line 209 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), CommandObjectThreadSelect::DoExecute(), lldb_private::CommandObjectIterateOverThreads::DoExecute(), lldb_private::CommandObjectMultipleThreads::DoExecute(), lldb_private::ctf::CommandObjectThreadTraceExportCTF::DoExecute(), GetSingleThreadFromArgs(), lldb_private::Process::RunThreadPlan(), and SetSelectedThreadByIndexID().
ThreadSP ThreadList::FindThreadByProtocolID | ( | lldb::tid_t | tid, |
bool | can_update = true |
||
) |
Definition at line 121 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by ProcessKDP::DoResume(), ProcessKDP::DoUpdateThreadList(), and lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo().
void ThreadList::Flush | ( | ) |
Definition at line 777 of file ThreadList.cpp.
References GetMutex(), and lldb_private::ThreadCollection::m_threads.
Referenced by lldb_private::Process::Flush().
ThreadSP ThreadList::GetBackingThread | ( | const lldb::ThreadSP & | real_thread | ) |
Definition at line 195 of file ThreadList.cpp.
References GetBackingThread(), GetMutex(), and lldb_private::ThreadCollection::m_threads.
Referenced by GetBackingThread(), and lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo().
lldb::ThreadSP ThreadList::GetExpressionExecutionThread | ( | ) |
Definition at line 60 of file ThreadList.cpp.
References FindThreadByID(), GetSelectedThread(), and m_expression_tid_stack.
Referenced by lldb_private::Process::CallVoidArgVoidPtrReturn(), SystemRuntimeMacOSX::CompleteQueueItem(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), PlatformPOSIX::EvaluateLibdlExpression(), lldb_private::PlatformWindows::EvaluateLoaderExpression(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), SystemRuntimeMacOSX::GetPendingItemRefsForQueue(), lldb_private::InferiorCallMmap(), lldb_private::InferiorCallMunmap(), SystemRuntimeMacOSX::PopulateQueueList(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap(), and lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap().
|
overridevirtual |
Reimplemented from lldb_private::ThreadCollection.
Definition at line 784 of file ThreadList.cpp.
References m_process, and lldb_private::Process::m_thread_mutex.
Referenced by Clear(), lldb_private::process_gdb_remote::ProcessGDBRemote::ClearThreadIDList(), Destroy(), DidResume(), DidStop(), DiscardThreadPlans(), CommandObjectThreadPlanPrune::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectThreadContinue::DoExecute(), lldb_private::CommandObjectIterateOverThreads::DoExecute(), lldb_private::CommandObjectMultipleThreads::DoExecute(), FindThreadByID(), FindThreadByIndexID(), FindThreadByProtocolID(), Flush(), GetBackingThread(), GetSelectedThread(), GetSize(), GetThreadAtIndex(), GetThreadSPForThreadPtr(), lldb_private::Process::HandleProcessStateChangedEvent(), operator=(), RefreshStateAfterStop(), lldb_private::process_gdb_remote::ProcessGDBRemote::RefreshStateAfterStop(), RemoveThreadByID(), RemoveThreadByProtocolID(), lldb_private::Process::SetPrivateState(), SetSelectedThreadByID(), SetSelectedThreadByIndexID(), SetShouldReportStop(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo(), ShouldReportRun(), ShouldReportStop(), ShouldStop(), Update(), lldb_private::process_gdb_remote::ProcessGDBRemote::UpdateThreadIDList(), lldb_private::Process::UpdateThreadListIfNeeded(), and WillResume().
ThreadSP ThreadList::GetSelectedThread | ( | ) |
Definition at line 684 of file ThreadList.cpp.
References FindThreadByID(), GetMutex(), m_selected_tid, and lldb_private::ThreadCollection::m_threads.
Referenced by CommandObjectTargetModulesLoad::DoExecute(), lldb_private::CommandObject::GetDefaultThread(), GetExpressionExecutionThread(), lldb_private::AppleObjCRuntime::GetObjectDescription(), lldb_private::Thread::GetStatus(), lldb_private::Process::HandleProcessStateChangedEvent(), lldb_private::minidump::ProcessMinidump::RefreshStateAfterStop(), lldb_private::ProcessWindows::RefreshStateAfterStop(), lldb_private::Process::RunThreadPlan(), DynamicLoaderDarwinKernel::SearchForKernelNearPC(), and WillResume().
uint32_t ThreadList::GetSize | ( | bool | can_update = true | ) |
Definition at line 83 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by MinidumpFileBuilder::AddExceptions(), MinidumpFileBuilder::AddThreadList(), CreateAllImageInfosPayload(), lldb_private::ProcessWindows::DisableWatchpoint(), CommandObjectProcessContinue::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), lldb_private::ctf::CommandObjectThreadTraceExportCTF::DoExecute(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoResume(), lldb_private::ProcessWindows::DoResume(), ProcessElfCore::DoUpdateThreadList(), ProcessFreeBSDKernel::DoUpdateThreadList(), ProcessMachCore::DoUpdateThreadList(), ProcessKDP::DoUpdateThreadList(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(), lldb_private::minidump::ProcessMinidump::DoUpdateThreadList(), lldb_private::ScriptedProcess::DoUpdateThreadList(), lldb_private::ProcessWindows::EnableWatchpoint(), lldb_private::Process::GetThreadStatus(), lldb_private::Process::HandleProcessStateChangedEvent(), DynamicLoaderMacOS::ProcessDidExec(), DynamicLoaderMacOSXDYLD::ProcessDidExec(), lldb_private::Target::RunStopHooks(), lldb_private::Process::RunThreadPlan(), ObjectFileMachO::SaveCore(), lldb_private::Process::ProcessEventData::ShouldStop(), lldb_private::Process::UpdateThreadListIfNeeded(), and WillResume().
uint32_t ThreadList::GetStopID | ( | ) | const |
Definition at line 79 of file ThreadList.cpp.
References m_stop_id.
Referenced by lldb_private::Process::UpdateThreadListIfNeeded().
ThreadSP ThreadList::GetThreadAtIndex | ( | uint32_t | idx, |
bool | can_update = true |
||
) |
Definition at line 91 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by MinidumpFileBuilder::AddExceptions(), MinidumpFileBuilder::AddThreadList(), CreateAllImageInfosPayload(), lldb_private::ProcessWindows::DisableWatchpoint(), CommandObjectProcessContinue::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectThreadContinue::DoExecute(), lldb_private::ProcessWindows::DoResume(), ProcessFreeBSDKernel::DoUpdateThreadList(), ProcessMachCore::DoUpdateThreadList(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList(), lldb_private::ProcessWindows::EnableWatchpoint(), lldb_private::Process::GetThreadStatus(), lldb_private::Process::HandleProcessStateChangedEvent(), DynamicLoaderMacOS::ProcessDidExec(), DynamicLoaderMacOSXDYLD::ProcessDidExec(), lldb_private::Target::RunStopHooks(), lldb_private::Process::RunThreadPlan(), ObjectFileMachO::SaveCore(), lldb_private::Process::ProcessEventData::ShouldStop(), lldb_private::CommandCompletions::ThreadIndexes(), lldb_private::Process::UpdateThreadListIfNeeded(), and WillResume().
Definition at line 178 of file ThreadList.cpp.
References GetMutex(), and lldb_private::ThreadCollection::m_threads.
|
protected |
Definition at line 726 of file ThreadList.cpp.
References lldb_private::Thread::eBroadcastBitThreadSelected, and FindThreadByID().
Referenced by SetSelectedThreadByID(), and SetSelectedThreadByIndexID().
const ThreadList & ThreadList::operator= | ( | const ThreadList & | rhs | ) |
Definition at line 37 of file ThreadList.cpp.
References GetMutex(), m_process, m_selected_tid, m_stop_id, and lldb_private::ThreadCollection::m_threads.
|
protected |
Definition at line 74 of file ThreadList.cpp.
References m_expression_tid_stack.
Referenced by lldb_private::ThreadList::ExpressionExecutionThreadPusher::~ExpressionExecutionThreadPusher().
|
protected |
Definition at line 70 of file ThreadList.cpp.
References m_expression_tid_stack.
Referenced by lldb_private::ThreadList::ExpressionExecutionThreadPusher::ExpressionExecutionThreadPusher().
void ThreadList::RefreshStateAfterStop | ( | ) |
Definition at line 486 of file ThreadList.cpp.
References lldb_private::GetLog(), GetMutex(), lldb_private::Log::GetVerbose(), LLDB_LOGF, m_process, lldb_private::ThreadCollection::m_threads, lldb_private::Step, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::RefreshStateAfterStop(), ProcessMachCore::RefreshStateAfterStop(), ProcessKDP::RefreshStateAfterStop(), lldb_private::ScriptedProcess::RefreshStateAfterStop(), and lldb_private::ProcessWindows::RefreshStateAfterStop().
ThreadSP ThreadList::RemoveThreadByID | ( | lldb::tid_t | tid, |
bool | can_update = true |
||
) |
Definition at line 139 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
ThreadSP ThreadList::RemoveThreadByProtocolID | ( | lldb::tid_t | tid, |
bool | can_update = true |
||
) |
Definition at line 158 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::process_gdb_remote::ProcessGDBRemote::DoUpdateThreadList().
bool ThreadList::SetSelectedThreadByID | ( | lldb::tid_t | tid, |
bool | notify = false |
||
) |
Definition at line 696 of file ThreadList.cpp.
References FindThreadByID(), GetMutex(), LLDB_INVALID_THREAD_ID, m_selected_tid, and NotifySelectedThreadChanged().
Referenced by CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadUntil::DoExecute(), CommandObjectThreadSelect::DoExecute(), lldb_private::Process::HandleProcessStateChangedEvent(), lldb_private::process_gdb_remote::ProcessGDBRemote::RefreshStateAfterStop(), lldb_private::minidump::ProcessMinidump::RefreshStateAfterStop(), lldb_private::ProcessWindows::RefreshStateAfterStop(), lldb::SBThread::ResumeNewPlan(), lldb_private::Thread::StepIn(), lldb_private::Thread::StepOut(), and lldb_private::Thread::StepOver().
bool ThreadList::SetSelectedThreadByIndexID | ( | uint32_t | index_id, |
bool | notify = false |
||
) |
Definition at line 711 of file ThreadList.cpp.
References FindThreadByIndexID(), GetMutex(), LLDB_INVALID_THREAD_ID, m_selected_tid, and NotifySelectedThreadChanged().
|
protected |
Definition at line 425 of file ThreadList.cpp.
References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::Process::AttachCompletionHandler::PerformAction().
void ThreadList::SetStopID | ( | uint32_t | stop_id | ) |
Definition at line 81 of file ThreadList.cpp.
References m_stop_id.
Referenced by lldb_private::Process::UpdateThreadListIfNeeded(), and WillResume().
Definition at line 436 of file ThreadList.cpp.
References lldb::eStateSuspended, lldb_private::eVoteNo, lldb_private::eVoteNoOpinion, lldb_private::eVoteYes, lldb_private::GetLog(), GetMutex(), LLDB_LOGF, m_process, lldb_private::ThreadCollection::m_threads, lldb_private::Step, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::Process::ShouldBroadcastEvent().
Definition at line 376 of file ThreadList.cpp.
References lldb_private::eVoteNo, lldb_private::eVoteNoOpinion, lldb_private::eVoteYes, lldb_private::GetLog(), GetMutex(), LLDB_LOG, LLDB_LOGF, m_process, lldb_private::ThreadCollection::m_threads, lldb_private::Step, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::Process::ShouldBroadcastEvent().
bool ThreadList::ShouldStop | ( | Event * | event_ptr | ) |
Definition at line 226 of file ThreadList.cpp.
References lldb::eStateSuspended, lldb_private::Process::ProcessEventData::GetInterruptedFromEvent(), lldb_private::GetLog(), GetMutex(), LLDB_LOG, LLDB_LOGF, m_process, lldb_private::ThreadCollection::m_threads, lldb_private::Log::PutCString(), lldb_private::Step, and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::Process::ShouldBroadcastEvent().
void ThreadList::Update | ( | ThreadList & | rhs | ) |
Definition at line 735 of file ThreadList.cpp.
References GetMutex(), m_process, m_selected_tid, m_stop_id, and lldb_private::ThreadCollection::m_threads.
Referenced by lldb_private::Process::UpdateThreadListIfNeeded().
bool ThreadList::WillResume | ( | ) |
The thread list asks tells all the threads it is about to resume.
If a thread can "resume" without having to resume the target, it will return false for WillResume, and then the process will not be restarted.
Definition at line 512 of file ThreadList.cpp.
References lldb_private::ThreadCollection::AddThread(), lldb::eStateSuspended, lldb_private::GetLog(), GetMutex(), GetSelectedThread(), GetSize(), lldb_private::Process::GetStopID(), GetThreadAtIndex(), lldb_private::Log::GetVerbose(), LLDB_LOGF, lldbassert, m_process, lldb_private::ThreadCollection::m_threads, SetStopID(), lldb_private::Process::StartNoticingNewThreads(), lldb_private::Step, lldb_private::Process::StopNoticingNewThreads(), and lldb_private::Process::UpdateThreadListIfNeeded().
Referenced by lldb_private::Process::PrivateResume().
|
friend |
Definition at line 27 of file ThreadList.h.
|
protected |
Definition at line 151 of file ThreadList.h.
Referenced by GetExpressionExecutionThread(), PopExpressionExecutionThread(), and PushExpressionExecutionThread().
|
protected |
The process that manages this thread list.
Definition at line 146 of file ThreadList.h.
Referenced by FindThreadByID(), FindThreadByIndexID(), FindThreadByProtocolID(), GetMutex(), GetSize(), GetThreadAtIndex(), operator=(), RefreshStateAfterStop(), RemoveThreadByID(), RemoveThreadByProtocolID(), SetShouldReportStop(), ShouldReportRun(), ShouldReportStop(), ShouldStop(), Update(), and WillResume().
|
protected |
For targets that need the notion of a current thread.
Definition at line 150 of file ThreadList.h.
Referenced by Clear(), GetSelectedThread(), operator=(), SetSelectedThreadByID(), SetSelectedThreadByIndexID(), and Update().
|
protected |
The process stop ID that this thread list is valid for.
Definition at line 148 of file ThreadList.h.
Referenced by Clear(), GetStopID(), operator=(), SetStopID(), and Update().