Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:53

0001 //===-- ExecutionContextScope.h ---------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_TARGET_EXECUTIONCONTEXTSCOPE_H
0010 #define LLDB_TARGET_EXECUTIONCONTEXTSCOPE_H
0011 
0012 #include "lldb/lldb-private.h"
0013 
0014 namespace lldb_private {
0015 
0016 /// @class ExecutionContextScope ExecutionContextScope.h
0017 /// "lldb/Target/ExecutionContextScope.h" Inherit from this if your object can
0018 /// reconstruct its
0019 ///        execution context.
0020 ///
0021 /// Many objects that have pointers back to parent execution context objects
0022 /// can inherit from this pure virtual class can reconstruct their execution
0023 /// context without having to keep a complete ExecutionContext object in the
0024 /// object state. Examples of these objects include: Process, Thread,
0025 /// RegisterContext and StackFrame.
0026 ///
0027 /// Objects can contain a valid pointer to an instance of this so they can
0028 /// reconstruct the execution context.
0029 ///
0030 /// Objects that adhere to this protocol can reconstruct enough of a execution
0031 /// context to allow functions that take a execution contexts to be called.
0032 class ExecutionContextScope {
0033 public:
0034   virtual ~ExecutionContextScope() = default;
0035 
0036   virtual lldb::TargetSP CalculateTarget() = 0;
0037 
0038   virtual lldb::ProcessSP CalculateProcess() = 0;
0039 
0040   virtual lldb::ThreadSP CalculateThread() = 0;
0041 
0042   virtual lldb::StackFrameSP CalculateStackFrame() = 0;
0043 
0044   /// Reconstruct the object's execution context into \a sc.
0045   ///
0046   /// The object should fill in as much of the ExecutionContextScope as it can
0047   /// so function calls that require a execution context can be made for the
0048   /// given object.
0049   ///
0050   /// \param[out] exe_ctx
0051   ///     A reference to an execution context object that gets filled
0052   ///     in.
0053   virtual void CalculateExecutionContext(ExecutionContext &exe_ctx) = 0;
0054 };
0055 
0056 } // namespace lldb_private
0057 
0058 #endif // LLDB_TARGET_EXECUTIONCONTEXTSCOPE_H