20 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {}
26 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
32 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
38 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
44 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
51 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
58 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
65 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
72 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
79 bool fill_current_process_thread_frame)
80 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
83 if (fill_current_process_thread_frame) {
97 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
109 : m_target_sp(exe_ctx_ref.GetTargetSP()),
110 m_process_sp(exe_ctx_ref.GetProcessSP()),
111 m_thread_sp(exe_ctx_ref.GetThreadSP()),
112 m_frame_sp(exe_ctx_ref.GetFrameSP()) {}
115 bool thread_and_frame_only_if_stopped)
116 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
117 if (exe_ctx_ref_ptr) {
120 if (!thread_and_frame_only_if_stopped ||
129 std::unique_lock<std::recursive_mutex> &lock)
130 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
131 if (exe_ctx_ref_ptr) {
134 lock = std::unique_lock<std::recursive_mutex>(
m_target_sp->GetAPIMutex());
144 std::unique_lock<std::recursive_mutex> &lock)
145 : m_target_sp(exe_ctx_ref.GetTargetSP()), m_process_sp(), m_thread_sp(),
148 lock = std::unique_lock<std::recursive_mutex>(
m_target_sp->GetAPIMutex());
157 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
177 return m_target_sp->GetArchitecture().GetAddressByteSize();
180 return sizeof(
void *);
185 return m_target_sp->GetArchitecture().GetByteOrder();
193 return m_frame_sp->GetRegisterContext().get();
292 if (get_process && target_sp)
303 m_target_sp = process_sp->GetTarget().shared_from_this();
377 return !(*
this == rhs);
397 : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {}
400 : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
406 : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
411 : m_target_wp(), m_process_wp(), m_thread_wp(), m_stack_id() {
438 m_tid = thread_sp->GetID();
465 SetTargetSP(process_sp->GetTarget().shared_from_this());
475 m_tid = thread_sp->GetID();
502 if (adopt_selected) {
512 if (stop_locker.
TryLock(&process_sp->GetRunLock()) &&
515 process_sp->GetThreadList().GetSelectedThread());
517 thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0);
524 frame_sp = thread_sp->GetStackFrameAtIndex(0);
564 if (target_sp && !target_sp->IsValid())
571 if (process_sp && !process_sp->IsValid())
583 if (!thread_sp || !thread_sp->IsValid()) {
585 if (process_sp && process_sp->IsValid()) {
586 thread_sp = process_sp->GetThreadList().FindThreadByID(
m_tid);
595 if (thread_sp && !thread_sp->IsValid())
605 return thread_sp->GetFrameWithStackID(
m_stack_id);
Execution context objects refer to objects in the execution of the program that is being debugged.
StackID m_stack_id
The stack ID that this object refers to in case the backing object changes.
ExecutionContext Lock(bool thread_and_frame_only_if_stopped) const
Create an ExecutionContext object from this object.
void SetThreadSP(const lldb::ThreadSP &thread_sp)
Set accessor that creates a weak reference to the thread referenced in thread_sp.
void Clear()
Clear the object's state.
lldb::StackFrameSP GetFrameSP() const
Get accessor that creates a strong reference from the weak frame reference contained in this object.
void SetThreadPtr(Thread *thread)
lldb::ProcessWP m_process_wp
A weak reference to a process.
lldb::ThreadSP GetThreadSP() const
Get accessor that creates a strong reference from the weak thread reference contained in this object.
void SetFrameSP(const lldb::StackFrameSP &frame_sp)
Set accessor that creates a weak reference to the frame referenced in frame_sp.
lldb::tid_t m_tid
The thread ID that this object refers to in case the backing object changes.
lldb::TargetSP GetTargetSP() const
Get accessor that creates a strong reference from the weak target reference contained in this object.
void SetTargetPtr(Target *target, bool adopt_selected)
lldb::ProcessSP GetProcessSP() const
Get accessor that creates a strong reference from the weak process reference contained in this object...
ExecutionContextRef & operator=(const ExecutionContextRef &rhs)
Assignment operator.
void SetProcessPtr(Process *process)
void SetFramePtr(StackFrame *frame)
ExecutionContextRef()
Default Constructor.
void SetTargetSP(const lldb::TargetSP &target_sp)
Set accessor that creates a weak reference to the target referenced in target_sp.
lldb::TargetWP m_target_wp
A weak reference to a target.
void SetProcessSP(const lldb::ProcessSP &process_sp)
Set accessor that creates a weak reference to the process referenced in process_sp.
lldb::ThreadWP m_thread_wp
A weak reference to a thread.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
virtual void CalculateExecutionContext(ExecutionContext &exe_ctx)=0
Reconstruct the object's execution context into sc.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void SetFrameSP(const lldb::StackFrameSP &frame_sp)
Set accessor to set only the frame shared pointer.
bool HasThreadScope() const
Returns true the ExecutionContext object contains a valid target, process, and thread.
void SetProcessPtr(Process *process)
Set accessor to set only the process shared pointer from a process pointer.
bool HasProcessScope() const
Returns true the ExecutionContext object contains a valid target and process.
ExecutionContextScope * GetBestExecutionContextScope() const
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
void Clear()
Clear the object's state.
ExecutionContext()
Default Constructor.
uint32_t GetAddressByteSize() const
const lldb::ProcessSP & GetProcessSP() const
Get accessor to get the process shared pointer.
void SetProcessSP(const lldb::ProcessSP &process_sp)
Set accessor to set only the process shared pointer.
lldb::StackFrameSP m_frame_sp
The stack frame in thread.
bool operator==(const ExecutionContext &rhs) const
void SetThreadPtr(Thread *thread)
Set accessor to set only the thread shared pointer from a thread pointer.
lldb::ByteOrder GetByteOrder() const
void SetTargetPtr(Target *target)
Set accessor to set only the target shared pointer from a target pointer.
lldb::TargetSP m_target_sp
The target that owns the process/thread/frame.
const lldb::StackFrameSP & GetFrameSP() const
Get accessor to get the frame shared pointer.
Process & GetProcessRef() const
Returns a reference to the process object.
void SetContext(const lldb::TargetSP &target_sp, bool get_process)
void SetTargetSP(const lldb::TargetSP &target_sp)
Set accessor to set only the target shared pointer.
Target * GetTargetPtr() const
Returns a pointer to the target object.
const lldb::ThreadSP & GetThreadSP() const
Get accessor to get the thread shared pointer.
void SetThreadSP(const lldb::ThreadSP &thread_sp)
Set accessor to set only the thread shared pointer.
bool HasTargetScope() const
Returns true the ExecutionContext object contains a valid target.
StackFrame & GetFrameRef() const
Returns a reference to the thread object.
bool HasFrameScope() const
Returns true the ExecutionContext object contains a valid target, process, thread and frame.
lldb::ThreadSP m_thread_sp
The thread that owns the frame.
lldb::ProcessSP m_process_sp
The process that owns the thread/frame.
bool operator!=(const ExecutionContext &rhs) const
Target & GetTargetRef() const
Returns a reference to the target object.
void SetFramePtr(StackFrame *frame)
Set accessor to set only the frame shared pointer from a frame pointer.
ExecutionContext & operator=(const ExecutionContext &rhs)
Process * GetProcessPtr() const
Returns a pointer to the process object.
Thread & GetThreadRef() const
Returns a reference to the thread object.
RegisterContext * GetRegisterContext() const
bool TryLock(ProcessRunLock *lock)
A plug-in interface definition class for debugging a process.
Target & GetTarget()
Get the target object pointer for this module.
This base class provides an interface to stack frames.
const lldb::ProcessSP & GetProcessSP() const
#define LLDB_INVALID_THREAD_ID
@ DoNoSelectMostRelevantFrame
lldb::ByteOrder InlHostByteOrder()
A class that represents a running process on the host machine.
bool StateIsStoppedState(lldb::StateType state, bool must_exist)
Check if a state represents a state where the process or thread is stopped.
std::weak_ptr< lldb_private::StackFrame > StackFrameWP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::Process > ProcessSP
ByteOrder
Byte ordering definitions.
std::weak_ptr< lldb_private::Process > ProcessWP
std::weak_ptr< lldb_private::Target > TargetWP
std::shared_ptr< lldb_private::Target > TargetSP
std::weak_ptr< lldb_private::Thread > ThreadWP