56 lines · c
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-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H10#define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H11 12#include "lldb/Target/InstrumentationRuntime.h"13 14namespace lldb_private {15 16class InstrumentationRuntimeASan : public lldb_private::InstrumentationRuntime {17public:18 ~InstrumentationRuntimeASan() override;19 20 static lldb::InstrumentationRuntimeSP21 CreateInstance(const lldb::ProcessSP &process_sp);22 23 static void Initialize();24 25 static void Terminate();26 27 static llvm::StringRef GetPluginNameStatic() { return "AddressSanitizer"; }28 29 static lldb::InstrumentationRuntimeType GetTypeStatic();30 31 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }32 33 virtual lldb::InstrumentationRuntimeType GetType() { return GetTypeStatic(); }34 35private:36 InstrumentationRuntimeASan(const lldb::ProcessSP &process_sp)37 : lldb_private::InstrumentationRuntime(process_sp) {}38 39 const RegularExpression &GetPatternForRuntimeLibrary() override;40 41 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;42 43 void Activate() override;44 45 void Deactivate();46 47 static bool NotifyBreakpointHit(void *baton,48 StoppointCallbackContext *context,49 lldb::user_id_t break_id,50 lldb::user_id_t break_loc_id);51};52 53} // namespace lldb_private54 55#endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_ASAN_INSTRUMENTATIONRUNTIMEASAN_H56