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

#include <ThreadList.h>

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

Classes

class  ExpressionExecutionThreadPusher
 

Public Member Functions

 ThreadList (Process *process)
 
 ThreadList (const ThreadList &rhs)
 
 ~ThreadList () override
 
const ThreadListoperator= (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. More...
 
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)
 
- Public Member Functions inherited from lldb_private::ThreadCollection
 ThreadCollection ()
 
 ThreadCollection (collection threads)
 
virtual ~ThreadCollection ()
 
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 ()
 

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. More...
 
uint32_t m_stop_id
 The process stop ID that this thread list is valid for. More...
 
lldb::tid_t m_selected_tid
 For targets that need the notion of a current thread. More...
 
std::vector< lldb::tid_tm_expression_tid_stack
 
- Protected Attributes inherited from lldb_private::ThreadCollection
collection m_threads
 
std::recursive_mutex m_mutex
 

Friends

class Process
 

Additional Inherited Members

- Public Types inherited from lldb_private::ThreadCollection
typedef std::vector< lldb::ThreadSP > collection
 
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/2]

ThreadList::ThreadList ( Process process)

Definition at line 25 of file ThreadList.cpp.

◆ ThreadList() [2/2]

ThreadList::ThreadList ( const ThreadList rhs)

Definition at line 29 of file ThreadList.cpp.

◆ ~ThreadList()

ThreadList::~ThreadList ( )
override

Definition at line 53 of file ThreadList.cpp.

References Clear().

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 ( )

◆ GetBackingThread()

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

◆ GetExpressionExecutionThread()

lldb::ThreadSP ThreadList::GetExpressionExecutionThread ( )

◆ GetMutex()

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

Reimplemented from lldb_private::ThreadCollection.

Definition at line 743 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(), ProcessFreeBSD::DisableWatchpoint(), DiscardThreadPlans(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoDestroy(), CommandObjectIterateOverThreads::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectThreadContinue::DoExecute(), ProcessFreeBSD::EnableWatchpoint(), FindThreadByID(), FindThreadByIndexID(), FindThreadByProtocolID(), Flush(), GetBackingThread(), GetSelectedThread(), GetSize(), GetThreadAtIndex(), GetThreadSPForThreadPtr(), ProcessFreeBSD::GetWatchpointSupportInfo(), lldb_private::Process::HandleProcessStateChangedEvent(), ProcessFreeBSD::IsAThreadRunning(), ApplicationDelegate::MenuDelegateAction(), operator=(), ProcessFreeBSD::RefreshStateAfterStop(), RefreshStateAfterStop(), lldb_private::process_gdb_remote::ProcessGDBRemote::RefreshStateAfterStop(), RemoveThreadByID(), RemoveThreadByProtocolID(), SetSelectedThreadByID(), SetSelectedThreadByIndexID(), SetShouldReportStop(), lldb_private::process_gdb_remote::ProcessGDBRemote::SetThreadStopInfo(), ShouldReportRun(), ShouldReportStop(), ShouldStop(), ThreadsTreeDelegate::TreeDelegateGenerateChildren(), ThreadTreeDelegate::TreeDelegateItemSelected(), Update(), lldb_private::process_gdb_remote::ProcessGDBRemote::UpdateThreadIDList(), ProcessFreeBSD::UpdateThreadListIfNeeded(), WillResume(), and lldb_private::ThreadList::ExpressionExecutionThreadPusher::~ExpressionExecutionThreadPusher().

◆ 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 OperatingSystemPython::CreateThreadFromThreadInfo(), ProcessFreeBSD::DisableWatchpoint(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoDestroy(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), lldb_private::Process::ProcessEventData::DoOnRemoval(), lldb_private::ProcessWindows::DoResume(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoResume(), ProcessFreeBSD::EnableWatchpoint(), lldb_private::Process::GetThreadStatus(), lldb_private::Process::HandleProcessStateChangedEvent(), ProcessFreeBSD::IsAThreadRunning(), ApplicationDelegate::MenuDelegateAction(), DynamicLoaderMacOS::ProcessDidExec(), DynamicLoaderMacOSXDYLD::ProcessDidExec(), lldb_private::Target::RunStopHooks(), lldb_private::Process::RunThreadPlan(), ObjectFileMachO::SaveCore(), ThreadsTreeDelegate::TreeDelegateGenerateChildren(), OperatingSystemPython::UpdateThreadList(), ProcessMachCore::UpdateThreadList(), lldb_private::minidump::ProcessMinidump::UpdateThreadList(), ProcessElfCore::UpdateThreadList(), ProcessFreeBSD::UpdateThreadList(), ProcessKDP::UpdateThreadList(), lldb_private::process_gdb_remote::ProcessGDBRemote::UpdateThreadList(), ProcessFreeBSD::UpdateThreadListIfNeeded(), and WillResume().

◆ GetStopID()

uint32_t ThreadList::GetStopID ( ) const

◆ GetThreadAtIndex()

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

◆ GetThreadSPForThreadPtr()

ThreadSP ThreadList::GetThreadSPForThreadPtr ( Thread thread_ptr)

◆ NotifySelectedThreadChanged()

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

◆ operator=()

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

◆ 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)

◆ 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)

◆ 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 485 of file ThreadList.cpp.

References lldb_private::ThreadCollection::AddThread(), Clear(), lldb::eStateSuspended, lldb_private::GetLogIfAllCategoriesSet(), GetMutex(), GetSelectedThread(), GetSize(), lldb_private::Process::GetStopID(), GetThreadAtIndex(), lldb_private::Log::GetVerbose(), LIBLLDB_LOG_STEP, lldbassert, m_process, lldb_private::ThreadCollection::m_threads, lldb_private::Log::Printf(), SetStopID(), lldb_private::Process::StartNoticingNewThreads(), lldb_private::Process::StopNoticingNewThreads(), and lldb_private::Process::UpdateThreadListIfNeeded().

Referenced by lldb_private::Process::PrivateResume(), and lldb_private::ThreadList::ExpressionExecutionThreadPusher::~ExpressionExecutionThreadPusher().

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 150 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 148 of file ThreadList.h.

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


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