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

Public Member Functions

void Dump (Stream &s) const

Static Public Member Functions

static Policy PublicState ()
static Policy PrivateState ()
static Policy PublicStateRunningExpression ()

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::PrivateState() and the rest follows from the policy.

Definition at line 32 of file Policy.h.

Member Enumeration Documentation

◆ 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 34 of file Policy.h.

Member Function Documentation

◆ Dump()

void Policy::Dump ( Stream & s) const

Definition at line 27 of file Policy.cpp.

References capabilities, Public, and view.

Referenced by lldb_private::PolicyStack::Current().

◆ PrivateState()

◆ PublicState()

Policy lldb_private::Policy::PublicState ( )
inlinestatic

Definition at line 57 of file Policy.h.

◆ PublicStateRunningExpression()

Policy lldb_private::Policy::PublicStateRunningExpression ( )
inlinestatic

Member Data Documentation

◆ capabilities

◆ view


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