LLDB mainline
InstrumentationRuntimeTSan.h
Go to the documentation of this file.
1//===-- InstrumentationRuntimeTSan.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_TSAN_INSTRUMENTATIONRUNTIMETSAN_H
10#define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_TSAN_INSTRUMENTATIONRUNTIMETSAN_H
11
12#include "lldb/Target/ABI.h"
15#include "lldb/lldb-private.h"
16
17namespace lldb_private {
18
20public:
22
23 static lldb::InstrumentationRuntimeSP
24 CreateInstance(const lldb::ProcessSP &process_sp);
25
26 static void Initialize();
27
28 static void Terminate();
29
30 static llvm::StringRef GetPluginNameStatic() { return "ThreadSanitizer"; }
31
33
34 llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
35
37
38 lldb::ThreadCollectionSP
40
41private:
42 InstrumentationRuntimeTSan(const lldb::ProcessSP &process_sp)
43 : lldb_private::InstrumentationRuntime(process_sp) {}
44
46
47 bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;
48
49 void Activate() override;
50
51 void Deactivate();
52
53 static bool NotifyBreakpointHit(void *baton,
55 lldb::user_id_t break_id,
56 lldb::user_id_t break_loc_id);
57
59
61
62 std::string GenerateSummary(StructuredData::ObjectSP report);
63
65
67 lldb::addr_t &global_addr,
68 std::string &global_name,
69 std::string &filename, uint32_t &line);
70
72 bool skip_one_frame = false);
73};
74
75} // namespace lldb_private
76
77#endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_TSAN_INSTRUMENTATIONRUNTIMETSAN_H
Execution context objects refer to objects in the execution of the program that is being debugged.
StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref)
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
std::string GetLocationDescription(StructuredData::ObjectSP report, lldb::addr_t &global_addr, std::string &global_name, std::string &filename, uint32_t &line)
virtual lldb::InstrumentationRuntimeType GetType()
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
lldb::addr_t GetMainRacyAddress(StructuredData::ObjectSP report)
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
static lldb::InstrumentationRuntimeType GetTypeStatic()
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
InstrumentationRuntimeTSan(const lldb::ProcessSP &process_sp)
lldb::addr_t GetFirstNonInternalFramePc(StructuredData::ObjectSP trace, bool skip_one_frame=false)
std::string GenerateSummary(StructuredData::ObjectSP report)
lldb::ThreadCollectionSP GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override
std::string FormatDescription(StructuredData::ObjectSP report)
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.
Definition: SBAttachInfo.h:14
InstrumentationRuntimeType
uint64_t user_id_t
Definition: lldb-types.h:80
uint64_t addr_t
Definition: lldb-types.h:79