1 //===-- InstrumentationRuntimeUBSan.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_UBSAN_INSTRUMENTATIONRUNTIMEUBSAN_H
10 #define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UBSAN_INSTRUMENTATIONRUNTIMEUBSAN_H
12 #include "lldb/Target/ABI.h"
13 #include "lldb/Target/InstrumentationRuntime.h"
14 #include "lldb/Utility/StructuredData.h"
15 #include "lldb/lldb-private.h"
17 namespace lldb_private
{
19 class InstrumentationRuntimeUBSan
20 : public lldb_private::InstrumentationRuntime
{
22 ~InstrumentationRuntimeUBSan() override
;
24 static lldb::InstrumentationRuntimeSP
25 CreateInstance(const lldb::ProcessSP
&process_sp
);
27 static void Initialize();
29 static void Terminate();
31 static llvm::StringRef
GetPluginNameStatic() {
32 return "UndefinedBehaviorSanitizer";
35 static lldb::InstrumentationRuntimeType
GetTypeStatic();
37 llvm::StringRef
GetPluginName() override
{ return GetPluginNameStatic(); }
39 virtual lldb::InstrumentationRuntimeType
GetType() { return GetTypeStatic(); }
41 lldb::ThreadCollectionSP
42 GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info
) override
;
45 InstrumentationRuntimeUBSan(const lldb::ProcessSP
&process_sp
)
46 : lldb_private::InstrumentationRuntime(process_sp
) {}
48 const RegularExpression
&GetPatternForRuntimeLibrary() override
;
50 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp
) override
;
52 void Activate() override
;
56 static bool NotifyBreakpointHit(void *baton
,
57 StoppointCallbackContext
*context
,
58 lldb::user_id_t break_id
,
59 lldb::user_id_t break_loc_id
);
61 StructuredData::ObjectSP
RetrieveReportData(ExecutionContextRef exe_ctx_ref
);
64 } // namespace lldb_private
66 #endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_UBSAN_INSTRUMENTATIONRUNTIMEUBSAN_H