LLDB  mainline
InstrumentationRuntimeMainThreadChecker.h
Go to the documentation of this file.
1 //===-- InstrumentationRuntimeMainThreadChecker.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-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_MAINTHREADCHECKER_INSTRUMENTATIONRUNTIMEMAINTHREADCHECKER_H
10 #define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_MAINTHREADCHECKER_INSTRUMENTATIONRUNTIMEMAINTHREADCHECKER_H
11 
12 #include "lldb/Target/ABI.h"
15 #include "lldb/lldb-private.h"
16 
17 namespace lldb_private {
18 
21 public:
23 
24  static lldb::InstrumentationRuntimeSP
25  CreateInstance(const lldb::ProcessSP &process_sp);
26 
27  static void Initialize();
28 
29  static void Terminate();
30 
31  static llvm::StringRef GetPluginNameStatic() { return "MainThreadChecker"; }
32 
34 
35  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
36 
38 
39  lldb::ThreadCollectionSP
41 
42 private:
43  InstrumentationRuntimeMainThreadChecker(const lldb::ProcessSP &process_sp)
44  : lldb_private::InstrumentationRuntime(process_sp) {}
45 
47 
48  bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;
49 
50  void Activate() override;
51 
52  void Deactivate();
53 
54  static bool NotifyBreakpointHit(void *baton,
55  StoppointCallbackContext *context,
56  lldb::user_id_t break_id,
57  lldb::user_id_t break_loc_id);
58 
60 };
61 
62 } // namespace lldb_private
63 
64 #endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_MAINTHREADCHECKER_INSTRUMENTATIONRUNTIMEMAINTHREADCHECKER_H
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::StoppointCallbackContext
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
Definition: StoppointCallbackContext.h:26
lldb_private::InstrumentationRuntimeMainThreadChecker::GetBacktracesFromExtendedStopInfo
lldb::ThreadCollectionSP GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override
Definition: InstrumentationRuntimeMainThreadChecker.cpp:239
StructuredData.h
lldb_private::InstrumentationRuntimeMainThreadChecker::GetPluginName
llvm::StringRef GetPluginName() override
Definition: InstrumentationRuntimeMainThreadChecker.h:35
InstrumentationRuntime.h
lldb_private::InstrumentationRuntimeMainThreadChecker::Activate
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
Definition: InstrumentationRuntimeMainThreadChecker.cpp:186
lldb_private::InstrumentationRuntime
Definition: InstrumentationRuntime.h:27
ABI.h
lldb_private::InstrumentationRuntimeMainThreadChecker::CheckIfRuntimeIsValid
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
Definition: InstrumentationRuntimeMainThreadChecker.cpp:68
lldb_private::InstrumentationRuntimeMainThreadChecker
Definition: InstrumentationRuntimeMainThreadChecker.h:19
lldb_private::InstrumentationRuntimeMainThreadChecker::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: InstrumentationRuntimeMainThreadChecker.h:31
lldb_private::InstrumentationRuntimeMainThreadChecker::NotifyBreakpointHit
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Definition: InstrumentationRuntimeMainThreadChecker.cpp:150
lldb_private::InstrumentationRuntimeMainThreadChecker::GetTypeStatic
static lldb::InstrumentationRuntimeType GetTypeStatic()
Definition: InstrumentationRuntimeMainThreadChecker.cpp:58
lldb_private::InstrumentationRuntimeMainThreadChecker::Terminate
static void Terminate()
Definition: InstrumentationRuntimeMainThreadChecker.cpp:53
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::InstrumentationRuntimeMainThreadChecker::RetrieveReportData
StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref)
Definition: InstrumentationRuntimeMainThreadChecker.cpp:77
lldb_private::InstrumentationRuntimeMainThreadChecker::GetType
virtual lldb::InstrumentationRuntimeType GetType()
Definition: InstrumentationRuntimeMainThreadChecker.h:37
lldb_private::InstrumentationRuntimeMainThreadChecker::GetPatternForRuntimeLibrary
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
Definition: InstrumentationRuntimeMainThreadChecker.cpp:63
lldb-private.h
lldb_private::InstrumentationRuntimeMainThreadChecker::InstrumentationRuntimeMainThreadChecker
InstrumentationRuntimeMainThreadChecker(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeMainThreadChecker.h:43
lldb_private::InstrumentationRuntimeMainThreadChecker::CreateInstance
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeMainThreadChecker.cpp:40
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::InstrumentationRuntimeMainThreadChecker::Deactivate
void Deactivate()
Definition: InstrumentationRuntimeMainThreadChecker.cpp:225
lldb_private::ExecutionContextRef
Execution context objects refer to objects in the execution of the program that is being debugged.
Definition: ExecutionContext.h:72
lldb_private::InstrumentationRuntimeMainThreadChecker::~InstrumentationRuntimeMainThreadChecker
~InstrumentationRuntimeMainThreadChecker() override
Definition: InstrumentationRuntimeMainThreadChecker.cpp:35
lldb_private::InstrumentationRuntimeMainThreadChecker::Initialize
static void Initialize()
Definition: InstrumentationRuntimeMainThreadChecker.cpp:46
lldb::InstrumentationRuntimeType
InstrumentationRuntimeType
Definition: lldb-enumerations.h:485