summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/DynamicLoader
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/DynamicLoader')
-rw-r--r--lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp42
-rw-r--r--lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp4
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp29
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp4
-rw-r--r--lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp14
-rw-r--r--lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp6
-rw-r--r--lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp2
7 files changed, 51 insertions, 50 deletions
diff --git a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index 760f344e5ab..242085ac872 100644
--- a/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -73,9 +73,9 @@ static constexpr OptionEnumValueElement g_kaslr_kernel_scan_enum_values[] = {
"on 32-bit targets)."}};
static constexpr PropertyDefinition g_properties[] = {
- {"load-kexts", OptionValue::eTypeBoolean, true, true, NULL, {},
+ {"load-kexts", OptionValue::eTypeBoolean, true, true, nullptr, {},
"Automatically loads kext images when attaching to a kernel."},
- {"scan-type", OptionValue::eTypeEnum, true, eKASLRScanNearPC, NULL,
+ {"scan-type", OptionValue::eTypeEnum, true, eKASLRScanNearPC, nullptr,
OptionEnumValues(g_kaslr_kernel_scan_enum_values),
"Control how many reads lldb will make while searching for a Darwin "
"kernel on attach."}};
@@ -99,13 +99,13 @@ public:
bool GetLoadKexts() const {
const uint32_t idx = ePropertyLoadKexts;
return m_collection_sp->GetPropertyAtIndexAsBoolean(
- NULL, idx, g_properties[idx].default_uint_value != 0);
+ nullptr, idx, g_properties[idx].default_uint_value != 0);
}
KASLRScanType GetScanType() const {
const uint32_t idx = ePropertyScanType;
return (KASLRScanType)m_collection_sp->GetPropertyAtIndexAsEnumeration(
- NULL, idx, g_properties[idx].default_uint_value);
+ nullptr, idx, g_properties[idx].default_uint_value);
}
};
@@ -132,7 +132,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
ObjectFile *object_file = exe_module->GetObjectFile();
if (object_file) {
if (object_file->GetStrata() != ObjectFile::eStrataKernel) {
- return NULL;
+ return nullptr;
}
}
}
@@ -149,7 +149,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
case llvm::Triple::WatchOS:
// NEED_BRIDGEOS_TRIPLE case llvm::Triple::BridgeOS:
if (triple_ref.getVendor() != llvm::Triple::Apple) {
- return NULL;
+ return nullptr;
}
break;
// If we have triple like armv7-unknown-unknown, we should try looking for
@@ -157,7 +157,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
case llvm::Triple::UnknownOS:
break;
default:
- return NULL;
+ return nullptr;
break;
}
}
@@ -171,7 +171,7 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
process->SetCanRunCode(false);
return new DynamicLoaderDarwinKernel(process, kernel_load_address);
}
- return NULL;
+ return nullptr;
}
lldb::addr_t
@@ -198,11 +198,11 @@ DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process *process) {
lldb::addr_t
DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) {
Module *exe_module = process->GetTarget().GetExecutableModulePointer();
- if (exe_module == NULL)
+ if (exe_module == nullptr)
return LLDB_INVALID_ADDRESS;
ObjectFile *exe_objfile = exe_module->GetObjectFile();
- if (exe_objfile == NULL)
+ if (exe_objfile == nullptr)
return LLDB_INVALID_ADDRESS;
if (exe_objfile->GetType() != ObjectFile::eTypeExecutable ||
@@ -282,7 +282,7 @@ DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) {
}
ThreadSP thread = process->GetThreadList().GetSelectedThread();
- if (thread.get() == NULL)
+ if (thread.get() == nullptr)
return LLDB_INVALID_ADDRESS;
addr_t pc = thread->GetRegisterContext()->GetPC(LLDB_INVALID_ADDRESS);
@@ -454,7 +454,7 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
return UUID();
ObjectFile *exe_objfile = memory_module_sp->GetObjectFile();
- if (exe_objfile == NULL) {
+ if (exe_objfile == nullptr) {
if (log)
log->Printf("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress "
"found a binary at 0x%" PRIx64
@@ -541,7 +541,7 @@ void DynamicLoaderDarwinKernel::Clear(bool clear_process) {
m_process->ClearBreakpointSiteByID(m_break_id);
if (clear_process)
- m_process = NULL;
+ m_process = nullptr;
m_kernel.Clear();
m_known_kexts.clear();
m_kext_summary_header_ptr_addr.Clear();
@@ -638,7 +638,7 @@ UUID DynamicLoaderDarwinKernel::KextImageInfo::GetUUID() const {
bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
Process *process) {
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (m_memory_module_sp.get() != NULL)
+ if (m_memory_module_sp.get() != nullptr)
return true;
if (m_load_address == LLDB_INVALID_ADDRESS)
return false;
@@ -658,7 +658,7 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
ModuleSP memory_module_sp =
process->ReadModuleFromMemory(file_spec, m_load_address, size_to_read);
- if (memory_module_sp.get() == NULL)
+ if (memory_module_sp.get() == nullptr)
return false;
bool is_kernel = false;
@@ -806,9 +806,9 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
FileSpec kext_filespec(m_name.c_str());
FileSpecList search_paths = target.GetExecutableSearchPaths();
kext_bundle_module_spec.GetFileSpec() = kext_filespec;
- platform_sp->GetSharedModule(
- kext_bundle_module_spec, process, m_module_sp,
- &search_paths, NULL, NULL);
+ platform_sp->GetSharedModule(kext_bundle_module_spec, process,
+ m_module_sp, &search_paths, nullptr,
+ nullptr);
}
}
@@ -1378,7 +1378,7 @@ uint32_t DynamicLoaderDarwinKernel::ReadKextSummaries(
lldb::offset_t offset = kext_summary_offset;
const void *name_data =
extractor.GetData(&offset, KERNEL_MODULE_MAX_NAME);
- if (name_data == NULL)
+ if (name_data == nullptr)
break;
image_infos[i].SetName((const char *)name_data);
UUID uuid = UUID::fromOptionalData(extractor.GetData(&offset, 16), 16);
@@ -1426,7 +1426,7 @@ void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
void DynamicLoaderDarwinKernel::PutToLog(Log *log) const {
- if (log == NULL)
+ if (log == nullptr)
return;
std::lock_guard<std::recursive_mutex> guard(m_mutex);
@@ -1464,7 +1464,7 @@ void DynamicLoaderDarwinKernel::SetNotificationBreakpointIfNeeded() {
module_spec_list.Append(m_kernel.GetModule()->GetFileSpec());
Breakpoint *bp =
m_process->GetTarget()
- .CreateBreakpoint(&module_spec_list, NULL,
+ .CreateBreakpoint(&module_spec_list, nullptr,
"OSKextLoadedKextSummariesUpdated",
eFunctionNameTypeFull, eLanguageTypeUnknown, 0,
skip_prologue, internal_bp, hardware)
diff --git a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
index 0fb05e99a07..23c8416f498 100644
--- a/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
@@ -104,7 +104,7 @@ DynamicLoader *DynamicLoaderHexagonDYLD::CreateInstance(Process *process,
if (create)
return new DynamicLoaderHexagonDYLD(process);
- return NULL;
+ return nullptr;
}
DynamicLoaderHexagonDYLD::DynamicLoaderHexagonDYLD(Process *process)
@@ -420,7 +420,7 @@ DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(Thread &thread,
const SymbolContext &context = frame->GetSymbolContext(eSymbolContextSymbol);
Symbol *sym = context.symbol;
- if (sym == NULL || !sym->IsTrampoline())
+ if (sym == nullptr || !sym->IsTrampoline())
return thread_plan_sp;
const ConstString sym_name = sym->GetMangled().GetName(
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 7475b1a87aa..339aeaec50f 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -84,7 +84,7 @@ void DynamicLoaderDarwin::DidLaunch() {
void DynamicLoaderDarwin::Clear(bool clear_process) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (clear_process)
- m_process = NULL;
+ m_process = nullptr;
m_dyld_image_infos.clear();
m_dyld_image_infos_stop_id = UINT32_MAX;
m_dyld.Clear(false);
@@ -115,7 +115,7 @@ ModuleSP DynamicLoaderDarwin::FindTargetModuleForImageInfo(
// We'll call Target::ModulesDidLoad after all the modules have been
// added to the target, don't let it be called for every one.
module_sp = target.GetOrCreateModule(module_spec, false /* notify */);
- if (!module_sp || module_sp->GetObjectFile() == NULL)
+ if (!module_sp || module_sp->GetObjectFile() == nullptr)
module_sp = m_process->ReadModuleFromMemory(image_info.file_spec,
image_info.address);
@@ -533,8 +533,8 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
if (exe_idx != UINT32_MAX) {
const bool can_create = true;
- ModuleSP exe_module_sp(
- FindTargetModuleForImageInfo(image_infos[exe_idx], can_create, NULL));
+ ModuleSP exe_module_sp(FindTargetModuleForImageInfo(image_infos[exe_idx],
+ can_create, nullptr));
if (exe_module_sp) {
if (log)
log->Printf("Found executable module: %s",
@@ -549,8 +549,8 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
if (dyld_idx != UINT32_MAX) {
const bool can_create = true;
- ModuleSP dyld_sp =
- FindTargetModuleForImageInfo(image_infos[dyld_idx], can_create, NULL);
+ ModuleSP dyld_sp = FindTargetModuleForImageInfo(image_infos[dyld_idx],
+ can_create, nullptr);
if (dyld_sp.get()) {
if (log)
log->Printf("Found dyld module: %s",
@@ -567,7 +567,7 @@ void DynamicLoaderDarwin::UpdateDYLDImageInfoFromNewImageInfo(
if (image_info.header.filetype == llvm::MachO::MH_DYLINKER) {
const bool can_create = true;
ModuleSP dyld_sp =
- FindTargetModuleForImageInfo(image_info, can_create, NULL);
+ FindTargetModuleForImageInfo(image_info, can_create, nullptr);
if (dyld_sp.get()) {
Target &target = m_process->GetTarget();
target.GetImages().AppendIfNeeded(dyld_sp);
@@ -605,7 +605,7 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
m_dyld_image_infos.push_back(image_infos[idx]);
ModuleSP image_module_sp(
- FindTargetModuleForImageInfo(image_infos[idx], true, NULL));
+ FindTargetModuleForImageInfo(image_infos[idx], true, nullptr));
if (image_module_sp) {
ObjectFile *objfile = image_module_sp->GetObjectFile();
@@ -628,7 +628,7 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
commpage_image_module_sp = target.GetOrCreateModule(module_spec,
true /* notify */);
if (!commpage_image_module_sp ||
- commpage_image_module_sp->GetObjectFile() == NULL) {
+ commpage_image_module_sp->GetObjectFile() == nullptr) {
commpage_image_module_sp = m_process->ReadModuleFromMemory(
image_infos[idx].file_spec, image_infos[idx].address);
// Always load a memory image right away in the target in case
@@ -686,15 +686,16 @@ bool DynamicLoaderDarwin::AlwaysRelyOnEHUnwindInfo(SymbolContext &sym_ctx) {
if (sym_ctx.symbol) {
module_sp = sym_ctx.symbol->GetAddressRef().GetModule();
}
- if (module_sp.get() == NULL && sym_ctx.function) {
+ if (module_sp.get() == nullptr && sym_ctx.function) {
module_sp =
sym_ctx.function->GetAddressRange().GetBaseAddress().GetModule();
}
- if (module_sp.get() == NULL)
+ if (module_sp.get() == nullptr)
return false;
ObjCLanguageRuntime *objc_runtime = m_process->GetObjCLanguageRuntime();
- return objc_runtime != NULL && objc_runtime->IsModuleObjCLibrary(module_sp);
+ return objc_runtime != nullptr &&
+ objc_runtime->IsModuleObjCLibrary(module_sp);
}
// Dump a Segment to the file handle provided.
@@ -719,7 +720,7 @@ DynamicLoaderDarwin::ImageInfo::FindSegment(ConstString name) const {
if (segments[i].name == name)
return &segments[i];
}
- return NULL;
+ return nullptr;
}
// Dump an image info structure to the file handle provided.
@@ -791,7 +792,7 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
TargetSP target_sp(thread.CalculateTarget());
- if (current_symbol != NULL) {
+ if (current_symbol != nullptr) {
std::vector<Address> addresses;
if (current_symbol->IsTrampoline()) {
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
index 29e4ac0654a..6bc65ecef35 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
@@ -68,7 +68,7 @@ DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process,
if (create)
return new DynamicLoaderMacOS(process);
- return NULL;
+ return nullptr;
}
// Constructor
@@ -334,7 +334,7 @@ void DynamicLoaderMacOS::AddBinaries(
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
void DynamicLoaderMacOS::PutToLog(Log *log) const {
- if (log == NULL)
+ if (log == nullptr)
return;
}
diff --git a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index 9c0125a6db0..7d00380bfcd 100644
--- a/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -88,7 +88,7 @@ DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process,
if (create)
return new DynamicLoaderMacOSXDYLD(process);
- return NULL;
+ return nullptr;
}
// Constructor
@@ -608,7 +608,7 @@ bool DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress(
// We'll remove them all at one go later on.
ModuleSP unload_image_module_sp(
- FindTargetModuleForImageInfo(image_infos[idx], false, NULL));
+ FindTargetModuleForImageInfo(image_infos[idx], false, nullptr));
if (unload_image_module_sp.get()) {
// When we unload, be sure to use the image info from the old list,
// since that has sections correctly filled in.
@@ -794,7 +794,7 @@ bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr,
if (data.GetU32(&offset, &header->cputype,
(sizeof(llvm::MachO::mach_header) / sizeof(uint32_t)) -
1)) {
- if (load_command_data == NULL)
+ if (load_command_data == nullptr)
return true; // We were able to read the mach_header and weren't asked
// to read the load command bytes
@@ -922,7 +922,7 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
&data))
continue;
- ParseLoadCommands(data, image_infos[i], NULL);
+ ParseLoadCommands(data, image_infos[i], nullptr);
if (image_infos[i].header.filetype == llvm::MachO::MH_EXECUTE)
exe_idx = i;
@@ -933,8 +933,8 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
if (exe_idx < image_infos.size()) {
const bool can_create = true;
- ModuleSP exe_module_sp(
- FindTargetModuleForImageInfo(image_infos[exe_idx], can_create, NULL));
+ ModuleSP exe_module_sp(FindTargetModuleForImageInfo(image_infos[exe_idx],
+ can_create, nullptr));
if (exe_module_sp) {
UpdateImageLoadAddress(exe_module_sp.get(), image_infos[exe_idx]);
@@ -969,7 +969,7 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
// Dump the _dyld_all_image_infos members and all current image infos that we
// have parsed to the file handle provided.
void DynamicLoaderMacOSXDYLD::PutToLog(Log *log) const {
- if (log == NULL)
+ if (log == nullptr)
return;
std::lock_guard<std::recursive_mutex> guard(m_mutex);
diff --git a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index 31ab9faca70..587b2d36acc 100644
--- a/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/lldb/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -68,7 +68,7 @@ DynamicLoader *DynamicLoaderPOSIXDYLD::CreateInstance(Process *process,
if (create)
return new DynamicLoaderPOSIXDYLD(process);
- return NULL;
+ return nullptr;
}
DynamicLoaderPOSIXDYLD::DynamicLoaderPOSIXDYLD(Process *process)
@@ -463,7 +463,7 @@ DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(Thread &thread,
const SymbolContext &context = frame->GetSymbolContext(eSymbolContextSymbol);
Symbol *sym = context.symbol;
- if (sym == NULL || !sym->IsTrampoline())
+ if (sym == nullptr || !sym->IsTrampoline())
return thread_plan_sp;
ConstString sym_name = sym->GetName();
@@ -638,7 +638,7 @@ addr_t DynamicLoaderPOSIXDYLD::GetEntryPoint() {
if (m_entry_point != LLDB_INVALID_ADDRESS)
return m_entry_point;
- if (m_auxv == NULL)
+ if (m_auxv == nullptr)
return LLDB_INVALID_ADDRESS;
AuxVector::iterator I = m_auxv->FindEntry(AuxVector::AUXV_AT_ENTRY);
diff --git a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
index 88ca2e2de01..6bc951c4d35 100644
--- a/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
+++ b/lldb/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
@@ -43,7 +43,7 @@ DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process,
if (create)
return new DynamicLoaderStatic(process);
- return NULL;
+ return nullptr;
}
// Constructor
OpenPOWER on IntegriCloud