1 //===-- ExecutionContextScope.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 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ExecutionContextScope_h_
11 #define liblldb_ExecutionContextScope_h_
15 // Other libraries and framework includes
17 #include "lldb/lldb-private.h"
19 namespace lldb_private {
21 //----------------------------------------------------------------------
22 /// @class ExecutionContextScope ExecutionContextScope.h
23 /// "lldb/Symbol/ExecutionContextScope.h" Inherit from this if your object can
25 /// execution context.
27 /// Many objects that have pointers back to parent execution context objects
28 /// can inherit from this pure virtual class can reconstruct their execution
29 /// context without having to keep a complete ExecutionContext object in the
30 /// object state. Examples of these objects include: Process, Thread,
31 /// RegisterContext and StackFrame.
33 /// Objects can contain a valid pointer to an instance of this so they can
34 /// reconstruct the execution context.
36 /// Objects that adhere to this protocol can reconstruct enough of a execution
37 /// context to allow functions that take a execution contexts to be called.
38 //----------------------------------------------------------------------
39 class ExecutionContextScope {
41 virtual ~ExecutionContextScope() {}
43 virtual lldb::TargetSP CalculateTarget() = 0;
45 virtual lldb::ProcessSP CalculateProcess() = 0;
47 virtual lldb::ThreadSP CalculateThread() = 0;
49 virtual lldb::StackFrameSP CalculateStackFrame() = 0;
51 //------------------------------------------------------------------
52 /// Reconstruct the object's execution context into \a sc.
54 /// The object should fill in as much of the ExecutionContextScope as it can
55 /// so function calls that require a execution context can be made for the
58 /// @param[out] exe_ctx
59 /// A reference to an execution context object that gets filled
61 //------------------------------------------------------------------
62 virtual void CalculateExecutionContext(ExecutionContext &exe_ctx) = 0;
65 } // namespace lldb_private
67 #endif // liblldb_ExecutionContextScope_h_