|
LLDB mainline
|
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 Types | |
| using | Purpose = Policy::PrivateStatePurpose |
| Why this PST exists. | |
Public Member Functions | |
| PrivateStateThread (Process &process, lldb::StateType public_state, lldb::StateType private_state, llvm::StringRef thread_name, Purpose purpose=Purpose::Default) | |
| bool | StartupThread () |
| bool | IsOnThread (const HostThread &thread) const |
| bool | IsJoinable () |
| void | JoinAndReset () |
| bool | IsRunning () |
| bool | IsOverride () const |
| 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 () |
| ProcessRunLock & | GetRunLock () |
Public Attributes | |
| Process & | m_process |
| The process state that we show to client code. | |
| ThreadSafeValue< lldb::StateType > | m_public_state |
| The actual state of our process. | |
| ThreadSafeValue< lldb::StateType > | m_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 |
| Purpose | m_purpose |
| This will be the thread name given to the Private State HostThread when it gets spun up. | |
| std::string | m_thread_name |
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.
Why this PST exists.
RunPrivateStateThread reads this directly to decide which Policy to push, rather than re-deriving it from a generic "is this an override PST" flag. This is the same enum Policy::CreatePrivateState()/PolicyStack::PushPrivateState() take, so there's a single purpose value flowing from PST creation through to the policy it pushes.
|
inline |
Definition at line 3318 of file Process.h.
References m_private_state, m_process, m_public_state, m_purpose, m_thread_name, and lldb_private::Process::Process().
|
inline |
Definition at line 3346 of file Process.h.
References m_private_state.
|
inline |
Definition at line 3360 of file Process.h.
References m_private_state.
|
inline |
Definition at line 3364 of file Process.h.
References m_private_state.
|
inline |
Definition at line 3350 of file Process.h.
References m_public_state.
| ProcessRunLock & Process::PrivateStateThread::GetRunLock | ( | ) |
Definition at line 4133 of file Process.cpp.
References lldb_private::PolicyStack::Current(), lldb_private::PolicyStack::Get(), m_private_run_lock, m_public_run_lock, lldb_private::Policy::Private, and lldb_private::Policy::view.
|
inline |
Definition at line 3331 of file Process.h.
References m_private_state_thread.
| bool Process::PrivateStateThread::IsOnThread | ( | const HostThread & | thread | ) | const |
Definition at line 4129 of file Process.cpp.
References m_private_state_thread.
|
inline |
|
inline |
Definition at line 3340 of file Process.h.
References m_is_running.
|
inline |
Definition at line 3333 of file Process.h.
References m_is_running, and m_private_state_thread.
|
inline |
Definition at line 3378 of file Process.h.
References m_private_run_lock.
|
inline |
Definition at line 3384 of file Process.h.
References m_private_run_lock.
|
inline |
Definition at line 3356 of file Process.h.
References m_private_state.
|
inline |
Definition at line 3368 of file Process.h.
References m_private_state.
|
inline |
Definition at line 3376 of file Process.h.
References m_public_run_lock.
|
inline |
Definition at line 3382 of file Process.h.
References m_public_run_lock.
|
inline |
Definition at line 3352 of file Process.h.
References m_public_state.
|
inline |
Definition at line 3372 of file Process.h.
References m_public_state.
|
inline |
Definition at line 3344 of file Process.h.
References m_thread_name.
| bool Process::PrivateStateThread::StartupThread | ( | ) |
Definition at line 4110 of file Process.cpp.
References lldb_private::GetLog(), lldb_private::Host, lldb_private::ThreadLauncher::LaunchThread(), LLDB_LOG_ERROR, m_is_running, m_private_state_thread, m_process, m_purpose, and m_thread_name.
| bool lldb_private::Process::PrivateStateThread::m_is_running = false |
Definition at line 3407 of file Process.h.
Referenced by IsRunning(), JoinAndReset(), and StartupThread().
| ProcessRunLock lldb_private::Process::PrivateStateThread::m_private_run_lock |
Definition at line 3406 of file Process.h.
Referenced by GetRunLock(), SetPrivateRunLockToRunning(), and SetPrivateRunLockToStopped().
| ThreadSafeValue<lldb::StateType> lldb_private::Process::PrivateStateThread::m_private_state |
HostThread for the thread that watches for internal state events.
Definition at line 3397 of file Process.h.
Referenced by GetPrivateState(), GetPrivateStateMutex(), GetPrivateStateNoLock(), PrivateStateThread(), SetPrivateState(), and SetPrivateStateNoLock().
| HostThread lldb_private::Process::PrivateStateThread::m_private_state_thread |
Definition at line 3399 of file Process.h.
Referenced by IsJoinable(), IsOnThread(), JoinAndReset(), and StartupThread().
| 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 3390 of file Process.h.
Referenced by PrivateStateThread(), and StartupThread().
| ProcessRunLock lldb_private::Process::PrivateStateThread::m_public_run_lock |
Definition at line 3405 of file Process.h.
Referenced by GetRunLock(), SetPublicRunLockToRunning(), and SetPublicRunLockToStopped().
| ThreadSafeValue<lldb::StateType> lldb_private::Process::PrivateStateThread::m_public_state |
The actual state of our process.
Definition at line 3395 of file Process.h.
Referenced by GetPublicState(), PrivateStateThread(), SetPublicState(), and SetPublicStateNoLock().
| Purpose lldb_private::Process::PrivateStateThread::m_purpose |
This will be the thread name given to the Private State HostThread when it gets spun up.
Definition at line 3408 of file Process.h.
Referenced by IsOverride(), PrivateStateThread(), and StartupThread().
| std::string lldb_private::Process::PrivateStateThread::m_thread_name |
Definition at line 3411 of file Process.h.
Referenced by PrivateStateThread(), SetThreadName(), and StartupThread().