LLDB  mainline
DynamicCheckerFunctions.h
Go to the documentation of this file.
1 //===-- DynamicCheckerFunctions.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_EXPRESSION_DYNAMICCHECKERFUNCTIONS_H
10 #define LLDB_EXPRESSION_DYNAMICCHECKERFUNCTIONS_H
11 
12 #include "lldb/lldb-types.h"
13 
14 namespace lldb_private {
15 
16 class DiagnosticManager;
17 class ExecutionContext;
18 
19 /// Encapsulates dynamic check functions used by expressions.
20 ///
21 /// Each of the utility functions encapsulated in this class is responsible
22 /// for validating some data that an expression is about to use. Examples
23 /// are:
24 ///
25 /// a = *b; // check that b is a valid pointer
26 /// [b init]; // check that b is a valid object to send "init" to
27 ///
28 /// The class installs each checker function into the target process and makes
29 /// it available to IRDynamicChecks to use.
31 public:
34  };
35 
37  virtual ~DynamicCheckerFunctions() = default;
38 
39  /// Install the utility functions into a process. This binds the instance
40  /// of DynamicCheckerFunctions to that process.
41  ///
42  /// \param[in] diagnostic_manager
43  /// A diagnostic manager to report errors to.
44  ///
45  /// \param[in] exe_ctx
46  /// The execution context to install the functions into.
47  ///
48  /// \return
49  /// True on success; false on failure, or if the functions have
50  /// already been installed.
51  virtual bool Install(DiagnosticManager &diagnostic_manager,
52  ExecutionContext &exe_ctx) = 0;
53  virtual bool DoCheckersExplainStop(lldb::addr_t addr, Stream &message) = 0;
54 
56 
57 private:
59 };
60 } // namespace lldb_private
61 
62 #endif // LLDB_EXPRESSION_DYNAMICCHECKERFUNCTIONS_H
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::DynamicCheckerFunctions::m_kind
const DynamicCheckerFunctionsKind m_kind
Definition: DynamicCheckerFunctions.h:58
lldb_private::DynamicCheckerFunctions::DCF_Clang
@ DCF_Clang
Definition: DynamicCheckerFunctions.h:33
lldb_private::DynamicCheckerFunctions::DynamicCheckerFunctions
DynamicCheckerFunctions(DynamicCheckerFunctionsKind kind)
Definition: DynamicCheckerFunctions.h:36
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::DynamicCheckerFunctions::Install
virtual bool Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx)=0
Install the utility functions into a process.
lldb_private::DynamicCheckerFunctions::DynamicCheckerFunctionsKind
DynamicCheckerFunctionsKind
Definition: DynamicCheckerFunctions.h:32
lldb_private::DynamicCheckerFunctions::~DynamicCheckerFunctions
virtual ~DynamicCheckerFunctions()=default
lldb_private::DynamicCheckerFunctions::GetKind
DynamicCheckerFunctionsKind GetKind() const
Definition: DynamicCheckerFunctions.h:55
lldb-types.h
lldb_private::DynamicCheckerFunctions::DoCheckersExplainStop
virtual bool DoCheckersExplainStop(lldb::addr_t addr, Stream &message)=0
message
message(FATAL_ERROR "invalid libipt include path provided") endif() include_directories($
Definition: Plugins/Trace/intel-pt/CMakeLists.txt:6
lldb_private::DiagnosticManager
Definition: DiagnosticManager.h:93
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::DynamicCheckerFunctions
Encapsulates dynamic check functions used by expressions.
Definition: DynamicCheckerFunctions.h:30