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 
17 namespace lldb_private {
18 
21 public:
23 
24  static lldb::InstrumentationRuntimeSP
25  CreateInstance(const lldb::ProcessSP &process_sp);
26 
27  static void Initialize();
28 
29  static void Terminate();
30 
32 
34 
35  llvm::StringRef GetPluginName() override {
37  }
38 
40 
41  lldb::ThreadCollectionSP
43 
44 private:
45  InstrumentationRuntimeUBSan(const lldb::ProcessSP &process_sp)
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,
57  StoppointCallbackContext *context,
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
lldb_private::InstrumentationRuntimeUBSan::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: InstrumentationRuntimeUBSan.cpp:59
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::StoppointCallbackContext
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
Definition: StoppointCallbackContext.h:26
lldb_private::InstrumentationRuntimeUBSan::~InstrumentationRuntimeUBSan
~InstrumentationRuntimeUBSan() override
Definition: InstrumentationRuntimeUBSan.cpp:41
lldb_private::InstrumentationRuntimeUBSan::Activate
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
Definition: InstrumentationRuntimeUBSan.cpp:249
StructuredData.h
InstrumentationRuntime.h
lldb_private::InstrumentationRuntimeUBSan::CheckIfRuntimeIsValid
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
Definition: InstrumentationRuntimeUBSan.cpp:240
lldb_private::InstrumentationRuntime
Definition: InstrumentationRuntime.h:27
lldb_private::InstrumentationRuntimeUBSan::Deactivate
void Deactivate()
Definition: InstrumentationRuntimeUBSan.cpp:288
ABI.h
lldb_private::InstrumentationRuntimeUBSan
Definition: InstrumentationRuntimeUBSan.h:19
lldb_private::ConstString::GetStringRef
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:202
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::InstrumentationRuntimeUBSan::GetPluginName
llvm::StringRef GetPluginName() override
Definition: InstrumentationRuntimeUBSan.h:35
lldb_private::InstrumentationRuntimeUBSan::GetBacktracesFromExtendedStopInfo
lldb::ThreadCollectionSP GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override
Definition: InstrumentationRuntimeUBSan.cpp:302
lldb_private::InstrumentationRuntimeUBSan::RetrieveReportData
StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref)
Definition: InstrumentationRuntimeUBSan.cpp:109
lldb-private.h
lldb_private::InstrumentationRuntimeUBSan::Terminate
static void Terminate()
Definition: InstrumentationRuntimeUBSan.cpp:55
lldb_private::InstrumentationRuntimeUBSan::GetType
virtual lldb::InstrumentationRuntimeType GetType()
Definition: InstrumentationRuntimeUBSan.h:39
lldb_private::InstrumentationRuntimeUBSan::NotifyBreakpointHit
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Definition: InstrumentationRuntimeUBSan.cpp:202
lldb_private::InstrumentationRuntimeUBSan::InstrumentationRuntimeUBSan
InstrumentationRuntimeUBSan(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeUBSan.h:45
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::InstrumentationRuntimeUBSan::GetTypeStatic
static lldb::InstrumentationRuntimeType GetTypeStatic()
Definition: InstrumentationRuntimeUBSan.cpp:63
lldb_private::InstrumentationRuntimeUBSan::GetPatternForRuntimeLibrary
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
Definition: InstrumentationRuntimeUBSan.cpp:235
lldb_private::InstrumentationRuntimeUBSan::Initialize
static void Initialize()
Definition: InstrumentationRuntimeUBSan.cpp:48
lldb_private::InstrumentationRuntimeUBSan::CreateInstance
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeUBSan.cpp:44
lldb_private::ExecutionContextRef
Execution context objects refer to objects in the execution of the program that is being debugged.
Definition: ExecutionContext.h:72
lldb::InstrumentationRuntimeType
InstrumentationRuntimeType
Definition: lldb-enumerations.h:485