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
Collaboration diagram for lldb_private::ThreadList:
Collaboration graph


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

 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

Private Member Functions

 ThreadList ()=delete


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

Definition at line 54 of file ThreadList.cpp.

References Clear().

◆ ThreadList() [3/3]

lldb_private::ThreadList::ThreadList ( )

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 742 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

◆ GetSelectedThread()

ThreadSP ThreadList::GetSelectedThread ( )

◆ GetSize()

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::AddException(), MinidumpFileBuilder::AddThreadList(), CreateAllImageInfosPayload(), lldb_private::ProcessWindows::DisableWatchpoint(), lldb_private::ctf::CommandObjectThreadTraceExportCTF::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectProcessContinue::DoExecute(), CommandObjectThreadContinue::DoExecute(), CommandObjectThreadUntil::DoExecute(), CommandObjectTargetModulesShowUnwind::DoExecute(), lldb_private::ProcessWindows::DoResume(), lldb_private::process_gdb_remote::ProcessGDBRemote::DoResume(), ProcessFreeBSDKernel::DoUpdateThreadList(), ProcessMachCore::DoUpdateThreadList(), lldb_private::minidump::ProcessMinidump::DoUpdateThreadList(), lldb_private::ScriptedProcess::DoUpdateThreadList(), ProcessElfCore::DoUpdateThreadList(), ProcessKDP::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::Process::UpdateThreadListIfNeeded(), and WillResume().

◆ GetStopID()

uint32_t ThreadList::GetStopID ( ) const

Definition at line 79 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 178 of file ThreadList.cpp.

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

◆ NotifySelectedThreadChanged()

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

◆ operator=()

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

◆ PopExpressionExecutionThread()

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

◆ PushExpressionExecutionThread()

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

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

◆ SetStopID()

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

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

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::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

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

◆ m_process

Process* lldb_private::ThreadList::m_process

◆ m_selected_tid

lldb::tid_t lldb_private::ThreadList::m_selected_tid

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

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: