|
LLDB mainline
|
Describes what view of the process a thread should see and what operations it is allowed to perform. More...
#include <Policy.h>
Classes | |
| struct | Capabilities |
| What operations this thread is allowed to perform. More... | |
Public Types | |
| enum class | View { Public , Private } |
| What view of the process this thread sees. More... | |
| enum class | PrivateStatePurpose { Default , RunningExpression } |
| Why a private-state policy is being pushed. More... | |
Public Member Functions | |
| void | Dump (Stream &s) const |
Static Public Member Functions | |
Factories | |
CreatePublicState is the baseline (returns default Policy{}). The transition factories below start from PolicyStack::Get().Current() and apply their named change on top. | |
| static Policy | CreatePublicState () |
| static Policy | CreatePrivateState (PrivateStatePurpose purpose=PrivateStatePurpose::Default) |
| static Policy | CreatePublicStateRunningExpression () |
Public Attributes | |
| View | view = View::Public |
| Capabilities | capabilities |
Describes what view of the process a thread should see and what operations it is allowed to perform.
This replaces ad-hoc checks like CurrentThreadIsPrivateStateThread() with a unified, composable mechanism. Code consults the current policy on the per-thread PolicyStack instead of comparing host thread identities.
One motivating case is frame providers, which layer a public illusion on top of the private unwinder stack. The private state thread must see the raw unwinder frames, while public clients see the augmented view. Rather than checking thread identity at every callsite, the private state thread pushes Policy::CreatePrivateState() and the rest follows from the policy.
|
strong |
Why a private-state policy is being pushed.
Distinguishes a PST's ordinary private-state processing from a PST created to service RunThreadPlan expression evaluation, which must not run frame providers or recognizers (see StackFrameList::SelectMostRelevantFrame and Thread::GetStackFrameList).
| Enumerator | |
|---|---|
| Default | |
| RunningExpression | |
|
strong |
|
static |
Definition at line 34 of file Policy.cpp.
References lldb_private::Policy::Capabilities::can_load_frame_providers, lldb_private::Policy::Capabilities::can_run_frame_recognizers, capabilities, lldb_private::PolicyStack::Current(), Default, lldb_private::PolicyStack::Get(), Private, RunningExpression, and view.
Referenced by lldb_private::PolicyStack::PushPrivateState().
|
static |
Definition at line 32 of file Policy.cpp.
|
static |
Definition at line 48 of file Policy.cpp.
References lldb_private::Policy::Capabilities::can_run_breakpoint_actions, capabilities, lldb_private::PolicyStack::Current(), and lldb_private::PolicyStack::Get().
Referenced by lldb_private::PolicyStack::PushPublicStateRunningExpression().
| void Policy::Dump | ( | Stream & | s | ) | const |
Definition at line 89 of file Policy.cpp.
References capabilities, Public, and view.
Referenced by lldb_private::PolicyStack::Current().
| Capabilities lldb_private::Policy::capabilities |
Definition at line 66 of file Policy.h.
Referenced by CreatePrivateState(), CreatePublicStateRunningExpression(), Dump(), lldb_private::Thread::GetStackFrameList(), lldb_private::StopInfoBreakpoint::PerformAction(), lldb_private::StopInfoWatchpoint::PerformAction(), and lldb_private::StackFrameList::SelectMostRelevantFrame().
| View lldb_private::Policy::view = View::Public |
Definition at line 65 of file Policy.h.
Referenced by CreatePrivateState(), Dump(), lldb_private::Target::GetAPIMutex(), lldb_private::Process::PrivateStateThread::GetRunLock(), and lldb_private::Process::GetState().