aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-01-21 14:55:13 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2020-01-21 15:02:41 -0800
commit623c3c4cf96ba30ac3d653d8acf35a5c57c34bcd (patch)
tree13bd018464869f9ea93e298c99afe7ef517ca46f
parent7745990dd93267d73e08ac5d9e5104645791a70e (diff)
downloadllvm-623c3c4cf96ba30ac3d653d8acf35a5c57c34bcd.zip
llvm-623c3c4cf96ba30ac3d653d8acf35a5c57c34bcd.tar.gz
llvm-623c3c4cf96ba30ac3d653d8acf35a5c57c34bcd.tar.bz2
[lldb/Plugin] Rename UBSanRuntime for consistency with plugin (NFC)
Renames UBSanRuntime to InstrumentationRuntimeUBSan to be consistent with the directory structure and plugin name.
-rw-r--r--lldb/source/API/SystemInitializerFull.cpp6
-rw-r--r--lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt2
-rw-r--r--lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp (renamed from lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp)50
-rw-r--r--lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h (renamed from lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h)8
-rw-r--r--lldb/tools/lldb-test/SystemInitializerTest.cpp6
5 files changed, 33 insertions, 39 deletions
diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp
index 4be9904..799f894 100644
--- a/lldb/source/API/SystemInitializerFull.cpp
+++ b/lldb/source/API/SystemInitializerFull.cpp
@@ -57,7 +57,7 @@
#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h"
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
#include "Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.h"
-#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
+#include "Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h"
#include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
@@ -224,7 +224,7 @@ llvm::Error SystemInitializerFull::Initialize() {
MemoryHistoryASan::Initialize();
InstrumentationRuntimeASan::Initialize();
InstrumentationRuntimeTSan::Initialize();
- UndefinedBehaviorSanitizerRuntime::Initialize();
+ InstrumentationRuntimeUBSan::Initialize();
MainThreadCheckerRuntime::Initialize();
SymbolVendorELF::Initialize();
@@ -318,7 +318,7 @@ void SystemInitializerFull::Terminate() {
MemoryHistoryASan::Terminate();
InstrumentationRuntimeASan::Terminate();
InstrumentationRuntimeTSan::Terminate();
- UndefinedBehaviorSanitizerRuntime::Terminate();
+ InstrumentationRuntimeUBSan::Terminate();
MainThreadCheckerRuntime::Terminate();
wasm::SymbolVendorWasm::Terminate();
SymbolVendorELF::Terminate();
diff --git a/lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt b/lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
index 984bf86..12e1956 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
+++ b/lldb/source/Plugins/InstrumentationRuntime/UBSan/CMakeLists.txt
@@ -1,5 +1,5 @@
add_lldb_library(lldbPluginInstrumentationRuntimeUBSan PLUGIN
- UBSanRuntime.cpp
+ InstrumentationRuntimeUBSan.cpp
LINK_LIBS
lldbBreakpoint
diff --git a/lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
index 137ecab..a85fddf 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.cpp
@@ -1,4 +1,4 @@
-//===-- UBSanRuntime.cpp ----------------------------------------*- C++ -*-===//
+//===-- InstrumentationRuntimeUBSan.cpp -------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "UBSanRuntime.h"
+#include "InstrumentationRuntimeUBSan.h"
#include "Plugins/Process/Utility/HistoryThread.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
@@ -36,35 +36,29 @@
using namespace lldb;
using namespace lldb_private;
-UndefinedBehaviorSanitizerRuntime::~UndefinedBehaviorSanitizerRuntime() {
- Deactivate();
-}
+InstrumentationRuntimeUBSan::~InstrumentationRuntimeUBSan() { Deactivate(); }
lldb::InstrumentationRuntimeSP
-UndefinedBehaviorSanitizerRuntime::CreateInstance(
- const lldb::ProcessSP &process_sp) {
- return InstrumentationRuntimeSP(
- new UndefinedBehaviorSanitizerRuntime(process_sp));
+InstrumentationRuntimeUBSan::CreateInstance(const lldb::ProcessSP &process_sp) {
+ return InstrumentationRuntimeSP(new InstrumentationRuntimeUBSan(process_sp));
}
-void UndefinedBehaviorSanitizerRuntime::Initialize() {
+void InstrumentationRuntimeUBSan::Initialize() {
PluginManager::RegisterPlugin(
GetPluginNameStatic(),
"UndefinedBehaviorSanitizer instrumentation runtime plugin.",
CreateInstance, GetTypeStatic);
}
-void UndefinedBehaviorSanitizerRuntime::Terminate() {
+void InstrumentationRuntimeUBSan::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString
-UndefinedBehaviorSanitizerRuntime::GetPluginNameStatic() {
+lldb_private::ConstString InstrumentationRuntimeUBSan::GetPluginNameStatic() {
return ConstString("UndefinedBehaviorSanitizer");
}
-lldb::InstrumentationRuntimeType
-UndefinedBehaviorSanitizerRuntime::GetTypeStatic() {
+lldb::InstrumentationRuntimeType InstrumentationRuntimeUBSan::GetTypeStatic() {
return eInstrumentationRuntimeTypeUndefinedBehaviorSanitizer;
}
@@ -110,7 +104,7 @@ static std::string RetrieveString(ValueObjectSP return_value_sp,
return str;
}
-StructuredData::ObjectSP UndefinedBehaviorSanitizerRuntime::RetrieveReportData(
+StructuredData::ObjectSP InstrumentationRuntimeUBSan::RetrieveReportData(
ExecutionContextRef exe_ctx_ref) {
ProcessSP process_sp = GetProcessSP();
if (!process_sp)
@@ -187,8 +181,8 @@ StructuredData::ObjectSP UndefinedBehaviorSanitizerRuntime::RetrieveReportData(
static std::string GetStopReasonDescription(StructuredData::ObjectSP report) {
llvm::StringRef stop_reason_description_ref;
- report->GetAsDictionary()->GetValueForKeyAsString("description",
- stop_reason_description_ref);
+ report->GetAsDictionary()->GetValueForKeyAsString(
+ "description", stop_reason_description_ref);
std::string stop_reason_description = stop_reason_description_ref;
if (!stop_reason_description.size()) {
@@ -202,15 +196,15 @@ static std::string GetStopReasonDescription(StructuredData::ObjectSP report) {
return stop_reason_description;
}
-bool UndefinedBehaviorSanitizerRuntime::NotifyBreakpointHit(
+bool InstrumentationRuntimeUBSan::NotifyBreakpointHit(
void *baton, StoppointCallbackContext *context, user_id_t break_id,
user_id_t break_loc_id) {
assert(baton && "null baton");
if (!baton)
return false; ///< false => resume execution.
- UndefinedBehaviorSanitizerRuntime *const instance =
- static_cast<UndefinedBehaviorSanitizerRuntime *>(baton);
+ InstrumentationRuntimeUBSan *const instance =
+ static_cast<InstrumentationRuntimeUBSan *>(baton);
ProcessSP process_sp = instance->GetProcessSP();
ThreadSP thread_sp = context->exe_ctx_ref.GetThreadSP();
@@ -235,12 +229,12 @@ bool UndefinedBehaviorSanitizerRuntime::NotifyBreakpointHit(
}
const RegularExpression &
-UndefinedBehaviorSanitizerRuntime::GetPatternForRuntimeLibrary() {
+InstrumentationRuntimeUBSan::GetPatternForRuntimeLibrary() {
static RegularExpression regex(llvm::StringRef("libclang_rt\\.(a|t|ub)san_"));
return regex;
}
-bool UndefinedBehaviorSanitizerRuntime::CheckIfRuntimeIsValid(
+bool InstrumentationRuntimeUBSan::CheckIfRuntimeIsValid(
const lldb::ModuleSP module_sp) {
static ConstString ubsan_test_sym("__ubsan_on_report");
const Symbol *symbol = module_sp->FindFirstSymbolWithNameAndType(
@@ -249,7 +243,7 @@ bool UndefinedBehaviorSanitizerRuntime::CheckIfRuntimeIsValid(
}
// FIXME: Factor out all the logic we have in common with the {a,t}san plugins.
-void UndefinedBehaviorSanitizerRuntime::Activate() {
+void InstrumentationRuntimeUBSan::Activate() {
if (IsActive())
return;
@@ -280,15 +274,15 @@ void UndefinedBehaviorSanitizerRuntime::Activate() {
.CreateBreakpoint(symbol_address, /*internal=*/true,
/*hardware=*/false)
.get();
- breakpoint->SetCallback(
- UndefinedBehaviorSanitizerRuntime::NotifyBreakpointHit, this, true);
+ breakpoint->SetCallback(InstrumentationRuntimeUBSan::NotifyBreakpointHit,
+ this, true);
breakpoint->SetBreakpointKind("undefined-behavior-sanitizer-report");
SetBreakpointID(breakpoint->GetID());
SetActive(true);
}
-void UndefinedBehaviorSanitizerRuntime::Deactivate() {
+void InstrumentationRuntimeUBSan::Deactivate() {
SetActive(false);
auto BID = GetBreakpointID();
@@ -302,7 +296,7 @@ void UndefinedBehaviorSanitizerRuntime::Deactivate() {
}
lldb::ThreadCollectionSP
-UndefinedBehaviorSanitizerRuntime::GetBacktracesFromExtendedStopInfo(
+InstrumentationRuntimeUBSan::GetBacktracesFromExtendedStopInfo(
StructuredData::ObjectSP info) {
ThreadCollectionSP threads;
threads = std::make_shared<ThreadCollection>();
diff --git a/lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h
index 1d854b7..8345bf2 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h
+++ b/lldb/source/Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h
@@ -1,4 +1,4 @@
-//===-- UBSanRuntime.h ------------------------------------------*- C++ -*-===//
+//===-- InstrumentationRuntimeUBSan.h ---------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -16,10 +16,10 @@
namespace lldb_private {
-class UndefinedBehaviorSanitizerRuntime
+class InstrumentationRuntimeUBSan
: public lldb_private::InstrumentationRuntime {
public:
- ~UndefinedBehaviorSanitizerRuntime() override;
+ ~InstrumentationRuntimeUBSan() override;
static lldb::InstrumentationRuntimeSP
CreateInstance(const lldb::ProcessSP &process_sp);
@@ -44,7 +44,7 @@ public:
GetBacktracesFromExtendedStopInfo(StructuredData::ObjectSP info) override;
private:
- UndefinedBehaviorSanitizerRuntime(const lldb::ProcessSP &process_sp)
+ InstrumentationRuntimeUBSan(const lldb::ProcessSP &process_sp)
: lldb_private::InstrumentationRuntime(process_sp) {}
const RegularExpression &GetPatternForRuntimeLibrary() override;
diff --git a/lldb/tools/lldb-test/SystemInitializerTest.cpp b/lldb/tools/lldb-test/SystemInitializerTest.cpp
index 0ea4714..280a118 100644
--- a/lldb/tools/lldb-test/SystemInitializerTest.cpp
+++ b/lldb/tools/lldb-test/SystemInitializerTest.cpp
@@ -47,7 +47,7 @@
#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h"
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
#include "Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.h"
-#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
+#include "Plugins/InstrumentationRuntime/UBSan/InstrumentationRuntimeUBSan.h"
#include "Plugins/JITLoader/GDB/JITLoaderGDB.h"
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
@@ -195,7 +195,7 @@ llvm::Error SystemInitializerTest::Initialize() {
MemoryHistoryASan::Initialize();
InstrumentationRuntimeASan::Initialize();
InstrumentationRuntimeTSan::Initialize();
- UndefinedBehaviorSanitizerRuntime::Initialize();
+ InstrumentationRuntimeUBSan::Initialize();
MainThreadCheckerRuntime::Initialize();
SymbolVendorELF::Initialize();
@@ -288,7 +288,7 @@ void SystemInitializerTest::Terminate() {
MemoryHistoryASan::Terminate();
InstrumentationRuntimeASan::Terminate();
InstrumentationRuntimeTSan::Terminate();
- UndefinedBehaviorSanitizerRuntime::Terminate();
+ InstrumentationRuntimeUBSan::Terminate();
MainThreadCheckerRuntime::Terminate();
wasm::SymbolVendorWasm::Terminate();
SymbolVendorELF::Terminate();