Coverage Report

Created: 2023-09-21 18:56

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.h
Line
Count
Source (jump to first uncovered line)
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"
13
#include "lldb/Target/InstrumentationRuntime.h"
14
#include "lldb/Utility/StructuredData.h"
15
#include "lldb/lldb-private.h"
16
17
namespace lldb_private {
18
19
class InstrumentationRuntimeTSan : public lldb_private::InstrumentationRuntime {
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
3.92k
  static llvm::StringRef GetPluginNameStatic() { return "ThreadSanitizer"; }
31
32
  static lldb::InstrumentationRuntimeType GetTypeStatic();
33
34
0
  llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
35
36
0
  virtual lldb::InstrumentationRuntimeType GetType() { return GetTypeStatic(); }
37
38
  lldb::ThreadCollectionSP
39
  GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override;
40
41
private:
42
  InstrumentationRuntimeTSan(const lldb::ProcessSP &process_sp)
43
2.25k
      : lldb_private::InstrumentationRuntime(process_sp) {}
44
45
  const RegularExpression &GetPatternForRuntimeLibrary() override;
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
58
  StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref);
59
60
  std::string FormatDescription(StructuredData::ObjectSP report);
61
62
  std::string GenerateSummary(StructuredData::ObjectSP report);
63
64
  lldb::addr_t GetMainRacyAddress(StructuredData::ObjectSP report);
65
66
  std::string GetLocationDescription(StructuredData::ObjectSP report,
67
                                     lldb::addr_t &global_addr,
68
                                     std::string &global_name,
69
                                     std::string &filename, uint32_t &line);
70
71
  lldb::addr_t GetFirstNonInternalFramePc(StructuredData::ObjectSP trace,
72
                                          bool skip_one_frame = false);
73
};
74
75
} // namespace lldb_private
76
77
#endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_TSAN_INSTRUMENTATIONRUNTIMETSAN_H