ExecutionContext.h revision fa3a16a2ea380ef38388ebe323817bd1b32c20cd
1//===-- ExecutionContext.h --------------------------------------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10 11#ifndef liblldb_ExecutionContext_h_ 12#define liblldb_ExecutionContext_h_ 13 14#include "lldb/lldb-private.h" 15 16namespace lldb_private { 17 18//---------------------------------------------------------------------- 19/// @class ExecutionContext ExecutionContext.h "lldb/Target/ExecutionContext.h" 20/// @brief A class that contains an execution context. 21/// 22/// This baton object can be passed into any function that requires 23/// a context that specifies a process, thread and frame. 24/// 25/// Many lldb functions can evaluate or act upon a specific 26/// execution context. An expression could be evaluated for a specific 27/// process, thread, and frame. The thread object contains frames and 28/// can return StackFrame objects given a valid frame index using: 29/// StackFrame * Thread::GetFrameAtIndex (uint32_t idx). 30//---------------------------------------------------------------------- 31class ExecutionContext 32{ 33public: 34 //------------------------------------------------------------------ 35 /// Default Constructor. 36 /// 37 /// Initialize with NULL process and thread, and invalid frame 38 /// index. 39 //------------------------------------------------------------------ 40 ExecutionContext(); 41 42 43 ExecutionContext (Target* t, bool fill_current_process_thread_frame = true); 44 //------------------------------------------------------------------ 45 /// Construct with process, thread, and frame index. 46 /// 47 /// Initialize with process \a p, thread \a t, and frame index \a f. 48 /// 49 /// @param[in] process 50 /// The process for this execution context. 51 /// 52 /// @param[in] thread 53 /// The thread for this execution context. 54 /// 55 /// @param[in] frame 56 /// The frame index for this execution context. 57 //------------------------------------------------------------------ 58 ExecutionContext (Process* process, 59 Thread *thread = NULL, 60 StackFrame * frame = NULL); 61 62 63 ExecutionContext (ExecutionContextScope *exe_scope); 64 65 ExecutionContext (ExecutionContextScope &exe_scope); 66 67 //------------------------------------------------------------------ 68 /// Clear the object's state. 69 /// 70 /// Sets the process and thread to NULL, and the frame index to an 71 /// invalid value. 72 //------------------------------------------------------------------ 73 void 74 Clear (); 75 76 RegisterContext * 77 GetRegisterContext () const; 78 79 80 ExecutionContextScope * 81 GetBestExecutionContextScope () const; 82 83 //------------------------------------------------------------------ 84 // Member variables 85 //------------------------------------------------------------------ 86 Target *target; ///< The target that owns the process/thread/frame 87 Process *process; ///< The process that owns the thread/frame 88 Thread *thread; ///< The thread that owns the frame 89 StackFrame *frame; ///< The stack frame in thread. 90}; 91 92} // namespace lldb_private 93 94#endif // liblldb_ExecutionContext_h_ 95