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
17namespace lldb_private {
18
21public:
23
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
41
42private:
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,
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
Execution context objects refer to objects in the execution of the program that is being debugged.
lldb::ThreadCollectionSP GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref)
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
General Outline: When we hit a breakpoint we need to package up whatever information is needed to eva...
std::shared_ptr< Object > ObjectSP
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::Process > ProcessSP
Definition: lldb-forward.h:387
InstrumentationRuntimeType
uint64_t user_id_t
Definition: lldb-types.h:82
std::shared_ptr< lldb_private::InstrumentationRuntime > InstrumentationRuntimeSP
Definition: lldb-forward.h:358
std::shared_ptr< lldb_private::Module > ModuleSP
Definition: lldb-forward.h:371
std::shared_ptr< lldb_private::ThreadCollection > ThreadCollectionSP
Definition: lldb-forward.h:448