LLDB mainline
InstrumentationRuntimeUBSan.h
Go to the documentation of this file.
1//===-- InstrumentationRuntimeUBSan.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_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UBSAN_INSTRUMENTATIONRUNTIMEUBSAN_H
10#define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UBSAN_INSTRUMENTATIONRUNTIMEUBSAN_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() {
32 return "UndefinedBehaviorSanitizer";
33 }
34
36
37 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
38
40
43
44private:
46 : lldb_private::InstrumentationRuntime(process_sp) {}
47
49
50 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;
51
52 void Activate() override;
53
54 void Deactivate();
55
56 static bool NotifyBreakpointHit(void *baton,
58 lldb::user_id_t break_id,
59 lldb::user_id_t break_loc_id);
60
62};
63
64} // namespace lldb_private
65
66#endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UBSAN_INSTRUMENTATIONRUNTIMEUBSAN_H
Execution context objects refer to objects in the execution of the program that is being debugged.
InstrumentationRuntimeUBSan(const lldb::ProcessSP &process_sp)
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
static lldb::InstrumentationRuntimeType GetTypeStatic()
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.
StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref)
lldb::ThreadCollectionSP GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
virtual lldb::InstrumentationRuntimeType GetType()
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:381
InstrumentationRuntimeType
uint64_t user_id_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::InstrumentationRuntime > InstrumentationRuntimeSP
Definition: lldb-forward.h:352
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:365
std::shared_ptr< lldb_private::ThreadCollection > ThreadCollectionSP
Definition: lldb-forward.h:440