LLDB mainline
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
lldb_private::ThreadList Class Reference

#include <ThreadList.h>

Inheritance diagram for lldb_private::ThreadList:
Inheritance graph
[legend]

Classes

class  ExpressionExecutionThreadPusher
 

Public Member Functions

 ThreadList (Process &process)
 
 ThreadList (const ThreadList &rhs)
 
 ~ThreadList () override
 
const ThreadListoperator= (const ThreadList &rhs)
 Precondition: both thread lists must be belong to the same process.
 
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)
 Precondition: both thread lists must be belong to the same process.
 
- Public Member Functions inherited from lldb_private::ThreadCollection
 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

Processm_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_tm_expression_tid_stack
 
- Protected Attributes inherited from lldb_private::ThreadCollection
collection m_threads
 
std::recursive_mutex m_mutex
 

Private Member Functions

 ThreadList ()=delete
 

Friends

class Process
 

Additional Inherited Members

- Public Types inherited from lldb_private::ThreadCollection
typedef std::vector< lldb::ThreadSPcollection
 
typedef LockingAdaptedIterable< collection, lldb::ThreadSP, vector_adapter, std::recursive_mutex > ThreadIterable
 

Detailed Description

Definition at line 26 of file ThreadList.h.

Constructor & Destructor Documentation

◆ ThreadList() [1/3]

ThreadList::ThreadList ( Process process)

Definition at line 26 of file ThreadList.cpp.

◆ ThreadList() [2/3]

ThreadList::ThreadList ( const ThreadList rhs)

Definition at line 30 of file ThreadList.cpp.

◆ ~ThreadList()

ThreadList::~ThreadList ( )
override

Definition at line 53 of file ThreadList.cpp.

References Clear().

◆ ThreadList() [3/3]

lldb_private::ThreadList::ThreadList ( )
privatedelete

Member Function Documentation

◆ Clear()

void ThreadList::Clear ( )

◆ Destroy()

void ThreadList::Destroy ( )

◆ DidResume()

void ThreadList::DidResume ( )

◆ DidStop()

void ThreadList::DidStop ( )

◆ DiscardThreadPlans()

void ThreadList::DiscardThreadPlans ( )

◆ FindThreadByID()

ThreadSP ThreadList::FindThreadByID ( lldb::tid_t  tid,
bool  can_update = true 
)

◆ FindThreadByIndexID()

ThreadSP ThreadList::FindThreadByIndexID ( uint32_t  index_id,
bool  can_update = true 
)

◆ FindThreadByProtocolID()

ThreadSP ThreadList::FindThreadByProtocolID ( lldb::tid_t  tid,
bool  can_update = true 
)

◆ Flush()

void ThreadList::Flush ( )

Definition at line 780 of file ThreadList.cpp.

References GetMutex(), and lldb_private::ThreadCollection::m_threads.

Referenced by lldb_private::Process::Flush().

◆ GetBackingThread()

ThreadSP ThreadList::GetBackingThread ( const lldb::ThreadSP real_thread)

◆ GetExpressionExecutionThread()

lldb::ThreadSP ThreadList::GetExpressionExecutionThread ( )

◆ GetMutex()

std::recursive_mutex & ThreadList::GetMutex ( ) const
overridevirtual

◆ GetSelectedThread()

ThreadSP ThreadList::GetSelectedThread ( )

◆ GetSize()

uint32_t ThreadList::GetSize ( bool  can_update = true)

Definition at line 82 of file ThreadList.cpp.

References GetMutex(), m_process, lldb_private::ThreadCollection::m_threads, and lldb_private::Process::UpdateThreadListIfNeeded().

Referenced by DynamicLoaderPOSIXDYLD::CalculateDynamicSaveCoreRanges(), lldb_private::ProcessWindows::DisableWatchpoint(), lldb_private::ProcessWindows::DoDetach(), lldb_private::ctf::CommandObjectThreadTraceExportCTF::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::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().

◆ GetStopID()

uint32_t ThreadList::GetStopID ( ) const

Definition at line 78 of file ThreadList.cpp.

References m_stop_id.

Referenced by lldb_private::Process::UpdateThreadListIfNeeded().

◆ GetThreadAtIndex()

ThreadSP ThreadList::GetThreadAtIndex ( uint32_t  idx,
bool  can_update = true 
)

◆ GetThreadSPForThreadPtr()

ThreadSP ThreadList::GetThreadSPForThreadPtr ( Thread thread_ptr)

Definition at line 177 of file ThreadList.cpp.

References GetMutex(), and lldb_private::ThreadCollection::m_threads.

◆ NotifySelectedThreadChanged()

void ThreadList::NotifySelectedThreadChanged ( lldb::tid_t  tid)
protected

◆ operator=()

const ThreadList & ThreadList::operator= ( const ThreadList rhs)

Precondition: both thread lists must be belong to the same process.

Definition at line 37 of file ThreadList.cpp.

References GetMutex(), m_process, m_selected_tid, m_stop_id, and lldb_private::ThreadCollection::m_threads.

◆ PopExpressionExecutionThread()

void ThreadList::PopExpressionExecutionThread ( lldb::tid_t  tid)
protected

◆ PushExpressionExecutionThread()

void ThreadList::PushExpressionExecutionThread ( lldb::tid_t  tid)
protected

◆ RefreshStateAfterStop()

void ThreadList::RefreshStateAfterStop ( )

◆ RemoveThreadByID()

ThreadSP ThreadList::RemoveThreadByID ( lldb::tid_t  tid,
bool  can_update = true 
)

◆ RemoveThreadByProtocolID()

ThreadSP ThreadList::RemoveThreadByProtocolID ( lldb::tid_t  tid,
bool  can_update = true 
)

◆ SetSelectedThreadByID()

bool ThreadList::SetSelectedThreadByID ( lldb::tid_t  tid,
bool  notify = false 
)

◆ SetSelectedThreadByIndexID()

bool ThreadList::SetSelectedThreadByIndexID ( uint32_t  index_id,
bool  notify = false 
)

◆ SetShouldReportStop()

void ThreadList::SetShouldReportStop ( Vote  vote)
protected

◆ SetStopID()

void ThreadList::SetStopID ( uint32_t  stop_id)

Definition at line 80 of file ThreadList.cpp.

References m_stop_id.

Referenced by lldb_private::Process::UpdateThreadListIfNeeded(), and WillResume().

◆ ShouldReportRun()

Vote ThreadList::ShouldReportRun ( Event event_ptr)

◆ ShouldReportStop()

Vote ThreadList::ShouldReportStop ( Event event_ptr)

◆ ShouldStop()

bool ThreadList::ShouldStop ( Event event_ptr)

◆ Update()

void ThreadList::Update ( ThreadList rhs)

Precondition: both thread lists must be belong to the same process.

Definition at line 736 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().

◆ WillResume()

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.

Returns
true instructs the process to resume normally, false means start & stopped events will be generated, but the process will not actually run. The thread must then return the correct StopInfo when asked.

Definition at line 511 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().

Friends And Related Function Documentation

◆ Process

friend class Process
friend

Definition at line 27 of file ThreadList.h.

Member Data Documentation

◆ m_expression_tid_stack

std::vector<lldb::tid_t> lldb_private::ThreadList::m_expression_tid_stack
protected

◆ m_process

Process& lldb_private::ThreadList::m_process
protected

◆ m_selected_tid

lldb::tid_t lldb_private::ThreadList::m_selected_tid
protected

For targets that need the notion of a current thread.

Definition at line 152 of file ThreadList.h.

Referenced by Clear(), GetSelectedThread(), operator=(), SetSelectedThreadByID(), SetSelectedThreadByIndexID(), and Update().

◆ m_stop_id

uint32_t lldb_private::ThreadList::m_stop_id
protected

The process stop ID that this thread list is valid for.

Definition at line 150 of file ThreadList.h.

Referenced by Clear(), GetStopID(), operator=(), SetStopID(), and Update().


The documentation for this class was generated from the following files: