LLDB  mainline
ExecutionContextScope.h
Go to the documentation of this file.
1 //===-- ExecutionContextScope.h ---------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_TARGET_EXECUTIONCONTEXTSCOPE_H
10 #define LLDB_TARGET_EXECUTIONCONTEXTSCOPE_H
11 
12 #include "lldb/lldb-private.h"
13 
14 namespace lldb_private {
15 
16 /// @class ExecutionContextScope ExecutionContextScope.h
17 /// "lldb/Target/ExecutionContextScope.h" Inherit from this if your object can
18 /// reconstruct its
19 /// execution context.
20 ///
21 /// Many objects that have pointers back to parent execution context objects
22 /// can inherit from this pure virtual class can reconstruct their execution
23 /// context without having to keep a complete ExecutionContext object in the
24 /// object state. Examples of these objects include: Process, Thread,
25 /// RegisterContext and StackFrame.
26 ///
27 /// Objects can contain a valid pointer to an instance of this so they can
28 /// reconstruct the execution context.
29 ///
30 /// Objects that adhere to this protocol can reconstruct enough of a execution
31 /// context to allow functions that take a execution contexts to be called.
33 public:
34  virtual ~ExecutionContextScope() = default;
35 
36  virtual lldb::TargetSP CalculateTarget() = 0;
37 
38  virtual lldb::ProcessSP CalculateProcess() = 0;
39 
40  virtual lldb::ThreadSP CalculateThread() = 0;
41 
42  virtual lldb::StackFrameSP CalculateStackFrame() = 0;
43 
44  /// Reconstruct the object's execution context into \a sc.
45  ///
46  /// The object should fill in as much of the ExecutionContextScope as it can
47  /// so function calls that require a execution context can be made for the
48  /// given object.
49  ///
50  /// \param[out] exe_ctx
51  /// A reference to an execution context object that gets filled
52  /// in.
53  virtual void CalculateExecutionContext(ExecutionContext &exe_ctx) = 0;
54 };
55 
56 } // namespace lldb_private
57 
58 #endif // LLDB_TARGET_EXECUTIONCONTEXTSCOPE_H
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::ExecutionContextScope::CalculateStackFrame
virtual lldb::StackFrameSP CalculateStackFrame()=0
lldb_private::ExecutionContextScope
Definition: ExecutionContextScope.h:32
lldb-private.h
lldb_private::ExecutionContextScope::CalculateThread
virtual lldb::ThreadSP CalculateThread()=0
lldb_private::ExecutionContextScope::CalculateProcess
virtual lldb::ProcessSP CalculateProcess()=0
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ExecutionContextScope::CalculateTarget
virtual lldb::TargetSP CalculateTarget()=0
lldb_private::ExecutionContextScope::CalculateExecutionContext
virtual void CalculateExecutionContext(ExecutionContext &exe_ctx)=0
Reconstruct the object's execution context into sc.
lldb_private::ExecutionContextScope::~ExecutionContextScope
virtual ~ExecutionContextScope()=default