LLDB
mainline
llvm-project
lldb
include
lldb
Expression
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
#include "llvm/Support/Error.h"
15
16
namespace
lldb_private
{
17
18
class
DiagnosticManager;
19
class
ExecutionContext;
20
21
/// Encapsulates dynamic check functions used by expressions.
22
///
23
/// Each of the utility functions encapsulated in this class is responsible
24
/// for validating some data that an expression is about to use. Examples
25
/// are:
26
///
27
/// a = *b; // check that b is a valid pointer
28
/// [b init]; // check that b is a valid object to send "init" to
29
///
30
/// The class installs each checker function into the target process and makes
31
/// it available to IRDynamicChecks to use.
32
class
DynamicCheckerFunctions
{
33
public
:
34
enum
DynamicCheckerFunctionsKind
{
35
DCF_Clang
,
36
};
37
38
DynamicCheckerFunctions
(
DynamicCheckerFunctionsKind
kind) :
m_kind
(kind) {}
39
virtual
~DynamicCheckerFunctions
() =
default
;
40
41
/// Install the utility functions into a process. This binds the instance
42
/// of DynamicCheckerFunctions to that process.
43
///
44
/// \param[in] diagnostic_manager
45
/// A diagnostic manager to report errors to.
46
///
47
/// \param[in] exe_ctx
48
/// The execution context to install the functions into.
49
///
50
/// \return
51
/// Either llvm::ErrorSuccess or Error with llvm::ErrorInfo
52
///
53
virtual
llvm::Error
Install
(
DiagnosticManager
&diagnostic_manager,
54
ExecutionContext
&exe_ctx) = 0;
55
virtual
bool
DoCheckersExplainStop
(
lldb::addr_t
addr,
Stream
&message) = 0;
56
57
DynamicCheckerFunctionsKind
GetKind
()
const
{
return
m_kind
; }
58
59
private
:
60
const
DynamicCheckerFunctionsKind
m_kind
;
61
};
62
}
// namespace lldb_private
63
64
#endif
// LLDB_EXPRESSION_DYNAMICCHECKERFUNCTIONS_H
lldb_private::DiagnosticManager
Definition:
DiagnosticManager.h:103
lldb_private::DynamicCheckerFunctions
Encapsulates dynamic check functions used by expressions.
Definition:
DynamicCheckerFunctions.h:32
lldb_private::DynamicCheckerFunctions::GetKind
DynamicCheckerFunctionsKind GetKind() const
Definition:
DynamicCheckerFunctions.h:57
lldb_private::DynamicCheckerFunctions::~DynamicCheckerFunctions
virtual ~DynamicCheckerFunctions()=default
lldb_private::DynamicCheckerFunctions::Install
virtual llvm::Error Install(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx)=0
Install the utility functions into a process.
lldb_private::DynamicCheckerFunctions::m_kind
const DynamicCheckerFunctionsKind m_kind
Definition:
DynamicCheckerFunctions.h:60
lldb_private::DynamicCheckerFunctions::DoCheckersExplainStop
virtual bool DoCheckersExplainStop(lldb::addr_t addr, Stream &message)=0
lldb_private::DynamicCheckerFunctions::DynamicCheckerFunctionsKind
DynamicCheckerFunctionsKind
Definition:
DynamicCheckerFunctions.h:34
lldb_private::DynamicCheckerFunctions::DCF_Clang
@ DCF_Clang
Definition:
DynamicCheckerFunctions.h:35
lldb_private::DynamicCheckerFunctions::DynamicCheckerFunctions
DynamicCheckerFunctions(DynamicCheckerFunctionsKind kind)
Definition:
DynamicCheckerFunctions.h:38
lldb_private::ExecutionContext
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
Definition:
ExecutionContext.h:292
lldb_private::Stream
A stream class that can stream formatted output to a file.
Definition:
Stream.h:28
lldb-types.h
lldb_private
A class that represents a running process on the host machine.
Definition:
SBAddressRange.h:14
lldb::addr_t
uint64_t addr_t
Definition:
lldb-types.h:80
Generated on Wed Jan 29 2025 20:46:32 for LLDB by
1.9.6