LLDB mainline
InstrumentationRuntimeBoundsSafety.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_BOUNDS_SAFETY_SOFT_TRAP_H
10#define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_BOUNDS_SAFETY_SOFT_TRAP_H
11
12#include "lldb/Target/ABI.h"
15#include "lldb/lldb-private.h"
16
17namespace lldb_private {
18
21public:
23
25 CreateInstance(const lldb::ProcessSP &process_sp);
26
27 static void Initialize();
28
29 static void Terminate();
30
31 static llvm::StringRef GetPluginNameStatic() { return "BoundsSafety"; }
32
34
35 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
36
38
39private:
42
44
45 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;
46
47 void Activate() override;
48
49 void Deactivate();
50
51 static bool NotifyBreakpointHit(void *baton,
53 lldb::user_id_t break_id,
54 lldb::user_id_t break_loc_id);
55
56 bool MatchAllModules() override { return true; }
57};
58
59} // namespace lldb_private
60
61#endif
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
InstrumentationRuntime(const lldb::ProcessSP &process_sp)
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Process > ProcessSP
InstrumentationRuntimeType
uint64_t user_id_t
Definition lldb-types.h:82
std::shared_ptr< lldb_private::InstrumentationRuntime > InstrumentationRuntimeSP
std::shared_ptr< lldb_private::Module > ModuleSP