Path: blob/main/contrib/llvm-project/lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.h
39653 views
//===-- InstrumentationRuntimeTSan.h ----------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_TSAN_INSTRUMENTATIONRUNTIMETSAN_H9#define LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_TSAN_INSTRUMENTATIONRUNTIMETSAN_H1011#include "lldb/Target/ABI.h"12#include "lldb/Target/InstrumentationRuntime.h"13#include "lldb/Utility/StructuredData.h"14#include "lldb/lldb-private.h"1516namespace lldb_private {1718class InstrumentationRuntimeTSan : public lldb_private::InstrumentationRuntime {19public:20~InstrumentationRuntimeTSan() override;2122static lldb::InstrumentationRuntimeSP23CreateInstance(const lldb::ProcessSP &process_sp);2425static void Initialize();2627static void Terminate();2829static llvm::StringRef GetPluginNameStatic() { return "ThreadSanitizer"; }3031static lldb::InstrumentationRuntimeType GetTypeStatic();3233llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }3435virtual lldb::InstrumentationRuntimeType GetType() { return GetTypeStatic(); }3637lldb::ThreadCollectionSP38GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override;3940private:41InstrumentationRuntimeTSan(const lldb::ProcessSP &process_sp)42: lldb_private::InstrumentationRuntime(process_sp) {}4344const RegularExpression &GetPatternForRuntimeLibrary() override;4546bool CheckIfRuntimeIsValid(const lldb::ModuleSP module_sp) override;4748void Activate() override;4950void Deactivate();5152static bool NotifyBreakpointHit(void *baton,53StoppointCallbackContext *context,54lldb::user_id_t break_id,55lldb::user_id_t break_loc_id);5657StructuredData::ObjectSP RetrieveReportData(ExecutionContextRef exe_ctx_ref);5859std::string FormatDescription(StructuredData::ObjectSP report);6061std::string GenerateSummary(StructuredData::ObjectSP report);6263lldb::addr_t GetMainRacyAddress(StructuredData::ObjectSP report);6465std::string GetLocationDescription(StructuredData::ObjectSP report,66lldb::addr_t &global_addr,67std::string &global_name,68std::string &filename, uint32_t &line);6970lldb::addr_t GetFirstNonInternalFramePc(StructuredData::ObjectSP trace,71bool skip_one_frame = false);72};7374} // namespace lldb_private7576#endif // LLDB_SOURCE_PLUGINS_INSTRUMENTATIONRUNTIME_TSAN_INSTRUMENTATIONRUNTIMETSAN_H777879