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 
17 namespace lldb_private {
18 
20 public:
21  ~InstrumentationRuntimeTSan() override;
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 
41 private:
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,
54  StoppointCallbackContext *context,
55  lldb::user_id_t break_id,
56  lldb::user_id_t break_loc_id);
57 
59 
61 
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
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::InstrumentationRuntimeTSan::GetBacktracesFromExtendedStopInfo
lldb::ThreadCollectionSP GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override
Definition: InstrumentationRuntimeTSan.cpp:1048
StructuredData.h
InstrumentationRuntime.h
lldb_private::InstrumentationRuntime
Definition: InstrumentationRuntime.h:27
lldb_private::InstrumentationRuntimeTSan::GetPluginName
llvm::StringRef GetPluginName() override
Definition: InstrumentationRuntimeTSan.h:34
lldb_private::InstrumentationRuntimeTSan::GetPatternForRuntimeLibrary
const RegularExpression & GetPatternForRuntimeLibrary() override
Return a regular expression which can be used to identify a valid version of the runtime library.
Definition: InstrumentationRuntimeTSan.cpp:878
lldb_private::InstrumentationRuntimeTSan::GetMainRacyAddress
lldb::addr_t GetMainRacyAddress(StructuredData::ObjectSP report)
Definition: InstrumentationRuntimeTSan.cpp:697
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::InstrumentationRuntimeTSan::GetFirstNonInternalFramePc
lldb::addr_t GetFirstNonInternalFramePc(StructuredData::ObjectSP trace, bool skip_one_frame=false)
Definition: InstrumentationRuntimeTSan.cpp:582
ABI.h
lldb_private::InstrumentationRuntimeTSan::NotifyBreakpointHit
static bool NotifyBreakpointHit(void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id, lldb::user_id_t break_loc_id)
Definition: InstrumentationRuntimeTSan.cpp:793
lldb_private::InstrumentationRuntimeTSan::Initialize
static void Initialize()
Definition: InstrumentationRuntimeTSan.cpp:45
lldb_private::InstrumentationRuntimeTSan::~InstrumentationRuntimeTSan
~InstrumentationRuntimeTSan() override
Definition: InstrumentationRuntimeTSan.cpp:59
lldb_private::InstrumentationRuntimeTSan::GetLocationDescription
std::string GetLocationDescription(StructuredData::ObjectSP report, lldb::addr_t &global_addr, std::string &global_name, std::string &filename, uint32_t &line)
Definition: InstrumentationRuntimeTSan.cpp:713
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::InstrumentationRuntimeTSan::GetPluginNameStatic
static llvm::StringRef GetPluginNameStatic()
Definition: InstrumentationRuntimeTSan.h:30
lldb_private::InstrumentationRuntimeTSan
Definition: InstrumentationRuntimeTSan.h:19
lldb_private::InstrumentationRuntimeTSan::FormatDescription
std::string FormatDescription(StructuredData::ObjectSP report)
Definition: InstrumentationRuntimeTSan.cpp:489
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::InstrumentationRuntimeTSan::GetTypeStatic
static lldb::InstrumentationRuntimeType GetTypeStatic()
Definition: InstrumentationRuntimeTSan.cpp:55
lldb-private.h
lldb_private::InstrumentationRuntimeTSan::CreateInstance
static lldb::InstrumentationRuntimeSP CreateInstance(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeTSan.cpp:41
uint32_t
lldb_private::InstrumentationRuntimeTSan::Deactivate
void Deactivate()
Definition: InstrumentationRuntimeTSan.cpp:929
lldb_private::InstrumentationRuntimeTSan::RetrieveReportData
StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref)
Definition: InstrumentationRuntimeTSan.cpp:300
lldb_private::InstrumentationRuntimeTSan::CheckIfRuntimeIsValid
bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override
Check whether module_sp corresponds to a valid runtime library.
Definition: InstrumentationRuntimeTSan.cpp:883
lldb_private::InstrumentationRuntimeTSan::InstrumentationRuntimeTSan
InstrumentationRuntimeTSan(const lldb::ProcessSP &process_sp)
Definition: InstrumentationRuntimeTSan.h:42
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::InstrumentationRuntimeTSan::GenerateSummary
std::string GenerateSummary(StructuredData::ObjectSP report)
Definition: InstrumentationRuntimeTSan.cpp:611
lldb_private::InstrumentationRuntimeTSan::Activate
void Activate() override
Register a breakpoint in the runtime library and perform any other necessary initialization.
Definition: InstrumentationRuntimeTSan.cpp:891
lldb_private::InstrumentationRuntimeTSan::Terminate
static void Terminate()
Definition: InstrumentationRuntimeTSan.cpp:51
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::InstrumentationRuntimeTSan::GetType
virtual lldb::InstrumentationRuntimeType GetType()
Definition: InstrumentationRuntimeTSan.h:36
lldb::InstrumentationRuntimeType
InstrumentationRuntimeType
Definition: lldb-enumerations.h:485