LLDB  mainline
InstrumentationRuntimeASan.h
Go to the documentation of this file.
1 //===-- InstrumentationRuntimeASan.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_ASAN_INSTRUMENTATIONRUNTIMEASAN_H
10 #define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H
11 
13 #include "lldb/Target/Process.h"
15 #include "lldb/lldb-private.h"
16 
17 namespace lldb_private {
18 
20 public:
21  ~InstrumentationRuntimeASan() override;
22 
23  static lldb::InstrumentationRuntimeSP
24  CreateInstance(const lldb::ProcessSP &process_sp);
25 
26  static void Initialize();
27 
28  static void Terminate();
29 
31 
33 
34  llvm::StringRef GetPluginName() override {
36  }
37 
39 
40 private:
41  InstrumentationRuntimeASan(const lldb::ProcessSP &process_sp)
42  : lldb_private::InstrumentationRuntime(process_sp) {}
43 
45 
46  bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;
47 
48  void Activate() override;
49 
50  void Deactivate();
51 
52  static bool NotifyBreakpointHit(void *baton,
53  StoppointCallbackContext *context,
54  lldb::user_id_t break_id,
55  lldb::user_id_t break_loc_id);
56 
58 
60 };
61 
62 } // namespace lldb_private
63 
64 #endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H
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::InstrumentationRuntimeASan
Definition: InstrumentationRuntimeASan.h:19
StructuredData.h
InstrumentationRuntime.h
lldb_private::InstrumentationRuntime
Definition: InstrumentationRuntime.h:27
lldb_private::InstrumentationRuntimeASan::GetTypeStatic
static lldb::InstrumentationRuntimeType GetTypeStatic()
Definition: InstrumentationRuntimeASan.cpp:54
lldb_private::InstrumentationRuntimeASan::FormatDescription
std::string FormatDescription(StructuredData::ObjectSP report)
Definition: InstrumentationRuntimeASan.cpp:194
lldb_private::InstrumentationRuntimeASan::Initialize
static void Initialize()
Definition: InstrumentationRuntimeASan.cpp:40
Process.h
lldb_private::InstrumentationRuntimeASan::GetPluginName
llvm::StringRef GetPluginName() override
Definition: InstrumentationRuntimeASan.h:34
lldb_private::InstrumentationRuntimeASan::GetType
virtual lldb::InstrumentationRuntimeType GetType()
Definition: InstrumentationRuntimeASan.h:38
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::InstrumentationRuntimeASan::InstrumentationRuntimeASan
InstrumentationRuntimeASan(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeASan.h:41
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb-private.h
lldb_private::InstrumentationRuntimeASan::CheckIfRuntimeIsValid
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
Definition: InstrumentationRuntimeASan.cpp:68
lldb_private::InstrumentationRuntimeASan::Activate
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
Definition: InstrumentationRuntimeASan.cpp:280
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private::InstrumentationRuntimeASan::~InstrumentationRuntimeASan
~InstrumentationRuntimeASan() override
Definition: InstrumentationRuntimeASan.cpp:58
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::InstrumentationRuntimeASan::Deactivate
void Deactivate()
Definition: InstrumentationRuntimeASan.cpp:318
lldb_private::InstrumentationRuntimeASan::GetPatternForRuntimeLibrary
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
Definition: InstrumentationRuntimeASan.cpp:61
lldb_private::InstrumentationRuntimeASan::Terminate
static void Terminate()
Definition: InstrumentationRuntimeASan.cpp:46
lldb_private::InstrumentationRuntimeASan::NotifyBreakpointHit
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Definition: InstrumentationRuntimeASan.cpp:240
lldb_private::InstrumentationRuntimeASan::GetPluginNameStatic
static lldb_private::ConstString GetPluginNameStatic()
Definition: InstrumentationRuntimeASan.cpp:50
lldb_private::InstrumentationRuntimeASan::CreateInstance
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeASan.cpp:36
lldb_private::InstrumentationRuntimeASan::RetrieveReportData
StructuredData::ObjectSP RetrieveReportData()
Definition: InstrumentationRuntimeASan.cpp:113
lldb::InstrumentationRuntimeType
InstrumentationRuntimeType
Definition: lldb-enumerations.h:485