1*77edd9b7SUsama Hameed //===-- InstrumentationRuntimeASanLibsanitizers.h ---------------*- C++ -*-===// 2*77edd9b7SUsama Hameed // 3*77edd9b7SUsama Hameed // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*77edd9b7SUsama Hameed // See https://llvm.org/LICENSE.txt for license information. 5*77edd9b7SUsama Hameed // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*77edd9b7SUsama Hameed // 7*77edd9b7SUsama Hameed //===----------------------------------------------------------------------===// 8*77edd9b7SUsama Hameed 9*77edd9b7SUsama Hameed #ifndef LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASANLIBSANITIZERS_INSTRUMENTATIONRUNTIMEASANLIBSANITIZERS_H 10*77edd9b7SUsama Hameed #define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASANLIBSANITIZERS_INSTRUMENTATIONRUNTIMEASANLIBSANITIZERS_H 11*77edd9b7SUsama Hameed 12*77edd9b7SUsama Hameed #include "lldb/Target/InstrumentationRuntime.h" 13*77edd9b7SUsama Hameed 14*77edd9b7SUsama Hameed class InstrumentationRuntimeASanLibsanitizers 15*77edd9b7SUsama Hameed : public lldb_private::InstrumentationRuntime { 16*77edd9b7SUsama Hameed public: 17*77edd9b7SUsama Hameed ~InstrumentationRuntimeASanLibsanitizers() override; 18*77edd9b7SUsama Hameed 19*77edd9b7SUsama Hameed static lldb::InstrumentationRuntimeSP 20*77edd9b7SUsama Hameed CreateInstance(const lldb::ProcessSP &process_sp); 21*77edd9b7SUsama Hameed 22*77edd9b7SUsama Hameed static void Initialize(); 23*77edd9b7SUsama Hameed 24*77edd9b7SUsama Hameed static void Terminate(); 25*77edd9b7SUsama Hameed GetPluginNameStatic()26*77edd9b7SUsama Hameed static llvm::StringRef GetPluginNameStatic() { return "Libsanitizers-ASan"; } 27*77edd9b7SUsama Hameed 28*77edd9b7SUsama Hameed static lldb::InstrumentationRuntimeType GetTypeStatic(); 29*77edd9b7SUsama Hameed GetPluginName()30*77edd9b7SUsama Hameed llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); } 31*77edd9b7SUsama Hameed GetType()32*77edd9b7SUsama Hameed virtual lldb::InstrumentationRuntimeType GetType() { return GetTypeStatic(); } 33*77edd9b7SUsama Hameed 34*77edd9b7SUsama Hameed private: InstrumentationRuntimeASanLibsanitizers(const lldb::ProcessSP & process_sp)35*77edd9b7SUsama Hameed InstrumentationRuntimeASanLibsanitizers(const lldb::ProcessSP &process_sp) 36*77edd9b7SUsama Hameed : lldb_private::InstrumentationRuntime(process_sp) {} 37*77edd9b7SUsama Hameed 38*77edd9b7SUsama Hameed const lldb_private::RegularExpression &GetPatternForRuntimeLibrary() override; 39*77edd9b7SUsama Hameed 40*77edd9b7SUsama Hameed bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override; 41*77edd9b7SUsama Hameed 42*77edd9b7SUsama Hameed void Activate() override; 43*77edd9b7SUsama Hameed 44*77edd9b7SUsama Hameed void Deactivate(); 45*77edd9b7SUsama Hameed 46*77edd9b7SUsama Hameed static bool 47*77edd9b7SUsama Hameed NotifyBreakpointHit(void *baton, 48*77edd9b7SUsama Hameed lldb_private::StoppointCallbackContext *context, 49*77edd9b7SUsama Hameed lldb::user_id_t break_id, lldb::user_id_t break_loc_id); 50*77edd9b7SUsama Hameed }; 51*77edd9b7SUsama Hameed 52*77edd9b7SUsama Hameed #endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASANLIBSANITIZERS_INSTRUMENTATIONRUNTIMEASANLIBSANITIZERS_H 53