LLDB mainline
lldb_private::Process::PrivateStateThread Struct Reference

The PrivateStateThread struct gathers all the bits of state needed to manage handling Process events, from receiving them on the Private State to signaling when process events are broadcase publicly, to determining when various actors can act on the process. More...

#include <Process.h>

Public Member Functions

 PrivateStateThread (Process &process, lldb::StateType public_state, lldb::StateType private_state, bool is_secondary_thread, llvm::StringRef thread_name)
bool StartupThread ()
bool IsOnThread (const HostThread &thread) const
bool IsJoinable ()
void JoinAndReset ()
bool IsRunning ()
void SetThreadName (llvm::StringRef new_name)
lldb::StateType GetPrivateState () const
lldb::StateType GetPublicState () const
void SetPublicState (lldb::StateType new_value)
void SetPrivateState (lldb::StateType new_value)
std::recursive_mutex & GetPrivateStateMutex ()
lldb::StateType GetPrivateStateNoLock () const
void SetPrivateStateNoLock (lldb::StateType new_state)
void SetPublicStateNoLock (lldb::StateType new_state)
bool SetPublicRunLockToRunning ()
bool SetPrivateRunLockToRunning ()
bool SetPublicRunLockToStopped ()
bool SetPrivateRunLockToStopped ()
ProcessRunLockGetRunLock ()

Public Attributes

Processm_process
 The process state that we show to client code.
ThreadSafeValue< lldb::StateTypem_public_state
 The actual state of our process.
ThreadSafeValue< lldb::StateTypem_private_state
 HostThread for the thread that watches for internal state events.
HostThread m_private_state_thread
ProcessRunLock m_public_run_lock
ProcessRunLock m_private_run_lock
bool m_is_running = false
bool m_is_secondary_thread
 If we need to run an expression modally in the private state thread, we have to spin up a secondary private state thread to manage the events that drive that interaction.
std::string m_thread_name

Detailed Description

The PrivateStateThread struct gathers all the bits of state needed to manage handling Process events, from receiving them on the Private State to signaling when process events are broadcase publicly, to determining when various actors can act on the process.

It also holds the current private state thread. These need to be swappable as a group to manage the temporary modal private state thread that we spin up when we need to run an expression on the private state thread.

Definition at line 3187 of file Process.h.

Constructor & Destructor Documentation

◆ PrivateStateThread()

lldb_private::Process::PrivateStateThread::PrivateStateThread ( Process & process,
lldb::StateType public_state,
lldb::StateType private_state,
bool is_secondary_thread,
llvm::StringRef thread_name )
inline

Member Function Documentation

◆ GetPrivateState()

lldb::StateType lldb_private::Process::PrivateStateThread::GetPrivateState ( ) const
inline

Definition at line 3216 of file Process.h.

References m_private_state.

◆ GetPrivateStateMutex()

std::recursive_mutex & lldb_private::Process::PrivateStateThread::GetPrivateStateMutex ( )
inline

Definition at line 3230 of file Process.h.

References m_private_state.

◆ GetPrivateStateNoLock()

lldb::StateType lldb_private::Process::PrivateStateThread::GetPrivateStateNoLock ( ) const
inline

Definition at line 3234 of file Process.h.

References m_private_state.

◆ GetPublicState()

lldb::StateType lldb_private::Process::PrivateStateThread::GetPublicState ( ) const
inline

Definition at line 3220 of file Process.h.

References m_public_state.

◆ GetRunLock()

ProcessRunLock & lldb_private::Process::PrivateStateThread::GetRunLock ( )
inline

◆ IsJoinable()

bool lldb_private::Process::PrivateStateThread::IsJoinable ( )
inline

Definition at line 3203 of file Process.h.

References m_private_state_thread.

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

◆ IsOnThread()

bool Process::PrivateStateThread::IsOnThread ( const HostThread & thread) const

Definition at line 3901 of file Process.cpp.

References m_private_state_thread.

Referenced by GetRunLock().

◆ IsRunning()

bool lldb_private::Process::PrivateStateThread::IsRunning ( )
inline

Definition at line 3212 of file Process.h.

References m_is_running.

◆ JoinAndReset()

void lldb_private::Process::PrivateStateThread::JoinAndReset ( )
inline

Definition at line 3205 of file Process.h.

References m_is_running, and m_private_state_thread.

◆ SetPrivateRunLockToRunning()

bool lldb_private::Process::PrivateStateThread::SetPrivateRunLockToRunning ( )
inline

Definition at line 3248 of file Process.h.

References m_private_run_lock.

◆ SetPrivateRunLockToStopped()

bool lldb_private::Process::PrivateStateThread::SetPrivateRunLockToStopped ( )
inline

Definition at line 3254 of file Process.h.

References m_private_run_lock.

◆ SetPrivateState()

void lldb_private::Process::PrivateStateThread::SetPrivateState ( lldb::StateType new_value)
inline

Definition at line 3226 of file Process.h.

References m_private_state.

◆ SetPrivateStateNoLock()

void lldb_private::Process::PrivateStateThread::SetPrivateStateNoLock ( lldb::StateType new_state)
inline

Definition at line 3238 of file Process.h.

References m_private_state.

◆ SetPublicRunLockToRunning()

bool lldb_private::Process::PrivateStateThread::SetPublicRunLockToRunning ( )
inline

Definition at line 3246 of file Process.h.

References m_public_run_lock.

◆ SetPublicRunLockToStopped()

bool lldb_private::Process::PrivateStateThread::SetPublicRunLockToStopped ( )
inline

Definition at line 3252 of file Process.h.

References m_public_run_lock.

◆ SetPublicState()

void lldb_private::Process::PrivateStateThread::SetPublicState ( lldb::StateType new_value)
inline

Definition at line 3222 of file Process.h.

References m_public_state.

◆ SetPublicStateNoLock()

void lldb_private::Process::PrivateStateThread::SetPublicStateNoLock ( lldb::StateType new_state)
inline

Definition at line 3242 of file Process.h.

References m_public_state.

◆ SetThreadName()

void lldb_private::Process::PrivateStateThread::SetThreadName ( llvm::StringRef new_name)
inline

Definition at line 3214 of file Process.h.

References m_thread_name.

◆ StartupThread()

Member Data Documentation

◆ m_is_running

bool lldb_private::Process::PrivateStateThread::m_is_running = false

Definition at line 3282 of file Process.h.

Referenced by IsRunning(), JoinAndReset(), and StartupThread().

◆ m_is_secondary_thread

bool lldb_private::Process::PrivateStateThread::m_is_secondary_thread

If we need to run an expression modally in the private state thread, we have to spin up a secondary private state thread to manage the events that drive that interaction.

This will be true if this is a modal private state thread. This will be the thread name given to the Private State HostThread when it gets spun up.

Definition at line 3287 of file Process.h.

Referenced by PrivateStateThread().

◆ m_private_run_lock

ProcessRunLock lldb_private::Process::PrivateStateThread::m_private_run_lock

Definition at line 3281 of file Process.h.

Referenced by GetRunLock(), SetPrivateRunLockToRunning(), and SetPrivateRunLockToStopped().

◆ m_private_state

ThreadSafeValue<lldb::StateType> lldb_private::Process::PrivateStateThread::m_private_state

HostThread for the thread that watches for internal state events.

Definition at line 3272 of file Process.h.

Referenced by GetPrivateState(), GetPrivateStateMutex(), GetPrivateStateNoLock(), PrivateStateThread(), SetPrivateState(), and SetPrivateStateNoLock().

◆ m_private_state_thread

HostThread lldb_private::Process::PrivateStateThread::m_private_state_thread

Definition at line 3274 of file Process.h.

Referenced by IsJoinable(), IsOnThread(), JoinAndReset(), and StartupThread().

◆ m_process

Process& lldb_private::Process::PrivateStateThread::m_process

The process state that we show to client code.

This will often differ from the actual process state, for instance when we've stopped in the middle of a ThreadPlan's operations, before we've decided to stop or continue.

Definition at line 3265 of file Process.h.

Referenced by PrivateStateThread(), and StartupThread().

◆ m_public_run_lock

ProcessRunLock lldb_private::Process::PrivateStateThread::m_public_run_lock

Definition at line 3280 of file Process.h.

Referenced by GetRunLock(), SetPublicRunLockToRunning(), and SetPublicRunLockToStopped().

◆ m_public_state

ThreadSafeValue<lldb::StateType> lldb_private::Process::PrivateStateThread::m_public_state

The actual state of our process.

Definition at line 3270 of file Process.h.

Referenced by GetPublicState(), PrivateStateThread(), SetPublicState(), and SetPublicStateNoLock().

◆ m_thread_name

std::string lldb_private::Process::PrivateStateThread::m_thread_name

Definition at line 3290 of file Process.h.

Referenced by PrivateStateThread(), SetThreadName(), and StartupThread().


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