Skip to content

Commit 0feedeb

Browse files
committed
[lldb/Plugin] Rename AddressSanitizerRuntime for consistency with plugin (NFC)
Renames AddressSanitizerRuntime to InstrumentationRuntimeASan to be consistent with the directory structure and plugin name.
1 parent 83a131b commit 0feedeb

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

lldb/source/API/SystemInitializerFull.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
5555
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
5656
#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
57-
#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
57+
#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h"
5858
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
5959
#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
6060
#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
@@ -222,7 +222,7 @@ llvm::Error SystemInitializerFull::Initialize() {
222222
ProcessMachCore::Initialize();
223223
minidump::ProcessMinidump::Initialize();
224224
MemoryHistoryASan::Initialize();
225-
AddressSanitizerRuntime::Initialize();
225+
InstrumentationRuntimeASan::Initialize();
226226
ThreadSanitizerRuntime::Initialize();
227227
UndefinedBehaviorSanitizerRuntime::Initialize();
228228
MainThreadCheckerRuntime::Initialize();
@@ -316,7 +316,7 @@ void SystemInitializerFull::Terminate() {
316316
ProcessMachCore::Terminate();
317317
minidump::ProcessMinidump::Terminate();
318318
MemoryHistoryASan::Terminate();
319-
AddressSanitizerRuntime::Terminate();
319+
InstrumentationRuntimeASan::Terminate();
320320
ThreadSanitizerRuntime::Terminate();
321321
UndefinedBehaviorSanitizerRuntime::Terminate();
322322
MainThreadCheckerRuntime::Terminate();

lldb/source/Plugins/InstrumentationRuntime/ASan/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
add_lldb_library(lldbPluginInstrumentationRuntimeASan PLUGIN
2-
ASanRuntime.cpp
2+
InstrumentationRuntimeASan.cpp
33

44
LINK_LIBS
55
lldbBreakpoint

lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp renamed to lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
//===-- ASanRuntime.cpp -----------------------------------------*- C++ -*-===//
1+
//===-- InstrumentationRuntimeASan.cpp --------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "ASanRuntime.h"
9+
#include "InstrumentationRuntimeASan.h"
1010

1111
#include "lldb/Breakpoint/StoppointCallbackContext.h"
1212
#include "lldb/Core/Debugger.h"
@@ -31,39 +31,39 @@ using namespace lldb;
3131
using namespace lldb_private;
3232

3333
lldb::InstrumentationRuntimeSP
34-
AddressSanitizerRuntime::CreateInstance(const lldb::ProcessSP &process_sp) {
35-
return InstrumentationRuntimeSP(new AddressSanitizerRuntime(process_sp));
34+
InstrumentationRuntimeASan::CreateInstance(const lldb::ProcessSP &process_sp) {
35+
return InstrumentationRuntimeSP(new InstrumentationRuntimeASan(process_sp));
3636
}
3737

38-
void AddressSanitizerRuntime::Initialize() {
38+
void InstrumentationRuntimeASan::Initialize() {
3939
PluginManager::RegisterPlugin(
4040
GetPluginNameStatic(), "AddressSanitizer instrumentation runtime plugin.",
4141
CreateInstance, GetTypeStatic);
4242
}
4343

44-
void AddressSanitizerRuntime::Terminate() {
44+
void InstrumentationRuntimeASan::Terminate() {
4545
PluginManager::UnregisterPlugin(CreateInstance);
4646
}
4747

48-
lldb_private::ConstString AddressSanitizerRuntime::GetPluginNameStatic() {
48+
lldb_private::ConstString InstrumentationRuntimeASan::GetPluginNameStatic() {
4949
return ConstString("AddressSanitizer");
5050
}
5151

52-
lldb::InstrumentationRuntimeType AddressSanitizerRuntime::GetTypeStatic() {
52+
lldb::InstrumentationRuntimeType InstrumentationRuntimeASan::GetTypeStatic() {
5353
return eInstrumentationRuntimeTypeAddressSanitizer;
5454
}
5555

56-
AddressSanitizerRuntime::~AddressSanitizerRuntime() { Deactivate(); }
56+
InstrumentationRuntimeASan::~InstrumentationRuntimeASan() { Deactivate(); }
5757

5858
const RegularExpression &
59-
AddressSanitizerRuntime::GetPatternForRuntimeLibrary() {
59+
InstrumentationRuntimeASan::GetPatternForRuntimeLibrary() {
6060
// FIXME: This shouldn't include the "dylib" suffix.
6161
static RegularExpression regex(
6262
llvm::StringRef("libclang_rt.asan_(.*)_dynamic\\.dylib"));
6363
return regex;
6464
}
6565

66-
bool AddressSanitizerRuntime::CheckIfRuntimeIsValid(
66+
bool InstrumentationRuntimeASan::CheckIfRuntimeIsValid(
6767
const lldb::ModuleSP module_sp) {
6868
const Symbol *symbol = module_sp->FindFirstSymbolWithNameAndType(
6969
ConstString("__asan_get_alloc_stack"), lldb::eSymbolTypeAny);
@@ -108,7 +108,7 @@ t.description = __asan_get_report_description();
108108
t
109109
)";
110110

111-
StructuredData::ObjectSP AddressSanitizerRuntime::RetrieveReportData() {
111+
StructuredData::ObjectSP InstrumentationRuntimeASan::RetrieveReportData() {
112112
ProcessSP process_sp = GetProcessSP();
113113
if (!process_sp)
114114
return StructuredData::ObjectSP();
@@ -189,7 +189,7 @@ StructuredData::ObjectSP AddressSanitizerRuntime::RetrieveReportData() {
189189
}
190190

191191
std::string
192-
AddressSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
192+
InstrumentationRuntimeASan::FormatDescription(StructuredData::ObjectSP report) {
193193
std::string description = report->GetAsDictionary()
194194
->GetValueForKey("description")
195195
->GetAsString()
@@ -235,15 +235,15 @@ AddressSanitizerRuntime::FormatDescription(StructuredData::ObjectSP report) {
235235
.Default("AddressSanitizer detected: " + description);
236236
}
237237

238-
bool AddressSanitizerRuntime::NotifyBreakpointHit(
238+
bool InstrumentationRuntimeASan::NotifyBreakpointHit(
239239
void *baton, StoppointCallbackContext *context, user_id_t break_id,
240240
user_id_t break_loc_id) {
241241
assert(baton && "null baton");
242242
if (!baton)
243243
return false;
244244

245-
AddressSanitizerRuntime *const instance =
246-
static_cast<AddressSanitizerRuntime *>(baton);
245+
InstrumentationRuntimeASan *const instance =
246+
static_cast<InstrumentationRuntimeASan *>(baton);
247247

248248
ProcessSP process_sp = instance->GetProcessSP();
249249

@@ -275,7 +275,7 @@ bool AddressSanitizerRuntime::NotifyBreakpointHit(
275275
return false; // Let target run
276276
}
277277

278-
void AddressSanitizerRuntime::Activate() {
278+
void InstrumentationRuntimeASan::Activate() {
279279
if (IsActive())
280280
return;
281281

@@ -305,15 +305,15 @@ void AddressSanitizerRuntime::Activate() {
305305
process_sp->GetTarget()
306306
.CreateBreakpoint(symbol_address, internal, hardware)
307307
.get();
308-
breakpoint->SetCallback(AddressSanitizerRuntime::NotifyBreakpointHit, this,
308+
breakpoint->SetCallback(InstrumentationRuntimeASan::NotifyBreakpointHit, this,
309309
true);
310310
breakpoint->SetBreakpointKind("address-sanitizer-report");
311311
SetBreakpointID(breakpoint->GetID());
312312

313313
SetActive(true);
314314
}
315315

316-
void AddressSanitizerRuntime::Deactivate() {
316+
void InstrumentationRuntimeASan::Deactivate() {
317317
if (GetBreakpointID() != LLDB_INVALID_BREAK_ID) {
318318
ProcessSP process_sp = GetProcessSP();
319319
if (process_sp) {

lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h renamed to lldb/source/Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//===-- ASanRuntime.h -------------------------------------------*- C++ -*-===//
1+
//===-- InstrumentationRuntimeASan.h ----------------------------*- C++ -*-===//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -16,9 +16,9 @@
1616

1717
namespace lldb_private {
1818

19-
class AddressSanitizerRuntime : public lldb_private::InstrumentationRuntime {
19+
class InstrumentationRuntimeASan : public lldb_private::InstrumentationRuntime {
2020
public:
21-
~AddressSanitizerRuntime() override;
21+
~InstrumentationRuntimeASan() override;
2222

2323
static lldb::InstrumentationRuntimeSP
2424
CreateInstance(const lldb::ProcessSP &process_sp);
@@ -40,7 +40,7 @@ class AddressSanitizerRuntime : public lldb_private::InstrumentationRuntime {
4040
uint32_t GetPluginVersion() override { return 1; }
4141

4242
private:
43-
AddressSanitizerRuntime(const lldb::ProcessSP &process_sp)
43+
InstrumentationRuntimeASan(const lldb::ProcessSP &process_sp)
4444
: lldb_private::InstrumentationRuntime(process_sp) {}
4545

4646
const RegularExpression &GetPatternForRuntimeLibrary() override;

lldb/tools/lldb-test/SystemInitializerTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
4545
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
4646
#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
47-
#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
47+
#include "Plugins/InstrumentationRuntime/ASan/InstrumentationRuntimeASan.h"
4848
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
4949
#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
5050
#include "Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h"
@@ -193,7 +193,7 @@ llvm::Error SystemInitializerTest::Initialize() {
193193
ProcessMachCore::Initialize();
194194
minidump::ProcessMinidump::Initialize();
195195
MemoryHistoryASan::Initialize();
196-
AddressSanitizerRuntime::Initialize();
196+
InstrumentationRuntimeASan::Initialize();
197197
ThreadSanitizerRuntime::Initialize();
198198
UndefinedBehaviorSanitizerRuntime::Initialize();
199199
MainThreadCheckerRuntime::Initialize();
@@ -286,7 +286,7 @@ void SystemInitializerTest::Terminate() {
286286
ProcessMachCore::Terminate();
287287
minidump::ProcessMinidump::Terminate();
288288
MemoryHistoryASan::Terminate();
289-
AddressSanitizerRuntime::Terminate();
289+
InstrumentationRuntimeASan::Terminate();
290290
ThreadSanitizerRuntime::Terminate();
291291
UndefinedBehaviorSanitizerRuntime::Terminate();
292292
MainThreadCheckerRuntime::Terminate();

0 commit comments

Comments
 (0)