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
17namespace lldb_private {
18
20public:
22
24 CreateInstance(const lldb::ProcessSP &process_sp);
25
26 static void Initialize();
27
28 static void Terminate();
29
30 static llvm::StringRef GetPluginNameStatic() { return "AddressSanitizer"; }
31
33
34 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
35
37
38private:
40 : lldb_private::InstrumentationRuntime(process_sp) {}
41
43
44 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;
45
46 void Activate() override;
47
48 void Deactivate();
49
50 static bool NotifyBreakpointHit(void *baton,
52 lldb::user_id_t break_id,
53 lldb::user_id_t break_loc_id);
54
56
58};
59
60} // namespace lldb_private
61
62#endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H
static lldb::InstrumentationRuntimeType GetTypeStatic()
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
virtual lldb::InstrumentationRuntimeType GetType()
InstrumentationRuntimeASan(const lldb::ProcessSP &process_sp)
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
std::string FormatDescription(StructuredData::ObjectSP report)
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
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:368
InstrumentationRuntimeType
uint64_t user_id_t
Definition: lldb-types.h:80
std::shared_ptr< lldb_private::InstrumentationRuntime > InstrumentationRuntimeSP
Definition: lldb-forward.h:341
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:354