1 //===-- MainThreadCheckerRuntime.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 liblldb_MainThreadCheckerRuntime_h_
10 #define liblldb_MainThreadCheckerRuntime_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 MainThreadCheckerRuntime : public lldb_private::InstrumentationRuntime {
21 ~MainThreadCheckerRuntime() override;
23 static lldb::InstrumentationRuntimeSP
24 CreateInstance(const lldb::ProcessSP &process_sp);
26 static void Initialize();
28 static void Terminate();
30 static lldb_private::ConstString GetPluginNameStatic();
32 static lldb::InstrumentationRuntimeType GetTypeStatic();
34 lldb_private::ConstString GetPluginName() override {
35 return GetPluginNameStatic();
38 virtual lldb::InstrumentationRuntimeType GetType() { return GetTypeStatic(); }
40 uint32_t GetPluginVersion() override { return 1; }
42 lldb::ThreadCollectionSP
43 GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override;
46 MainThreadCheckerRuntime(const lldb::ProcessSP &process_sp)
47 : lldb_private::InstrumentationRuntime(process_sp) {}
49 const RegularExpression &GetPatternForRuntimeLibrary() override;
51 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;
53 void Activate() override;
57 static bool NotifyBreakpointHit(void *baton,
58 StoppointCallbackContext *context,
59 lldb::user_id_t break_id,
60 lldb::user_id_t break_loc_id);
62 StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref);
65 } // namespace lldb_private
67 #endif // liblldb_MainThreadCheckerRuntime_h_