LLDB mainline
lldb_private::ThreadList Class Reference

#include <ThreadList.h>

Inheritance diagram for lldb_private::ThreadList:
[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)
bool ShouldStop (Event *event_ptr)
Vote ShouldReportStop (Event *event_ptr)
Vote ShouldReportRun (Event *event_ptr)
void RefreshStateAfterStop ()
bool WillResume (lldb::RunDirection &direction)
 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 ()

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< std::recursive_mutex, collectionThreadIterable

Detailed Description

Definition at line 26 of file ThreadList.h.

Constructor & Destructor Documentation

◆ ThreadList() [1/3]

◆ ThreadList() [2/3]

ThreadList::ThreadList ( const ThreadList & rhs)

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

Definition at line 463 of file ThreadList.cpp.

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

◆ DidResume()

void ThreadList::DidResume ( )

◆ DidStop()

void ThreadList::DidStop ( )

◆ DiscardThreadPlans()

void ThreadList::DiscardThreadPlans ( )

Definition at line 487 of file ThreadList.cpp.

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

◆ FindThreadByID()

◆ FindThreadByIndexID()

◆ FindThreadByProtocolID()

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

◆ Flush()

void ThreadList::Flush ( )

Definition at line 784 of file ThreadList.cpp.

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

◆ GetExpressionExecutionThread()

◆ GetMutex()

◆ GetSelectedThread()

◆ GetSize()

◆ GetStopID()

uint32_t ThreadList::GetStopID ( ) const

Definition at line 78 of file ThreadList.cpp.

References m_stop_id.

◆ GetThreadAtIndex()

◆ 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, lldb_private::ThreadCollection::m_threads, and ThreadList().

◆ PopExpressionExecutionThread()

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

Definition at line 73 of file ThreadList.cpp.

References m_expression_tid_stack.

◆ PushExpressionExecutionThread()

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

Definition at line 69 of file ThreadList.cpp.

References m_expression_tid_stack.

◆ RefreshStateAfterStop()

◆ RemoveThreadByID()

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

Definition at line 138 of file ThreadList.cpp.

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

◆ RemoveThreadByProtocolID()

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

◆ SetSelectedThreadByID()

◆ SetSelectedThreadByIndexID()

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

◆ SetShouldReportStop()

void ThreadList::SetShouldReportStop ( Vote vote)
protected

Definition at line 410 of file ThreadList.cpp.

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

◆ SetStopID()

void ThreadList::SetStopID ( uint32_t stop_id)

Definition at line 80 of file ThreadList.cpp.

References m_stop_id.

Referenced by WillResume().

◆ ShouldReportRun()

◆ ShouldReportStop()

◆ ShouldStop()

◆ Update()

void ThreadList::Update ( ThreadList & rhs)

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

Definition at line 740 of file ThreadList.cpp.

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

◆ WillResume()

bool ThreadList::WillResume ( lldb::RunDirection & direction)

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. Sets *direction to the run direction of the thread(s) that will be resumed. If threads that we want to run disagree about the direction, we execute forwards and pop any of the thread plans that requested reverse execution.

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

References lldb_private::ThreadCollection::AddThread(), lldb::eStateSuspended, lldb_private::GetLog(), GetMutex(), GetSelectedThread(), GetSize(), GetThreadAtIndex(), lldb_private::Log::GetVerbose(), LLDB_LOGF, m_process, lldb_private::ThreadCollection::m_threads, SetStopID(), lldb_private::Step, and ThreadList().

◆ Process

friend class Process
friend

Definition at line 27 of file ThreadList.h.

References Process, and ThreadList().

Referenced by Process, and ThreadList().

Member Data Documentation

◆ m_expression_tid_stack

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

◆ m_process

◆ 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 154 of file ThreadList.h.

Referenced by Clear(), GetSelectedThread(), operator=(), SetSelectedThreadByID(), SetSelectedThreadByIndexID(), ThreadList(), ThreadList(), 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 152 of file ThreadList.h.

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


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