diff options
Diffstat (limited to 'include/lldb/Target/ExecutionContext.h')
-rw-r--r-- | include/lldb/Target/ExecutionContext.h | 111 |
1 files changed, 59 insertions, 52 deletions
diff --git a/include/lldb/Target/ExecutionContext.h b/include/lldb/Target/ExecutionContext.h index 50f2beaf949b..cdf55e3b744c 100644 --- a/include/lldb/Target/ExecutionContext.h +++ b/include/lldb/Target/ExecutionContext.h @@ -6,6 +6,21 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// + +#ifndef liblldb_ExecutionContext_h_ +#define liblldb_ExecutionContext_h_ + +// C Includes +// C++ Includes +// Other libraries and framework includes +// Project includes +#include "lldb/lldb-private.h" +#include "lldb/Target/StackID.h" +#include "lldb/Host/Mutex.h" + +namespace lldb_private { + +//===----------------------------------------------------------------------===// /// Execution context objects refer to objects in the execution of the /// program that is being debugged. The consist of one or more of the /// following objects: target, process, thread, and frame. Many objects @@ -30,17 +45,6 @@ /// to a wide variety of functions that require execution contexts. //===----------------------------------------------------------------------===// - - -#ifndef liblldb_ExecutionContext_h_ -#define liblldb_ExecutionContext_h_ - -#include "lldb/lldb-private.h" -#include "lldb/Target/StackID.h" -#include "lldb/Host/Mutex.h" - -namespace lldb_private { - //---------------------------------------------------------------------- /// @class ExecutionContextRef ExecutionContext.h "lldb/Target/ExecutionContext.h" /// @brief A class that holds a weak reference to an execution context. @@ -86,7 +90,7 @@ public: ExecutionContextRef (const ExecutionContextRef &rhs); //------------------------------------------------------------------ - /// Construct using an ExecutionContext object that might be NULL. + /// Construct using an ExecutionContext object that might be nullptr. /// /// If \a exe_ctx_ptr is valid, then make weak references to any /// valid objects in the ExecutionContext, otherwise no weak @@ -102,22 +106,6 @@ public: ExecutionContextRef (const ExecutionContext &exe_ctx); //------------------------------------------------------------------ - /// Assignment operator - /// - /// Copy all weak references in \a rhs. - //------------------------------------------------------------------ - ExecutionContextRef & - operator =(const ExecutionContextRef &rhs); - - //------------------------------------------------------------------ - /// Assignment operator from a ExecutionContext - /// - /// Make weak references to any strongly referenced objects in \a exe_ctx. - //------------------------------------------------------------------ - ExecutionContextRef & - operator =(const ExecutionContext &exe_ctx); - - //------------------------------------------------------------------ /// Construct using the target and all the selected items inside of it /// (the process and its selected thread, and the thread's selected /// frame). If there is no selected thread, default to the first thread @@ -154,10 +142,27 @@ public: ExecutionContextRef (ExecutionContextScope &exe_scope); ~ExecutionContextRef(); + + //------------------------------------------------------------------ + /// Assignment operator + /// + /// Copy all weak references in \a rhs. + //------------------------------------------------------------------ + ExecutionContextRef & + operator =(const ExecutionContextRef &rhs); + + //------------------------------------------------------------------ + /// Assignment operator from a ExecutionContext + /// + /// Make weak references to any strongly referenced objects in \a exe_ctx. + //------------------------------------------------------------------ + ExecutionContextRef & + operator =(const ExecutionContext &exe_ctx); + //------------------------------------------------------------------ /// Clear the object's state. /// - /// Sets the process and thread to NULL, and the frame index to an + /// Sets the process and thread to nullptr, and the frame index to an /// invalid value. //------------------------------------------------------------------ void @@ -394,6 +399,7 @@ public: ExecutionContext (const lldb::ProcessSP &process_sp); ExecutionContext (const lldb::ThreadSP &thread_sp); ExecutionContext (const lldb::StackFrameSP &frame_sp); + //------------------------------------------------------------------ // Create execution contexts from weak pointers //------------------------------------------------------------------ @@ -413,16 +419,6 @@ public: //------------------------------------------------------------------ ExecutionContext (ExecutionContextScope *exe_scope); ExecutionContext (ExecutionContextScope &exe_scope); - - - ExecutionContext & - operator =(const ExecutionContext &rhs); - - bool - operator ==(const ExecutionContext &rhs) const; - - bool - operator !=(const ExecutionContext &rhs) const; //------------------------------------------------------------------ /// Construct with process, thread, and frame index. @@ -438,16 +434,26 @@ public: /// @param[in] frame /// The frame index for this execution context. //------------------------------------------------------------------ - ExecutionContext (Process* process, - Thread *thread = NULL, - StackFrame * frame = NULL); + ExecutionContext(Process* process, + Thread *thread = nullptr, + StackFrame * frame = nullptr); ~ExecutionContext(); + + ExecutionContext & + operator =(const ExecutionContext &rhs); + + bool + operator ==(const ExecutionContext &rhs) const; + + bool + operator !=(const ExecutionContext &rhs) const; + //------------------------------------------------------------------ /// Clear the object's state. /// - /// Sets the process and thread to NULL, and the frame index to an + /// Sets the process and thread to nullptr, and the frame index to an /// invalid value. //------------------------------------------------------------------ void @@ -468,10 +474,10 @@ public: //------------------------------------------------------------------ /// Returns a pointer to the target object. /// - /// The returned pointer might be NULL. Calling HasTargetScope(), + /// The returned pointer might be nullptr. Calling HasTargetScope(), /// HasProcessScope(), HasThreadScope(), or HasFrameScope() /// can help to pre-validate this pointer so that this accessor can - /// freely be used without having to check for NULL each time. + /// freely be used without having to check for nullptr each time. /// /// @see ExecutionContext::HasTargetScope() const /// @see ExecutionContext::HasProcessScope() const @@ -484,10 +490,10 @@ public: //------------------------------------------------------------------ /// Returns a pointer to the process object. /// - /// The returned pointer might be NULL. Calling HasProcessScope(), + /// The returned pointer might be nullptr. Calling HasProcessScope(), /// HasThreadScope(), or HasFrameScope() can help to pre-validate /// this pointer so that this accessor can freely be used without - /// having to check for NULL each time. + /// having to check for nullptr each time. /// /// @see ExecutionContext::HasProcessScope() const /// @see ExecutionContext::HasThreadScope() const @@ -499,10 +505,10 @@ public: //------------------------------------------------------------------ /// Returns a pointer to the thread object. /// - /// The returned pointer might be NULL. Calling HasThreadScope() or + /// The returned pointer might be nullptr. Calling HasThreadScope() or /// HasFrameScope() can help to pre-validate this pointer so that /// this accessor can freely be used without having to check for - /// NULL each time. + /// nullptr each time. /// /// @see ExecutionContext::HasThreadScope() const /// @see ExecutionContext::HasFrameScope() const @@ -516,9 +522,9 @@ public: //------------------------------------------------------------------ /// Returns a pointer to the frame object. /// - /// The returned pointer might be NULL. Calling HasFrameScope(), + /// The returned pointer might be nullptr. Calling HasFrameScope(), /// can help to pre-validate this pointer so that this accessor can - /// freely be used without having to check for NULL each time. + /// freely be used without having to check for nullptr each time. /// /// @see ExecutionContext::HasFrameScope() const //------------------------------------------------------------------ @@ -776,6 +782,7 @@ protected: lldb::ThreadSP m_thread_sp; ///< The thread that owns the frame lldb::StackFrameSP m_frame_sp; ///< The stack frame in thread. }; + } // namespace lldb_private -#endif // liblldb_ExecutionContext_h_ +#endif // liblldb_ExecutionContext_h_ |