1 //===-- ExecutionContext.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
9 /// Execution context objects refer to objects in the execution of the
10 /// program that is being debugged. The consist of one or more of the
11 /// following objects: target, process, thread, and frame. Many objects
12 /// in the debugger need to track different executions contexts. For
13 /// example, a local function variable might have an execution context
14 /// that refers to a stack frame. A global or static variable might
15 /// refer to a target since a stack frame isn't required in order to
16 /// evaluate a global or static variable (a process isn't necessarily
17 /// needed for a global variable since we might be able to read the
18 /// variable value from a data section in one of the object files in
19 /// a target). There are two types of objects that hold onto execution
20 /// contexts: ExecutionContextRef and ExecutionContext. Both of these
21 /// objects are deascribed below.
23 /// Not all objects in an ExectionContext objects will be valid. If you want
24 /// to refer stronly (ExectionContext) or weakly (ExectionContextRef) to
25 /// a process, then only the process and target references will be valid.
26 /// For threads, only the thread, process and target references will be
27 /// filled in. For frames, all of the objects will be filled in.
29 /// These classes are designed to be used as baton objects that get passed
30 /// to a wide variety of functions that require execution contexts.
31 //===----------------------------------------------------------------------===//
35 #ifndef liblldb_ExecutionContext_h_
36 #define liblldb_ExecutionContext_h_
38 #include "lldb/lldb-private.h"
39 #include "lldb/Target/StackID.h"
40 #include "lldb/Host/Mutex.h"
42 namespace lldb_private {
44 //----------------------------------------------------------------------
45 /// @class ExecutionContextRef ExecutionContext.h "lldb/Target/ExecutionContext.h"
46 /// @brief A class that holds a weak reference to an execution context.
48 /// ExecutionContextRef objects are designed to hold onto an execution
49 /// context that might change over time. For example, if an object wants
50 /// to refer to a stack frame, it should hold onto an ExecutionContextRef
51 /// to a frame object. The backing object that represents the stack frame
52 /// might change over time and instaces of this object can track the logical
53 /// object that refers to a frame even if it does change.
55 /// These objects also don't keep execution objects around longer than they
56 /// should since they use weak pointers. For example if an object refers
57 /// to a stack frame and a stack frame is no longer in a thread, then a
58 /// ExecutionContextRef object that refers to that frame will not be able
59 /// to get a shared pointer to those objects since they are no longer around.
61 /// ExecutionContextRef objects can also be used as objects in classes
62 /// that want to track a "previous execution context". Since the weak
63 /// references to the execution objects (target, process, thread and frame)
64 /// don't keep these objects around, they are safe to keep around.
66 /// The general rule of thumb is all long lived objects that want to
67 /// refer to execution contexts should use ExecutionContextRef objcts.
68 /// The ExecutionContext class is used to temporarily get shared
69 /// pointers to any execution context objects that are still around
70 /// so they are guaranteed to exist during a function that requires the
71 /// objects. ExecutionContext objects should NOT be used for long term
72 /// storage since they will keep objects alive with extra shared pointer
73 /// references to these objects.
74 //----------------------------------------------------------------------
75 class ExecutionContextRef
78 //------------------------------------------------------------------
79 /// Default Constructor.
80 //------------------------------------------------------------------
81 ExecutionContextRef();
83 //------------------------------------------------------------------
85 //------------------------------------------------------------------
86 ExecutionContextRef (const ExecutionContextRef &rhs);
88 //------------------------------------------------------------------
89 /// Construct using an ExecutionContext object that might be NULL.
91 /// If \a exe_ctx_ptr is valid, then make weak references to any
92 /// valid objects in the ExecutionContext, othewise no weak
93 /// references to any execution context objects will be made.
94 //------------------------------------------------------------------
95 ExecutionContextRef (const ExecutionContext *exe_ctx_ptr);
97 //------------------------------------------------------------------
98 /// Construct using an ExecutionContext object.
100 /// Make weak references to any valid objects in the ExecutionContext.
101 //------------------------------------------------------------------
102 ExecutionContextRef (const ExecutionContext &exe_ctx);
104 //------------------------------------------------------------------
105 /// Assignment operator
107 /// Copy all weak refernces in \a rhs.
108 //------------------------------------------------------------------
109 ExecutionContextRef &
110 operator =(const ExecutionContextRef &rhs);
112 //------------------------------------------------------------------
113 /// Assignment operator from a ExecutionContext
115 /// Make weak refernces to any stringly referenced objects in \a exe_ctx.
116 //------------------------------------------------------------------
117 ExecutionContextRef &
118 operator =(const ExecutionContext &exe_ctx);
120 //------------------------------------------------------------------
121 /// Construct using the target and all the selected items inside of it
122 /// (the process and its selected thread, and the thread's selected
123 /// frame). If there is no selected thread, default to the first thread
124 /// If there is no selected frame, default to the first frame.
125 //------------------------------------------------------------------
126 ExecutionContextRef (Target *target, bool adopt_selected);
128 //------------------------------------------------------------------
129 /// Construct using an execution context scope.
131 /// If the ExecutionContextScope object is valid and refers to a frame,
132 /// make weak refernces too the frame, thread, process and target.
133 /// If the ExecutionContextScope object is valid and refers to a thread,
134 /// make weak refernces too the thread, process and target.
135 /// If the ExecutionContextScope object is valid and refers to a process,
136 /// make weak refernces too the process and target.
137 /// If the ExecutionContextScope object is valid and refers to a target,
138 /// make weak refernces too the target.
139 //------------------------------------------------------------------
140 ExecutionContextRef (ExecutionContextScope *exe_scope);
142 //------------------------------------------------------------------
143 /// Construct using an execution context scope.
145 /// If the ExecutionContextScope object refers to a frame,
146 /// make weak refernces too the frame, thread, process and target.
147 /// If the ExecutionContextScope object refers to a thread,
148 /// make weak refernces too the thread, process and target.
149 /// If the ExecutionContextScope object refers to a process,
150 /// make weak refernces too the process and target.
151 /// If the ExecutionContextScope object refers to a target,
152 /// make weak refernces too the target.
153 //------------------------------------------------------------------
154 ExecutionContextRef (ExecutionContextScope &exe_scope);
156 ~ExecutionContextRef();
157 //------------------------------------------------------------------
158 /// Clear the object's state.
160 /// Sets the process and thread to NULL, and the frame index to an
162 //------------------------------------------------------------------
166 //------------------------------------------------------------------
167 /// Set accessor that creates a weak reference to the target
168 /// referenced in \a target_sp.
170 /// If \a target_sp is valid this object will create a weak
171 /// reference to that object, otherwise any previous target weak
172 /// reference contained in this object will be reset.
174 /// Only the weak reference to the target will be updated, no other
175 /// weak references will be modified. If you want this execution
176 /// context to make a weak reference to the target's process, use
177 /// the ExecutionContextRef::SetContext() functions.
179 /// @see ExecutionContextRef::SetContext(const lldb::TargetSP &, bool)
180 //------------------------------------------------------------------
182 SetTargetSP (const lldb::TargetSP &target_sp);
184 //------------------------------------------------------------------
185 /// Set accessor that creates a weak reference to the process
186 /// referenced in \a process_sp.
188 /// If \a process_sp is valid this object will create a weak
189 /// reference to that object, otherwise any previous process weak
190 /// reference contained in this object will be reset.
192 /// Only the weak reference to the process will be updated, no other
193 /// weak references will be modified. If you want this execution
194 /// context to make a weak reference to the target, use the
195 /// ExecutionContextRef::SetContext() functions.
197 /// @see ExecutionContextRef::SetContext(const lldb::ProcessSP &)
198 //------------------------------------------------------------------
200 SetProcessSP (const lldb::ProcessSP &process_sp);
202 //------------------------------------------------------------------
203 /// Set accessor that creates a weak reference to the thread
204 /// referenced in \a thread_sp.
206 /// If \a thread_sp is valid this object will create a weak
207 /// reference to that object, otherwise any previous thread weak
208 /// reference contained in this object will be reset.
210 /// Only the weak reference to the thread will be updated, no other
211 /// weak references will be modified. If you want this execution
212 /// context to make a weak reference to the thread's process and
213 /// target, use the ExecutionContextRef::SetContext() functions.
215 /// @see ExecutionContextRef::SetContext(const lldb::ThreadSP &)
216 //------------------------------------------------------------------
218 SetThreadSP (const lldb::ThreadSP &thread_sp);
220 //------------------------------------------------------------------
221 /// Set accessor that creates a weak reference to the frame
222 /// referenced in \a frame_sp.
224 /// If \a frame_sp is valid this object will create a weak
225 /// reference to that object, otherwise any previous frame weak
226 /// reference contained in this object will be reset.
228 /// Only the weak reference to the frame will be updated, no other
229 /// weak references will be modified. If you want this execution
230 /// context to make a weak reference to the frame's thread, process
231 /// and target, use the ExecutionContextRef::SetContext() functions.
233 /// @see ExecutionContextRef::SetContext(const lldb::StackFrameSP &)
234 //------------------------------------------------------------------
236 SetFrameSP (const lldb::StackFrameSP &frame_sp);
239 SetTargetPtr (Target* target, bool adopt_selected);
242 SetProcessPtr (Process *process);
245 SetThreadPtr (Thread *thread);
248 SetFramePtr (StackFrame *frame);
250 //------------------------------------------------------------------
251 /// Get accessor that creates a strong reference from the weak target
252 /// reference contained in this object.
255 /// A shared pointer to a target that is not guaranteed to be valid.
256 //------------------------------------------------------------------
258 GetTargetSP () const;
260 //------------------------------------------------------------------
261 /// Get accessor that creates a strong reference from the weak process
262 /// reference contained in this object.
265 /// A shared pointer to a process that is not guaranteed to be valid.
266 //------------------------------------------------------------------
268 GetProcessSP () const;
270 //------------------------------------------------------------------
271 /// Get accessor that creates a strong reference from the weak thread
272 /// reference contained in this object.
275 /// A shared pointer to a thread that is not guaranteed to be valid.
276 //------------------------------------------------------------------
278 GetThreadSP () const;
280 //------------------------------------------------------------------
281 /// Get accessor that creates a strong reference from the weak frame
282 /// reference contained in this object.
285 /// A shared pointer to a frame that is not guaranteed to be valid.
286 //------------------------------------------------------------------
290 //------------------------------------------------------------------
291 /// Create an ExecutionContext object from this object.
293 /// Create strong references to any execution context objects that
294 /// are still valid. Any of the returned shared pointers in the
295 /// ExecutionContext objects is not guaranteed to be valid.
297 /// An execution context object that has strong references to
298 /// any valid weak references in this object.
299 //------------------------------------------------------------------
301 Lock (bool thread_and_frame_only_if_stopped) const;
303 //------------------------------------------------------------------
304 /// Returns true if this object has a weak reference to a thread.
305 /// The return value is only an indication of wether this object has
306 /// a weak reference and does not indicate wether the weak rerference
308 //------------------------------------------------------------------
310 HasThreadRef () const
312 return m_tid != LLDB_INVALID_THREAD_ID;
315 //------------------------------------------------------------------
316 /// Returns true if this object has a weak reference to a frame.
317 /// The return value is only an indication of wether this object has
318 /// a weak reference and does not indicate wether the weak rerference
320 //------------------------------------------------------------------
324 return m_stack_id.IsValid();
331 m_tid = LLDB_INVALID_THREAD_ID;
341 //------------------------------------------------------------------
343 //------------------------------------------------------------------
344 lldb::TargetWP m_target_wp; ///< A weak reference to a target
345 lldb::ProcessWP m_process_wp; ///< A weak reference to a process
346 mutable lldb::ThreadWP m_thread_wp; ///< A weak reference to a thread
347 lldb::tid_t m_tid; ///< The thread ID that this object refers to in case the backing object changes
348 StackID m_stack_id; ///< The stack ID that this object refers to in case the backing object changes
351 //----------------------------------------------------------------------
352 /// @class ExecutionContext ExecutionContext.h "lldb/Target/ExecutionContext.h"
353 /// @brief A class that contains an execution context.
355 /// This baton object can be passed into any function that requires
356 /// a context that specifies a target, process, thread and frame.
357 /// These objects are designed to be used for short term execution
358 /// context object storage while a function might be trying to evaluate
359 /// something that requires a thread or frame. ExecutionContextRef
360 /// objects can be used to initialize one of these objects to turn
361 /// the weak execution context object references to the target, process,
362 /// thread and frame into strong references (shared pointers) so that
363 /// functions can guarantee that these objects won't go away in the
364 /// middle of a function.
366 /// ExecutionContext objects should be used as short lived objects
367 /// (typically on the stack) in order to lock down an execution context
368 /// for local use and for passing down to other functions that also
369 /// require specific contexts. They should NOT be used for long term
370 /// storage, for long term storage use ExecutionContextRef objects.
371 //----------------------------------------------------------------------
372 class ExecutionContext
375 //------------------------------------------------------------------
376 /// Default Constructor.
377 //------------------------------------------------------------------
380 //------------------------------------------------------------------
382 //------------------------------------------------------------------
383 ExecutionContext (const ExecutionContext &rhs);
385 //------------------------------------------------------------------
386 // Adopt the target and optionally its current context.
387 //------------------------------------------------------------------
388 ExecutionContext (Target* t, bool fill_current_process_thread_frame = true);
390 //------------------------------------------------------------------
391 // Create execution contexts from shared pointers
392 //------------------------------------------------------------------
393 ExecutionContext (const lldb::TargetSP &target_sp, bool get_process);
394 ExecutionContext (const lldb::ProcessSP &process_sp);
395 ExecutionContext (const lldb::ThreadSP &thread_sp);
396 ExecutionContext (const lldb::StackFrameSP &frame_sp);
397 //------------------------------------------------------------------
398 // Create execution contexts from weak pointers
399 //------------------------------------------------------------------
400 ExecutionContext (const lldb::TargetWP &target_wp, bool get_process);
401 ExecutionContext (const lldb::ProcessWP &process_wp);
402 ExecutionContext (const lldb::ThreadWP &thread_wp);
403 ExecutionContext (const lldb::StackFrameWP &frame_wp);
404 ExecutionContext (const ExecutionContextRef &exe_ctx_ref);
405 ExecutionContext (const ExecutionContextRef *exe_ctx_ref, bool thread_and_frame_only_if_stopped = false);
407 // These two variants take in a locker, and grab the target, lock the API mutex into locker, then
408 // fill in the rest of the shared pointers.
409 ExecutionContext (const ExecutionContextRef &exe_ctx_ref, Mutex::Locker &locker);
410 ExecutionContext (const ExecutionContextRef *exe_ctx_ref, Mutex::Locker &locker);
411 //------------------------------------------------------------------
412 // Create execution contexts from execution context scopes
413 //------------------------------------------------------------------
414 ExecutionContext (ExecutionContextScope *exe_scope);
415 ExecutionContext (ExecutionContextScope &exe_scope);
419 operator =(const ExecutionContext &rhs);
422 operator ==(const ExecutionContext &rhs) const;
425 operator !=(const ExecutionContext &rhs) const;
427 //------------------------------------------------------------------
428 /// Construct with process, thread, and frame index.
430 /// Initialize with process \a p, thread \a t, and frame index \a f.
432 /// @param[in] process
433 /// The process for this execution context.
435 /// @param[in] thread
436 /// The thread for this execution context.
439 /// The frame index for this execution context.
440 //------------------------------------------------------------------
441 ExecutionContext (Process* process,
442 Thread *thread = NULL,
443 StackFrame * frame = NULL);
447 //------------------------------------------------------------------
448 /// Clear the object's state.
450 /// Sets the process and thread to NULL, and the frame index to an
452 //------------------------------------------------------------------
457 GetRegisterContext () const;
459 ExecutionContextScope *
460 GetBestExecutionContextScope () const;
463 GetAddressByteSize() const;
466 GetByteOrder() const;
468 //------------------------------------------------------------------
469 /// Returns a pointer to the target object.
471 /// The returned pointer might be NULL. Calling HasTargetScope(),
472 /// HasProcessScope(), HasThreadScope(), or HasFrameScope()
473 /// can help to pre-validate this pointer so that this accessor can
474 /// freely be used without having to check for NULL each time.
476 /// @see ExecutionContext::HasTargetScope() const
477 /// @see ExecutionContext::HasProcessScope() const
478 /// @see ExecutionContext::HasThreadScope() const
479 /// @see ExecutionContext::HasFrameScope() const
480 //------------------------------------------------------------------
482 GetTargetPtr () const;
484 //------------------------------------------------------------------
485 /// Returns a pointer to the process object.
487 /// The returned pointer might be NULL. Calling HasProcessScope(),
488 /// HasThreadScope(), or HasFrameScope() can help to pre-validate
489 /// this pointer so that this accessor can freely be used without
490 /// having to check for NULL each time.
492 /// @see ExecutionContext::HasProcessScope() const
493 /// @see ExecutionContext::HasThreadScope() const
494 /// @see ExecutionContext::HasFrameScope() const
495 //------------------------------------------------------------------
497 GetProcessPtr () const;
499 //------------------------------------------------------------------
500 /// Returns a pointer to the thread object.
502 /// The returned pointer might be NULL. Calling HasThreadScope() or
503 /// HasFrameScope() can help to pre-validate this pointer so that
504 /// this accessor can freely be used without having to check for
507 /// @see ExecutionContext::HasThreadScope() const
508 /// @see ExecutionContext::HasFrameScope() const
509 //------------------------------------------------------------------
511 GetThreadPtr () const
513 return m_thread_sp.get();
516 //------------------------------------------------------------------
517 /// Returns a pointer to the frame object.
519 /// The returned pointer might be NULL. Calling HasFrameScope(),
520 /// can help to pre-validate this pointer so that this accessor can
521 /// freely be used without having to check for NULL each time.
523 /// @see ExecutionContext::HasFrameScope() const
524 //------------------------------------------------------------------
528 return m_frame_sp.get();
531 //------------------------------------------------------------------
532 /// Returns a reference to the target object.
534 /// Clients should call HasTargetScope(), HasProcessScope(),
535 /// HasThreadScope(), or HasFrameScope() prior to calling this
536 /// function to ensure that this ExecutionContext object contains
539 /// @see ExecutionContext::HasTargetScope() const
540 /// @see ExecutionContext::HasProcessScope() const
541 /// @see ExecutionContext::HasThreadScope() const
542 /// @see ExecutionContext::HasFrameScope() const
543 //------------------------------------------------------------------
545 GetTargetRef () const;
547 //------------------------------------------------------------------
548 /// Returns a reference to the process object.
550 /// Clients should call HasProcessScope(), HasThreadScope(), or
551 /// HasFrameScope() prior to calling this function to ensure that
552 /// this ExecutionContext object contains a valid target.
554 /// @see ExecutionContext::HasProcessScope() const
555 /// @see ExecutionContext::HasThreadScope() const
556 /// @see ExecutionContext::HasFrameScope() const
557 //------------------------------------------------------------------
559 GetProcessRef () const;
561 //------------------------------------------------------------------
562 /// Returns a reference to the thread object.
564 /// Clients should call HasThreadScope(), or HasFrameScope() prior
565 /// to calling this function to ensure that this ExecutionContext
566 /// object contains a valid target.
568 /// @see ExecutionContext::HasThreadScope() const
569 /// @see ExecutionContext::HasFrameScope() const
570 //------------------------------------------------------------------
572 GetThreadRef () const;
574 //------------------------------------------------------------------
575 /// Returns a reference to the thread object.
577 /// Clients should call HasFrameScope() prior to calling this
578 /// function to ensure that this ExecutionContext object contains
581 /// @see ExecutionContext::HasFrameScope() const
582 //------------------------------------------------------------------
584 GetFrameRef () const;
586 //------------------------------------------------------------------
587 /// Get accessor to get the target shared pointer.
589 /// The returned shared pointer is not guaranteed to be valid.
590 //------------------------------------------------------------------
591 const lldb::TargetSP &
597 //------------------------------------------------------------------
598 /// Get accessor to get the process shared pointer.
600 /// The returned shared pointer is not guaranteed to be valid.
601 //------------------------------------------------------------------
602 const lldb::ProcessSP &
603 GetProcessSP () const
608 //------------------------------------------------------------------
609 /// Get accessor to get the thread shared pointer.
611 /// The returned shared pointer is not guaranteed to be valid.
612 //------------------------------------------------------------------
613 const lldb::ThreadSP &
619 //------------------------------------------------------------------
620 /// Get accessor to get the frame shared pointer.
622 /// The returned shared pointer is not guaranteed to be valid.
623 //------------------------------------------------------------------
624 const lldb::StackFrameSP &
630 //------------------------------------------------------------------
631 /// Set accessor to set only the target shared pointer.
632 //------------------------------------------------------------------
634 SetTargetSP (const lldb::TargetSP &target_sp);
636 //------------------------------------------------------------------
637 /// Set accessor to set only the process shared pointer.
638 //------------------------------------------------------------------
640 SetProcessSP (const lldb::ProcessSP &process_sp);
642 //------------------------------------------------------------------
643 /// Set accessor to set only the thread shared pointer.
644 //------------------------------------------------------------------
646 SetThreadSP (const lldb::ThreadSP &thread_sp);
648 //------------------------------------------------------------------
649 /// Set accessor to set only the frame shared pointer.
650 //------------------------------------------------------------------
652 SetFrameSP (const lldb::StackFrameSP &frame_sp);
654 //------------------------------------------------------------------
655 /// Set accessor to set only the target shared pointer from a target
657 //------------------------------------------------------------------
659 SetTargetPtr (Target* target);
661 //------------------------------------------------------------------
662 /// Set accessor to set only the process shared pointer from a
664 //------------------------------------------------------------------
666 SetProcessPtr (Process *process);
668 //------------------------------------------------------------------
669 /// Set accessor to set only the thread shared pointer from a thread
671 //------------------------------------------------------------------
673 SetThreadPtr (Thread *thread);
675 //------------------------------------------------------------------
676 /// Set accessor to set only the frame shared pointer from a frame
678 //------------------------------------------------------------------
680 SetFramePtr (StackFrame *frame);
682 //------------------------------------------------------------------
683 // Set the execution context using a target shared pointer.
685 // If "target_sp" is valid, sets the target context to match and
686 // if "get_process" is true, sets the process shared pointer if
687 // the target currently has a process.
688 //------------------------------------------------------------------
690 SetContext (const lldb::TargetSP &target_sp, bool get_process);
692 //------------------------------------------------------------------
693 // Set the execution context using a process shared pointer.
695 // If "process_sp" is valid, then set the process and target in this
696 // context. Thread and frame contexts will be cleared.
697 // If "process_sp" is not valid, all shared pointers are reset.
698 //------------------------------------------------------------------
700 SetContext (const lldb::ProcessSP &process_sp);
702 //------------------------------------------------------------------
703 // Set the execution context using a thread shared pointer.
705 // If "thread_sp" is valid, then set the thread, process and target
706 // in this context. The frame context will be cleared.
707 // If "thread_sp" is not valid, all shared pointers are reset.
708 //------------------------------------------------------------------
710 SetContext (const lldb::ThreadSP &thread_sp);
712 //------------------------------------------------------------------
713 // Set the execution context using a frame shared pointer.
715 // If "frame_sp" is valid, then set the frame, thread, process and
716 // target in this context
717 // If "frame_sp" is not valid, all shared pointers are reset.
718 //------------------------------------------------------------------
720 SetContext (const lldb::StackFrameSP &frame_sp);
722 //------------------------------------------------------------------
723 /// Returns true the ExecutionContext object contains a valid
726 /// This function can be called after initializing an ExecutionContext
727 /// object, and if it returns true, calls to GetTargetPtr() and
728 /// GetTargetRef() do not need to be checked for validity.
729 //------------------------------------------------------------------
731 HasTargetScope () const;
733 //------------------------------------------------------------------
734 /// Returns true the ExecutionContext object contains a valid
735 /// target and process.
737 /// This function can be called after initializing an ExecutionContext
738 /// object, and if it returns true, calls to GetTargetPtr() and
739 /// GetTargetRef(), GetProcessPtr(), and GetProcessRef(), do not
740 /// need to be checked for validity.
741 //------------------------------------------------------------------
743 HasProcessScope () const;
745 //------------------------------------------------------------------
746 /// Returns true the ExecutionContext object contains a valid
747 /// target, process, and thread.
749 /// This function can be called after initializing an ExecutionContext
750 /// object, and if it returns true, calls to GetTargetPtr(),
751 /// GetTargetRef(), GetProcessPtr(), GetProcessRef(), GetThreadPtr(),
752 /// and GetThreadRef() do not need to be checked for validity.
753 //------------------------------------------------------------------
755 HasThreadScope () const;
757 //------------------------------------------------------------------
758 /// Returns true the ExecutionContext object contains a valid
759 /// target, process, thread and frame.
761 /// This function can be called after initializing an ExecutionContext
762 /// object, and if it returns true, calls to GetTargetPtr(),
763 /// GetTargetRef(), GetProcessPtr(), GetProcessRef(), GetThreadPtr(),
764 /// GetThreadRef(), GetFramePtr(), and GetFrameRef() do not need
765 /// to be checked for validity.
766 //------------------------------------------------------------------
768 HasFrameScope () const;
771 //------------------------------------------------------------------
773 //------------------------------------------------------------------
774 lldb::TargetSP m_target_sp; ///< The target that owns the process/thread/frame
775 lldb::ProcessSP m_process_sp; ///< The process that owns the thread/frame
776 lldb::ThreadSP m_thread_sp; ///< The thread that owns the frame
777 lldb::StackFrameSP m_frame_sp; ///< The stack frame in thread.
779 } // namespace lldb_private
781 #endif // liblldb_ExecutionContext_h_