[Lldb-commits] [lldb] 0feedeb - [lldb/Plugin] Rename AddressSanitizerRuntime for consistency with plugin (NFC)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Tue Jan 21 15:04:23 PST 2020
Author: Jonas Devlieghere
Date: 2020-01-21T15:02:41-08:00
New Revision: 0feedebf4f4b2a888c0d66e2347342234b6fc5ff
URL: https://github.com/llvm/llvm-project/commit/0feedebf4f4b2a888c0d66e2347342234b6fc5ff
DIFF: https://github.com/llvm/llvm-project/commit/0feedebf4f4b2a888c0d66e2347342234b6fc5ff.diff
LOG: [lldb/Plugin] Rename AddressSanitizerRuntime for consistency with plugin (NFC)
Renames AddressSanitizerRuntime to InstrumentationRuntimeASan to be
consistent with the directory structure and plugin name.
Added:
lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h
Modified:
lldb/source/API/SystemInitializerFull.cpp
lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
lldb/tools/lldb-test/SystemInitializerTest.cpp
Removed:
lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h
################################################################################
diff --git a/lldb/source/API/SystemInitializerFull.cpp b/lldb/source/API/SystemInitializerFull.cpp
index 80f92a8709d5..9c5f53d1e68b 100644
--- a/lldb/source/API/SystemInitializerFull.cpp
+++ b/lldb/source/API/SystemInitializerFull.cpp
@@ -54,7 +54,7 @@
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
-#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
+#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h"
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
@@ -222,7 +222,7 @@ llvm::Error SystemInitializerFull::Initialize() {
ProcessMachCore::Initialize();
minidump::ProcessMinidump::Initialize();
MemoryHistoryASan::Initialize();
- AddressSanitizerRuntime::Initialize();
+ InstrumentationRuntimeASan::Initialize();
ThreadSanitizerRuntime::Initialize();
UndefinedBehaviorSanitizerRuntime::Initialize();
MainThreadCheckerRuntime::Initialize();
@@ -316,7 +316,7 @@ void SystemInitializerFull::Terminate() {
ProcessMachCore::Terminate();
minidump::ProcessMinidump::Terminate();
MemoryHistoryASan::Terminate();
- AddressSanitizerRuntime::Terminate();
+ InstrumentationRuntimeASan::Terminate();
ThreadSanitizerRuntime::Terminate();
UndefinedBehaviorSanitizerRuntime::Terminate();
MainThreadCheckerRuntime::Terminate();
diff --git a/lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt b/lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
index dc7464fd1939..0b2902701846 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
+++ b/lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt
@@ -1,5 +1,5 @@
add_lldb_library(lldbPluginInstrumentationRuntimeASan PLUGIN
- ASanRuntime.cpp
+ InstrumentationRuntimeASan.cpp
LINK_LIBS
lldbBreakpoint
diff --git a/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
similarity index 89%
rename from lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
rename to lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
index 2e5dd5989e77..b84b8a1f4a59 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp
@@ -1,4 +1,4 @@
-//===-- ASanRuntime.cpp -----------------------------------------*- C++ -*-===//
+//===-- InstrumentationRuntimeASan.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 "ASanRuntime.h"
+#include "InstrumentationRuntimeASan.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Debugger.h"
@@ -31,39 +31,39 @@ using namespace lldb;
using namespace lldb_private;
lldb::InstrumentationRuntimeSP
-AddressSanitizerRuntime::CreateInstance(const lldb::ProcessSP &process_sp) {
- return InstrumentationRuntimeSP(new AddressSanitizerRuntime(process_sp));
+InstrumentationRuntimeASan::CreateInstance(const lldb::ProcessSP &process_sp) {
+ return InstrumentationRuntimeSP(new InstrumentationRuntimeASan(process_sp));
}
-void AddressSanitizerRuntime::Initialize() {
+void InstrumentationRuntimeASan::Initialize() {
PluginManager::RegisterPlugin(
GetPluginNameStatic(), "AddressSanitizer instrumentation runtime plugin.",
CreateInstance, GetTypeStatic);
}
-void AddressSanitizerRuntime::Terminate() {
+void InstrumentationRuntimeASan::Terminate() {
PluginManager::UnregisterPlugin(CreateInstance);
}
-lldb_private::ConstString AddressSanitizerRuntime::GetPluginNameStatic() {
+lldb_private::ConstString InstrumentationRuntimeASan::GetPluginNameStatic() {
return ConstString("AddressSanitizer");
}
-lldb::InstrumentationRuntimeType AddressSanitizerRuntime::GetTypeStatic() {
+lldb::InstrumentationRuntimeType InstrumentationRuntimeASan::GetTypeStatic() {
return eInstrumentationRuntimeTypeAddressSanitizer;
}
-AddressSanitizerRuntime::~AddressSanitizerRuntime() { Deactivate(); }
+InstrumentationRuntimeASan::~InstrumentationRuntimeASan() { Deactivate(); }
const RegularExpression &
-AddressSanitizerRuntime::GetPatternForRuntimeLibrary() {
+InstrumentationRuntimeASan::GetPatternForRuntimeLibrary() {
// FIXME: This shouldn't include the "dylib" suffix.
static RegularExpression regex(
llvm::StringRef("libclang_rt.asan_(.*)_dynamic\\.dylib"));
return regex;
}
-bool AddressSanitizerRuntime::CheckIfRuntimeIsValid(
+bool InstrumentationRuntimeASan::CheckIfRuntimeIsValid(
const lldb::ModuleSP module_sp) {
const Symbol *symbol = module_sp->FindFirstSymbolWithNameAndType(
ConstString("__asan_get_alloc_stack"), lldb::eSymbolTypeAny);
@@ -108,7 +108,7 @@ t.description = __asan_get_report_description();
t
)";
-StructuredData::ObjectSP AddressSanitizerRuntime::RetrieveReportData() {
+StructuredData::ObjectSP InstrumentationRuntimeASan::RetrieveReportData() {
ProcessSP process_sp = GetProcessSP();
if (!process_sp)
return StructuredData::ObjectSP();
@@ -189,7 +189,7 @@ StructuredData::ObjectSP AddressSanitizerRuntime::RetrieveReportData() {
}
std::string
-AddressSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
+InstrumentationRuntimeASan::FormatDescription(StructuredData::ObjectSP report) {
std::string description = report->GetAsDictionary()
->GetValueForKey("description")
->GetAsString()
@@ -235,15 +235,15 @@ AddressSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
.Default("AddressSanitizer detected: " + description);
}
-bool AddressSanitizerRuntime::NotifyBreakpointHit(
+bool InstrumentationRuntimeASan::NotifyBreakpointHit(
void *baton, StoppointCallbackContext *context, user_id_t break_id,
user_id_t break_loc_id) {
assert(baton && "null baton");
if (!baton)
return false;
- AddressSanitizerRuntime *const instance =
- static_cast<AddressSanitizerRuntime *>(baton);
+ InstrumentationRuntimeASan *const instance =
+ static_cast<InstrumentationRuntimeASan *>(baton);
ProcessSP process_sp = instance->GetProcessSP();
@@ -275,7 +275,7 @@ bool AddressSanitizerRuntime::NotifyBreakpointHit(
return false; // Let target run
}
-void AddressSanitizerRuntime::Activate() {
+void InstrumentationRuntimeASan::Activate() {
if (IsActive())
return;
@@ -305,7 +305,7 @@ void AddressSanitizerRuntime::Activate() {
process_sp->GetTarget()
.CreateBreakpoint(symbol_address, internal, hardware)
.get();
- breakpoint->SetCallback(AddressSanitizerRuntime::NotifyBreakpointHit, this,
+ breakpoint->SetCallback(InstrumentationRuntimeASan::NotifyBreakpointHit, this,
true);
breakpoint->SetBreakpointKind("address-sanitizer-report");
SetBreakpointID(breakpoint->GetID());
@@ -313,7 +313,7 @@ void AddressSanitizerRuntime::Activate() {
SetActive(true);
}
-void AddressSanitizerRuntime::Deactivate() {
+void InstrumentationRuntimeASan::Deactivate() {
if (GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
ProcessSP process_sp = GetProcessSP();
if (process_sp) {
diff --git a/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h
similarity index 87%
rename from lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h
rename to lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h
index 0771e624ff6b..eb7024c9ffc7 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h
+++ b/lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h
@@ -1,4 +1,4 @@
-//===-- ASanRuntime.h -------------------------------------------*- C++ -*-===//
+//===-- InstrumentationRuntimeASan.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,9 +16,9 @@
namespace lldb_private {
-class AddressSanitizerRuntime : public lldb_private::InstrumentationRuntime {
+class InstrumentationRuntimeASan : public lldb_private::InstrumentationRuntime {
public:
- ~AddressSanitizerRuntime() override;
+ ~InstrumentationRuntimeASan() override;
static lldb::InstrumentationRuntimeSP
CreateInstance(const lldb::ProcessSP &process_sp);
@@ -40,7 +40,7 @@ class AddressSanitizerRuntime : public lldb_private::InstrumentationRuntime {
uint32_t GetPluginVersion() override { return 1; }
private:
- AddressSanitizerRuntime(const lldb::ProcessSP &process_sp)
+ InstrumentationRuntimeASan(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 16d39d7cae56..18f4dc51038f 100644
--- a/lldb/tools/lldb-test/SystemInitializerTest.cpp
+++ b/lldb/tools/lldb-test/SystemInitializerTest.cpp
@@ -44,7 +44,7 @@
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
-#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
+#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h"
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
@@ -193,7 +193,7 @@ llvm::Error SystemInitializerTest::Initialize() {
ProcessMachCore::Initialize();
minidump::ProcessMinidump::Initialize();
MemoryHistoryASan::Initialize();
- AddressSanitizerRuntime::Initialize();
+ InstrumentationRuntimeASan::Initialize();
ThreadSanitizerRuntime::Initialize();
UndefinedBehaviorSanitizerRuntime::Initialize();
MainThreadCheckerRuntime::Initialize();
@@ -286,7 +286,7 @@ void SystemInitializerTest::Terminate() {
ProcessMachCore::Terminate();
minidump::ProcessMinidump::Terminate();
MemoryHistoryASan::Terminate();
- AddressSanitizerRuntime::Terminate();
+ InstrumentationRuntimeASan::Terminate();
ThreadSanitizerRuntime::Terminate();
UndefinedBehaviorSanitizerRuntime::Terminate();
MainThreadCheckerRuntime::Terminate();
More information about the lldb-commits
mailing list