1254721Semaste//===-- ExecutionContextScope.h ---------------------------------*- C++ -*-===//
2254721Semaste//
3254721Semaste//                     The LLVM Compiler Infrastructure
4254721Semaste//
5254721Semaste// This file is distributed under the University of Illinois Open Source
6254721Semaste// License. See LICENSE.TXT for details.
7254721Semaste//
8254721Semaste//===----------------------------------------------------------------------===//
9254721Semaste
10254721Semaste#ifndef liblldb_ExecutionContextScope_h_
11254721Semaste#define liblldb_ExecutionContextScope_h_
12254721Semaste
13254721Semaste// C Includes
14254721Semaste// C++ Includes
15254721Semaste// Other libraries and framework includes
16254721Semaste// Project includes
17254721Semaste#include "lldb/lldb-private.h"
18254721Semaste
19254721Semastenamespace lldb_private {
20254721Semaste
21254721Semaste//----------------------------------------------------------------------
22254721Semaste/// @class ExecutionContextScope ExecutionContextScope.h "lldb/Symbol/ExecutionContextScope.h"
23254721Semaste/// @brief Inherit from this if your object can reconstruct its
24254721Semaste///        execution context.
25254721Semaste///
26254721Semaste/// Many objects that have pointers back to parent execution context
27254721Semaste/// objects can inherit from this pure virtual class can reconstruct
28254721Semaste/// their execution context without having to keep a complete
29254721Semaste/// ExecutionContext object in the object state. Examples of these
30254721Semaste/// objects include: Process, Thread, RegisterContext and StackFrame.
31254721Semaste///
32254721Semaste/// Bbjects can contain a valid pointer to an instance of this so they
33254721Semaste/// can reconstruct the execution context.
34254721Semaste///
35254721Semaste/// Objects that adhere to this protocol can reconstruct enough of a
36254721Semaste/// execution context to allow functions that take a execution contexts
37254721Semaste/// to be called.
38254721Semaste//----------------------------------------------------------------------
39254721Semasteclass ExecutionContextScope
40254721Semaste{
41254721Semastepublic:
42254721Semaste    virtual
43254721Semaste    ~ExecutionContextScope () {}
44254721Semaste
45254721Semaste    virtual lldb::TargetSP
46254721Semaste    CalculateTarget () = 0;
47254721Semaste
48254721Semaste    virtual lldb::ProcessSP
49254721Semaste    CalculateProcess () = 0;
50254721Semaste
51254721Semaste    virtual lldb::ThreadSP
52254721Semaste    CalculateThread () = 0;
53254721Semaste
54254721Semaste    virtual lldb::StackFrameSP
55254721Semaste    CalculateStackFrame () = 0;
56254721Semaste
57254721Semaste    //------------------------------------------------------------------
58254721Semaste    /// Reconstruct the object's execution context into \a sc.
59254721Semaste    ///
60254721Semaste    /// The object should fill in as much of the ExecutionContextScope as it
61254721Semaste    /// can so function calls that require a execution context can be made
62254721Semaste    /// for the given object.
63254721Semaste    ///
64254721Semaste    /// @param[out] exe_ctx
65254721Semaste    ///     A reference to an execution context object that gets filled
66254721Semaste    ///     in.
67254721Semaste    //------------------------------------------------------------------
68254721Semaste    virtual void
69254721Semaste    CalculateExecutionContext (ExecutionContext &exe_ctx) = 0;
70254721Semaste};
71254721Semaste
72254721Semaste} // namespace lldb_private
73254721Semaste
74254721Semaste#endif  // liblldb_ExecutionContextScope_h_
75