LLDB mainline
lldb_private::StoppedExecutionContext Struct Reference

A wrapper class representing an execution context with non-null Target and Process pointers, a locked API mutex and a locked ProcessRunLock. More...

#include <ExecutionContext.h>

Inheritance diagram for lldb_private::StoppedExecutionContext:
[legend]

Public Member Functions

 StoppedExecutionContext (lldb::TargetSP &target_sp, lldb::ProcessSP &process_sp, lldb::ThreadSP &thread_sp, lldb::StackFrameSP &frame_sp, std::unique_lock< std::recursive_mutex > api_lock, ProcessRunLock::ProcessRunLocker stop_locker)
 StoppedExecutionContext (StoppedExecutionContext &&other)
 Transfers ownership of the locks from other to this, making other unusable.
std::unique_lock< std::recursive_mutex > AllowResume ()
 Clears this context, unlocking the ProcessRunLock and returning the locked API lock, allowing callers to resume the process.
Public Member Functions inherited from lldb_private::ExecutionContext
 ExecutionContext ()
 Default Constructor.
 ExecutionContext (const ExecutionContext &rhs)
 ExecutionContext (Target *t, bool fill_current_process_thread_frame=true)
 ExecutionContext (const lldb::TargetSP &target_sp, bool get_process)
 ExecutionContext (const lldb::ProcessSP &process_sp)
 ExecutionContext (const lldb::ThreadSP &thread_sp)
 ExecutionContext (const lldb::StackFrameSP &frame_sp)
 ExecutionContext (const lldb::TargetWP &target_wp, bool get_process)
 ExecutionContext (const lldb::ProcessWP &process_wp)
 ExecutionContext (const lldb::ThreadWP &thread_wp)
 ExecutionContext (const lldb::StackFrameWP &frame_wp)
 ExecutionContext (const ExecutionContextRef &exe_ctx_ref)
 ExecutionContext (const ExecutionContextRef *exe_ctx_ref, bool thread_and_frame_only_if_stopped=false)
 ExecutionContext (ExecutionContextScope *exe_scope)
 ExecutionContext (ExecutionContextScope &exe_scope)
 ExecutionContext (Process *process, Thread *thread=nullptr, StackFrame *frame=nullptr)
 Construct with process, thread, and frame index.
 ~ExecutionContext ()
ExecutionContextoperator= (const ExecutionContext &rhs)
bool operator== (const ExecutionContext &rhs) const
bool operator!= (const ExecutionContext &rhs) const
void Clear ()
 Clear the object's state.
RegisterContextGetRegisterContext () const
ExecutionContextScopeGetBestExecutionContextScope () const
uint32_t GetAddressByteSize () const
lldb::ByteOrder GetByteOrder () const
TargetGetTargetPtr () const
 Returns a pointer to the target object.
ProcessGetProcessPtr () const
 Returns a pointer to the process object.
ThreadGetThreadPtr () const
 Returns a pointer to the thread object.
StackFrameGetFramePtr () const
 Returns a pointer to the frame object.
TargetGetTargetRef () const
 Returns a reference to the target object.
ProcessGetProcessRef () const
 Returns a reference to the process object.
ThreadGetThreadRef () const
 Returns a reference to the thread object.
StackFrameGetFrameRef () const
 Returns a reference to the thread object.
const lldb::TargetSPGetTargetSP () const
 Get accessor to get the target shared pointer.
const lldb::ProcessSPGetProcessSP () const
 Get accessor to get the process shared pointer.
const lldb::ThreadSPGetThreadSP () const
 Get accessor to get the thread shared pointer.
const lldb::StackFrameSPGetFrameSP () const
 Get accessor to get the frame shared pointer.
void SetTargetSP (const lldb::TargetSP &target_sp)
 Set accessor to set only the target shared pointer.
void SetProcessSP (const lldb::ProcessSP &process_sp)
 Set accessor to set only the process shared pointer.
void SetThreadSP (const lldb::ThreadSP &thread_sp)
 Set accessor to set only the thread shared pointer.
void SetFrameSP (const lldb::StackFrameSP &frame_sp)
 Set accessor to set only the frame shared pointer.
void SetTargetPtr (Target *target)
 Set accessor to set only the target shared pointer from a target pointer.
void SetProcessPtr (Process *process)
 Set accessor to set only the process shared pointer from a process pointer.
void SetThreadPtr (Thread *thread)
 Set accessor to set only the thread shared pointer from a thread pointer.
void SetFramePtr (StackFrame *frame)
 Set accessor to set only the frame shared pointer from a frame pointer.
void SetContext (const lldb::TargetSP &target_sp, bool get_process)
void SetContext (const lldb::ProcessSP &process_sp)
void SetContext (const lldb::ThreadSP &thread_sp)
void SetContext (const lldb::StackFrameSP &frame_sp)
bool HasTargetScope () const
 Returns true the ExecutionContext object contains a valid target.
bool HasProcessScope () const
 Returns true the ExecutionContext object contains a valid target and process.
bool HasThreadScope () const
 Returns true the ExecutionContext object contains a valid target, process, and thread.
bool HasFrameScope () const
 Returns true the ExecutionContext object contains a valid target, process, thread and frame.

Private Attributes

std::unique_lock< std::recursive_mutex > m_api_lock
ProcessRunLock::ProcessRunLocker m_stop_locker

Additional Inherited Members

Protected Attributes inherited from lldb_private::ExecutionContext
lldb::TargetSP m_target_sp
 The target that owns the process/thread/frame.
lldb::ProcessSP m_process_sp
 The process that owns the thread/frame.
lldb::ThreadSP m_thread_sp
 The thread that owns the frame.
lldb::StackFrameSP m_frame_sp
 The stack frame in thread.

Detailed Description

A wrapper class representing an execution context with non-null Target and Process pointers, a locked API mutex and a locked ProcessRunLock.

The locks are private by design: to unlock them, destroy the StoppedExecutionContext.

Definition at line 566 of file ExecutionContext.h.

Constructor & Destructor Documentation

◆ StoppedExecutionContext() [1/2]

lldb_private::StoppedExecutionContext::StoppedExecutionContext ( lldb::TargetSP & target_sp,
lldb::ProcessSP & process_sp,
lldb::ThreadSP & thread_sp,
lldb::StackFrameSP & frame_sp,
std::unique_lock< std::recursive_mutex > api_lock,
ProcessRunLock::ProcessRunLocker stop_locker )
inline

◆ StoppedExecutionContext() [2/2]

lldb_private::StoppedExecutionContext::StoppedExecutionContext ( StoppedExecutionContext && other)
inline

Member Function Documentation

◆ AllowResume()

std::unique_lock< std::recursive_mutex > StoppedExecutionContext::AllowResume ( )
nodiscard

Clears this context, unlocking the ProcessRunLock and returning the locked API lock, allowing callers to resume the process.

Similar to a move operation, this object is no longer usable.

Definition at line 167 of file ExecutionContext.cpp.

References lldb_private::ExecutionContext::Clear(), m_api_lock, and m_stop_locker.

Referenced by ResumeNewPlan().

Member Data Documentation

◆ m_api_lock

std::unique_lock<std::recursive_mutex> lldb_private::StoppedExecutionContext::m_api_lock
private

◆ m_stop_locker

ProcessRunLock::ProcessRunLocker lldb_private::StoppedExecutionContext::m_stop_locker
private

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