1 //===-- InstrumentationRuntimeASan.h ----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H
10 #define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H
12 #include "lldb/Target/InstrumentationRuntime.h"
14 namespace lldb_private
{
16 class InstrumentationRuntimeASan
: public lldb_private::InstrumentationRuntime
{
18 ~InstrumentationRuntimeASan() override
;
20 static lldb::InstrumentationRuntimeSP
21 CreateInstance(const lldb::ProcessSP
&process_sp
);
23 static void Initialize();
25 static void Terminate();
27 static llvm::StringRef
GetPluginNameStatic() { return "AddressSanitizer"; }
29 static lldb::InstrumentationRuntimeType
GetTypeStatic();
31 llvm::StringRef
GetPluginName() override
{ return GetPluginNameStatic(); }
33 virtual lldb::InstrumentationRuntimeType
GetType() { return GetTypeStatic(); }
36 InstrumentationRuntimeASan(const lldb::ProcessSP
&process_sp
)
37 : lldb_private::InstrumentationRuntime(process_sp
) {}
39 const RegularExpression
&GetPatternForRuntimeLibrary() override
;
41 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp
) override
;
43 void Activate() override
;
47 static bool NotifyBreakpointHit(void *baton
,
48 StoppointCallbackContext
*context
,
49 lldb::user_id_t break_id
,
50 lldb::user_id_t break_loc_id
);
53 } // namespace lldb_private
55 #endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H