LLDB mainline
lldb_private::Policy Struct Reference

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

Detailed Description

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.

Definition at line 33 of file Policy.h.

Member Enumeration Documentation

◆ PrivateStatePurpose

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 

Definition at line 60 of file Policy.h.

◆ View

enum class lldb_private::Policy::View
strong

What view of the process this thread sees.

Enumerator
Public 

Provider-augmented frames, public state, public run lock.

Private 

Parent (unwinder) frames, private state, private run lock.

Definition at line 35 of file Policy.h.

Member Function Documentation

◆ CreatePrivateState()

◆ CreatePublicState()

Policy Policy::CreatePublicState ( )
static

Definition at line 32 of file Policy.cpp.

◆ CreatePublicStateRunningExpression()

◆ Dump()

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

Member Data Documentation

◆ capabilities

◆ view


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