summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins
diff options
context:
space:
mode:
authorKonrad Kleine <kkleine@redhat.com>2019-05-23 11:14:47 +0000
committerKonrad Kleine <kkleine@redhat.com>2019-05-23 11:14:47 +0000
commit248a13057a4adbdb8d511b1458daf39d01a4b520 (patch)
tree1209fb0822f0c14237eb9935e30da465014a6eda /lldb/source/Plugins
parent32d976bac194d78656974e3e05bf52997a06f509 (diff)
downloadbcm5719-llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.tar.gz
bcm5719-llvm-248a13057a4adbdb8d511b1458daf39d01a4b520.zip
[lldb] NFC modernize codebase with modernize-use-nullptr
Summary: NFC = [[ https://llvm.org/docs/Lexicon.html#nfc | Non functional change ]] This commit is the result of modernizing the LLDB codebase by using `nullptr` instread of `0` or `NULL`. See https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html for more information. This is the command I ran and I to fix and format the code base: ``` run-clang-tidy.py \ -header-filter='.*' \ -checks='-*,modernize-use-nullptr' \ -fix ~/dev/llvm-project/lldb/.* \ -format \ -style LLVM \ -p ~/llvm-builds/debug-ninja-gcc ``` NOTE: There were also changes to `llvm/utils/unittest` but I did not include them because I felt that maybe this library shall be updated in isolation somehow. NOTE: I know this is a rather large commit but it is a nobrainer in most parts. Reviewers: martong, espindola, shafik, #lldb, JDevlieghere Reviewed By: JDevlieghere Subscribers: arsenm, jvesely, nhaehnle, hiraditya, JDevlieghere, teemperor, rnkovacs, emaste, kubamracek, nemanjai, ki.stfu, javed.absar, arichardson, kbarton, jrtc27, MaskRay, atanasyan, dexonsmith, arphaman, jfb, jsji, jdoerfert, lldb-commits, llvm-commits Tags: #lldb, #llvm Differential Revision: https://reviews.llvm.org/D61847 llvm-svn: 361484
Diffstat (limited to 'lldb/source/Plugins')
-rw-r--r--lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp6
-rw-r--r--lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp16
-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
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp18
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp12
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp55
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h6
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp39
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h15
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h8
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp4
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp2
-rw-r--r--lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp55
-rw-r--r--lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp14
-rw-r--r--lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp14
-rw-r--r--lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp4
-rw-r--r--lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp10
-rw-r--r--lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp10
-rw-r--r--lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp2
-rw-r--r--lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp2
-rw-r--r--lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp10
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp27
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp10
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp4
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp28
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp16
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h5
-rw-r--r--lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp4
-rw-r--r--lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp2
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp10
-rw-r--r--lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h2
-rw-r--r--lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp2
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp32
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp30
-rw-r--r--lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp12
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp298
-rw-r--r--lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp10
-rw-r--r--lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp16
-rw-r--r--lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp4
-rw-r--r--lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp4
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp16
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp4
-rw-r--r--lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp24
-rw-r--r--lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp4
-rw-r--r--lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp22
-rw-r--r--lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp23
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp10
-rw-r--r--lldb/source/Plugins/Process/Linux/ProcessorTrace.cpp4
-rw-r--r--lldb/source/Plugins/Process/POSIX/ProcessMessage.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp20
-rw-r--r--lldb/source/Plugins/Process/Utility/HistoryThread.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp102
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp28
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp38
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextDummy.cpp8
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextHistory.cpp8
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp20
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp6
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp4
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp2
-rw-r--r--lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp8
-rw-r--r--lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp12
-rw-r--r--lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp8
-rw-r--r--lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp10
-rw-r--r--lldb/source/Plugins/Process/elf-core/ThreadElfCore.h2
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp4
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp18
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp10
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp37
-rw-r--r--lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp93
-rw-r--r--lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp14
-rw-r--r--lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp3
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp48
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp28
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h23
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp9
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp6
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp10
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp125
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h2
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp56
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp4
-rw-r--r--lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp12
-rw-r--r--lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp12
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp2
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp4
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp4
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp2
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp17
-rw-r--r--lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp10
-rw-r--r--lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h2
-rw-r--r--lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp2
129 files changed, 992 insertions, 973 deletions
diff --git a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
index c97c76c0a91..dd47ac7cbe3 100644
--- a/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ b/lldb/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -1739,8 +1739,8 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
uint32_t index = 0;
for (index = 0; index < num_children; index++) {
std::string name;
- base_type =
- compiler_type.GetFieldAtIndex(index, name, NULL, NULL, NULL);
+ base_type = compiler_type.GetFieldAtIndex(index, name, nullptr,
+ nullptr, nullptr);
if (base_type.IsFloatingPointType(float_count, is_complex)) {
llvm::Optional<uint64_t> base_byte_size =
@@ -1799,7 +1799,7 @@ ValueObjectSP ABISysV_arm::GetReturnValueObjectImpl(
const RegisterInfo *reg_info =
reg_ctx->GetRegisterInfo(eRegisterKindDWARF, regnum);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
break;
RegisterValue reg_value;
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
index 36261a335a8..44c75fc953c 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
@@ -356,7 +356,7 @@ public:
return;
else {
const uint8_t *bytes = data.PeekData(offset, inst_size);
- if (bytes == NULL)
+ if (bytes == nullptr)
return;
m_opcode_name.assign(".byte");
m_opcode.SetOpcodeBytes(bytes, inst_size);
@@ -956,7 +956,7 @@ DisassemblerLLVMC::MCDisasmInstance::Create(const char *triple, const char *cpu,
return Instance();
std::unique_ptr<llvm::MCContext> context_up(
- new llvm::MCContext(asm_info_up.get(), reg_info_up.get(), 0));
+ new llvm::MCContext(asm_info_up.get(), reg_info_up.get(), nullptr));
if (!context_up)
return Instance();
@@ -1079,7 +1079,7 @@ bool DisassemblerLLVMC::MCDisasmInstance::IsCall(llvm::MCInst &mc_inst) const {
DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
const char *flavor_string)
- : Disassembler(arch, flavor_string), m_exe_ctx(NULL), m_inst(NULL),
+ : Disassembler(arch, flavor_string), m_exe_ctx(nullptr), m_inst(nullptr),
m_data_from_file(false) {
if (!FlavorValidForArchSpec(arch, m_flavor.c_str())) {
m_flavor.assign("default");
@@ -1242,7 +1242,7 @@ Disassembler *DisassemblerLLVMC::CreateInstance(const ArchSpec &arch,
if (disasm_up.get() && disasm_up->IsValid())
return disasm_up.release();
}
- return NULL;
+ return nullptr;
}
size_t DisassemblerLLVMC::DecodeInstructions(const Address &base_addr,
@@ -1329,7 +1329,7 @@ const char *DisassemblerLLVMC::SymbolLookupCallback(void *disassembler,
bool DisassemblerLLVMC::FlavorValidForArchSpec(
const lldb_private::ArchSpec &arch, const char *flavor) {
llvm::Triple triple = arch.GetTriple();
- if (flavor == NULL || strcmp(flavor, "default") == 0)
+ if (flavor == nullptr || strcmp(flavor, "default") == 0)
return true;
if (triple.getArch() == llvm::Triple::x86 ||
@@ -1358,7 +1358,7 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
if (*type_ptr) {
if (m_exe_ctx && m_inst) {
// std::string remove_this_prior_to_checkin;
- Target *target = m_exe_ctx ? m_exe_ctx->GetTargetPtr() : NULL;
+ Target *target = m_exe_ctx ? m_exe_ctx->GetTargetPtr() : nullptr;
Address value_so_addr;
Address pc_so_addr;
if (m_inst->UsingFileAddress()) {
@@ -1423,8 +1423,8 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
}
*type_ptr = LLVMDisassembler_ReferenceType_InOut_None;
- *name = NULL;
- return NULL;
+ *name = nullptr;
+ return nullptr;
}
// PluginInterface protocol
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
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp
index 3fecb0c7da9..369f88327dd 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTDumper.cpp
@@ -85,7 +85,7 @@ void ASTDumper::ToLog(Log *log, const char *prefix) {
memcpy(str, m_dump.c_str(), len);
- char *end = NULL;
+ char *end = nullptr;
end = strchr(str, '\n');
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
index 71e13070897..5dc39e8dac4 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
@@ -34,8 +34,9 @@ using namespace lldb_private;
ASTResultSynthesizer::ASTResultSynthesizer(ASTConsumer *passthrough,
bool top_level, Target &target)
- : m_ast_context(NULL), m_passthrough(passthrough), m_passthrough_sema(NULL),
- m_target(target), m_sema(NULL), m_top_level(top_level) {
+ : m_ast_context(nullptr), m_passthrough(passthrough),
+ m_passthrough_sema(nullptr), m_target(target), m_sema(nullptr),
+ m_top_level(top_level) {
if (!m_passthrough)
return;
@@ -311,7 +312,7 @@ bool ASTResultSynthesizer::SynthesizeBodyResult(CompoundStmt *Body,
(is_lvalue ? "lvalue" : "rvalue"), s.c_str());
}
- clang::VarDecl *result_decl = NULL;
+ clang::VarDecl *result_decl = nullptr;
if (is_lvalue) {
IdentifierInfo *result_ptr_id;
@@ -329,14 +330,14 @@ bool ASTResultSynthesizer::SynthesizeBodyResult(CompoundStmt *Body,
QualType ptr_qual_type;
- if (expr_qual_type->getAs<ObjCObjectType>() != NULL)
+ if (expr_qual_type->getAs<ObjCObjectType>() != nullptr)
ptr_qual_type = Ctx.getObjCObjectPointerType(expr_qual_type);
else
ptr_qual_type = Ctx.getPointerType(expr_qual_type);
result_decl =
VarDecl::Create(Ctx, DC, SourceLocation(), SourceLocation(),
- result_ptr_id, ptr_qual_type, NULL, SC_Static);
+ result_ptr_id, ptr_qual_type, nullptr, SC_Static);
if (!result_decl)
return false;
@@ -350,8 +351,9 @@ bool ASTResultSynthesizer::SynthesizeBodyResult(CompoundStmt *Body,
} else {
IdentifierInfo &result_id = Ctx.Idents.get("$__lldb_expr_result");
- result_decl = VarDecl::Create(Ctx, DC, SourceLocation(), SourceLocation(),
- &result_id, expr_qual_type, NULL, SC_Static);
+ result_decl =
+ VarDecl::Create(Ctx, DC, SourceLocation(), SourceLocation(), &result_id,
+ expr_qual_type, nullptr, SC_Static);
if (!result_decl)
return false;
@@ -507,7 +509,7 @@ void ASTResultSynthesizer::InitializeSema(Sema &S) {
}
void ASTResultSynthesizer::ForgetSema() {
- m_sema = NULL;
+ m_sema = nullptr;
if (m_passthrough_sema)
m_passthrough_sema->ForgetSema();
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp
index 1d8e6931cb9..190eacaa2b6 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.cpp
@@ -29,9 +29,9 @@ using namespace lldb_private;
ASTStructExtractor::ASTStructExtractor(ASTConsumer *passthrough,
const char *struct_name,
ClangFunctionCaller &function)
- : m_ast_context(NULL), m_passthrough(passthrough), m_passthrough_sema(NULL),
- m_sema(NULL), m_action(NULL), m_function(function),
- m_struct_name(struct_name) {
+ : m_ast_context(nullptr), m_passthrough(passthrough),
+ m_passthrough_sema(nullptr), m_sema(nullptr), m_action(nullptr),
+ m_function(function), m_struct_name(struct_name) {
if (!m_passthrough)
return;
@@ -57,7 +57,7 @@ void ASTStructExtractor::ExtractFromFunctionDecl(FunctionDecl *F) {
if (!body_compound_stmt)
return; // do we have to handle this?
- RecordDecl *struct_decl = NULL;
+ RecordDecl *struct_decl = nullptr;
StringRef desired_name(m_struct_name);
@@ -177,8 +177,8 @@ void ASTStructExtractor::InitializeSema(Sema &S) {
}
void ASTStructExtractor::ForgetSema() {
- m_sema = NULL;
- m_action = NULL;
+ m_sema = nullptr;
+ m_action = nullptr;
if (m_passthrough_sema)
m_passthrough_sema->ForgetSema();
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index 92191793d19..632594f1c46 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -51,7 +51,7 @@ private:
ClangASTSource::ClangASTSource(const lldb::TargetSP &target)
: m_import_in_progress(false), m_lookups_enabled(false), m_target(target),
- m_ast_context(NULL), m_active_lexical_decls(), m_active_lookups() {
+ m_ast_context(nullptr), m_active_lexical_decls(), m_active_lookups() {
if (!target->GetUseModernTypeLookup()) {
m_ast_importer_sp = m_target->GetClangASTImporter();
}
@@ -441,8 +441,8 @@ void ClangASTSource::CompleteType(clang::ObjCInterfaceDecl *interface_decl) {
return;
}
- Decl *original_decl = NULL;
- ASTContext *original_ctx = NULL;
+ Decl *original_decl = nullptr;
+ ASTContext *original_ctx = nullptr;
if (m_ast_importer_sp->ResolveDeclOrigin(interface_decl, &original_decl,
&original_ctx)) {
@@ -475,12 +475,12 @@ clang::ObjCInterfaceDecl *ClangASTSource::GetCompleteObjCInterface(
lldb::ProcessSP process(m_target->GetProcessSP());
if (!process)
- return NULL;
+ return nullptr;
ObjCLanguageRuntime *language_runtime(process->GetObjCLanguageRuntime());
if (!language_runtime)
- return NULL;
+ return nullptr;
ConstString class_name(interface_decl->getNameAsString().c_str());
@@ -488,7 +488,7 @@ clang::ObjCInterfaceDecl *ClangASTSource::GetCompleteObjCInterface(
language_runtime->LookupInCompleteClassCache(class_name));
if (!complete_type_sp)
- return NULL;
+ return nullptr;
TypeFromUser complete_type =
TypeFromUser(complete_type_sp->GetFullCompilerType());
@@ -496,7 +496,7 @@ clang::ObjCInterfaceDecl *ClangASTSource::GetCompleteObjCInterface(
complete_type.GetOpaqueQualType();
if (!complete_opaque_type)
- return NULL;
+ return nullptr;
const clang::Type *complete_clang_type =
QualType::getFromOpaquePtr(complete_opaque_type).getTypePtr();
@@ -504,7 +504,7 @@ clang::ObjCInterfaceDecl *ClangASTSource::GetCompleteObjCInterface(
dyn_cast<ObjCInterfaceType>(complete_clang_type);
if (!complete_interface_type)
- return NULL;
+ return nullptr;
ObjCInterfaceDecl *complete_iface_decl(complete_interface_type->getDecl());
@@ -569,8 +569,8 @@ void ClangASTSource::FindExternalLexicalDecls(
current_id, static_cast<const void *>(m_ast_context));
}
- Decl *original_decl = NULL;
- ASTContext *original_ctx = NULL;
+ Decl *original_decl = nullptr;
+ ASTContext *original_ctx = nullptr;
if (!m_ast_importer_sp->ResolveDeclOrigin(context_decl, &original_decl,
&original_ctx))
@@ -993,9 +993,9 @@ void ClangASTSource::FindExternalVisibleDecls(
template <class D> class TaggedASTDecl {
public:
- TaggedASTDecl() : decl(NULL) {}
+ TaggedASTDecl() : decl(nullptr) {}
TaggedASTDecl(D *_decl) : decl(_decl) {}
- bool IsValid() const { return (decl != NULL); }
+ bool IsValid() const { return (decl != nullptr); }
bool IsInvalid() const { return !IsValid(); }
D *operator->() const { return decl; }
D *decl;
@@ -1028,7 +1028,7 @@ public:
template <class D>
DeclFromUser<D> DeclFromParser<D>::GetOrigin(ClangASTSource &source) {
DeclFromUser<> origin_decl;
- source.ResolveDeclOrigin(this->decl, &origin_decl.decl, NULL);
+ source.ResolveDeclOrigin(this->decl, &origin_decl.decl, nullptr);
if (origin_decl.IsInvalid())
return DeclFromUser<D>();
return DeclFromUser<D>(dyn_cast<D>(origin_decl.decl));
@@ -1158,8 +1158,8 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
return;
do {
- Decl *original_decl = NULL;
- ASTContext *original_ctx = NULL;
+ Decl *original_decl = nullptr;
+ ASTContext *original_ctx = nullptr;
m_ast_importer_sp->ResolveDeclOrigin(interface_decl, &original_decl,
&original_ctx);
@@ -2063,12 +2063,12 @@ clang::NamedDecl *NameSearchContext::AddVarDecl(const CompilerType &type) {
assert(type && "Type for variable must be valid!");
if (!type.IsValid())
- return NULL;
+ return nullptr;
ClangASTContext *lldb_ast =
llvm::dyn_cast<ClangASTContext>(type.GetTypeSystem());
if (!lldb_ast)
- return NULL;
+ return nullptr;
IdentifierInfo *ii = m_decl_name.getAsIdentifierInfo();
@@ -2076,7 +2076,7 @@ clang::NamedDecl *NameSearchContext::AddVarDecl(const CompilerType &type) {
clang::NamedDecl *Decl = VarDecl::Create(
*ast, const_cast<DeclContext *>(m_decl_context), SourceLocation(),
- SourceLocation(), ii, ClangUtil::GetQualType(type), 0, SC_Static);
+ SourceLocation(), ii, ClangUtil::GetQualType(type), nullptr, SC_Static);
m_decls.push_back(Decl);
return Decl;
@@ -2087,15 +2087,15 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
assert(type && "Type for variable must be valid!");
if (!type.IsValid())
- return NULL;
+ return nullptr;
if (m_function_types.count(type))
- return NULL;
+ return nullptr;
ClangASTContext *lldb_ast =
llvm::dyn_cast<ClangASTContext>(type.GetTypeSystem());
if (!lldb_ast)
- return NULL;
+ return nullptr;
m_function_types.insert(type);
@@ -2124,7 +2124,7 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
clang::FunctionDecl *func_decl = FunctionDecl::Create(
*ast, context, SourceLocation(), SourceLocation(), decl_name, qual_type,
- NULL, SC_Extern, isInlineSpecified, hasWrittenPrototype,
+ nullptr, SC_Extern, isInlineSpecified, hasWrittenPrototype,
isConstexprSpecified);
// We have to do more than just synthesize the FunctionDecl. We have to
@@ -2143,9 +2143,10 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
for (ArgIndex = 0; ArgIndex < NumArgs; ++ArgIndex) {
QualType arg_qual_type(func_proto_type->getParamType(ArgIndex));
- parm_var_decls.push_back(ParmVarDecl::Create(
- *ast, const_cast<DeclContext *>(context), SourceLocation(),
- SourceLocation(), NULL, arg_qual_type, NULL, SC_Static, NULL));
+ parm_var_decls.push_back(
+ ParmVarDecl::Create(*ast, const_cast<DeclContext *>(context),
+ SourceLocation(), SourceLocation(), nullptr,
+ arg_qual_type, nullptr, SC_Static, nullptr));
}
func_decl->setParams(ArrayRef<ParmVarDecl *>(parm_var_decls));
@@ -2166,7 +2167,7 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
ClangASTContext::IsOperator(decl_name.getAsString().c_str(), op_kind)) {
if (!ClangASTContext::CheckOverloadedOperatorKindParameterCount(
false, op_kind, func_proto_type->getNumParams()))
- return NULL;
+ return nullptr;
}
m_decls.push_back(func_decl);
@@ -2214,7 +2215,7 @@ NameSearchContext::AddTypeDecl(const CompilerType &clang_type) {
return (NamedDecl *)interface_decl;
}
}
- return NULL;
+ return nullptr;
}
void NameSearchContext::AddLookupResult(clang::DeclContextLookupResult result) {
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
index 624c86a5174..7a8bacf48a8 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
@@ -45,15 +45,15 @@ public:
~ClangASTSource() override;
/// Interface stubs.
- clang::Decl *GetExternalDecl(uint32_t) override { return NULL; }
- clang::Stmt *GetExternalDeclStmt(uint64_t) override { return NULL; }
+ clang::Decl *GetExternalDecl(uint32_t) override { return nullptr; }
+ clang::Stmt *GetExternalDeclStmt(uint64_t) override { return nullptr; }
clang::Selector GetExternalSelector(uint32_t) override {
return clang::Selector();
}
uint32_t GetNumExternalSelectors() override { return 0; }
clang::CXXBaseSpecifier *
GetExternalCXXBaseSpecifiers(uint64_t Offset) override {
- return NULL;
+ return nullptr;
}
void MaterializeVisibleDecls(const clang::DeclContext *DC) { return; }
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
index 83cbe517643..496d5b40e3e 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
@@ -367,7 +367,7 @@ bool ClangExpressionDeclMap::AddPersistentVariable(const NamedDecl *decl,
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
ExecutionContext &exe_ctx = m_parser_vars->m_exe_ctx;
Target *target = exe_ctx.GetTargetPtr();
- if (target == NULL)
+ if (target == nullptr)
return false;
ClangASTContext *context(target->GetScratchClangASTContext());
@@ -951,7 +951,7 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
// Clang is looking for the type of "this"
- if (frame == NULL)
+ if (frame == nullptr)
return;
// Find the block that defines the function represented by "sym_ctx"
@@ -1277,7 +1277,8 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
}
}
if (target) {
- var = FindGlobalVariable(*target, module_sp, name, &namespace_decl, NULL);
+ var = FindGlobalVariable(*target, module_sp, name, &namespace_decl,
+ nullptr);
if (var) {
valobj = ValueObjectVariable::Create(target, var);
@@ -1434,8 +1435,8 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
}
if (sc_list.GetSize()) {
- Symbol *extern_symbol = NULL;
- Symbol *non_extern_symbol = NULL;
+ Symbol *extern_symbol = nullptr;
+ Symbol *non_extern_symbol = nullptr;
for (uint32_t index = 0, num_indices = sc_list.GetSize();
index < num_indices; ++index) {
@@ -1452,13 +1453,13 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
if (decl_ctx.IsClassMethod(nullptr, nullptr, nullptr))
continue;
- AddOneFunction(context, sym_ctx.function, NULL, current_id);
+ AddOneFunction(context, sym_ctx.function, nullptr, current_id);
context.m_found.function_with_type_info = true;
context.m_found.function = true;
} else if (sym_ctx.symbol) {
if (sym_ctx.symbol->GetType() == eSymbolTypeReExported && target) {
sym_ctx.symbol = sym_ctx.symbol->ResolveReExportedSymbol(*target);
- if (sym_ctx.symbol == NULL)
+ if (sym_ctx.symbol == nullptr)
continue;
}
@@ -1484,10 +1485,10 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
if (!context.m_found.function_with_type_info) {
if (extern_symbol) {
- AddOneFunction(context, NULL, extern_symbol, current_id);
+ AddOneFunction(context, nullptr, extern_symbol, current_id);
context.m_found.function = true;
} else if (non_extern_symbol) {
- AddOneFunction(context, NULL, non_extern_symbol, current_id);
+ AddOneFunction(context, nullptr, non_extern_symbol, current_id);
context.m_found.function = true;
}
}
@@ -1723,7 +1724,7 @@ void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
bool is_reference = pt.IsReferenceType();
- NamedDecl *var_decl = NULL;
+ NamedDecl *var_decl = nullptr;
if (is_reference)
var_decl = context.AddVarDecl(pt);
else
@@ -1740,7 +1741,7 @@ void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
entity->GetParserVars(GetParserID());
parser_vars->m_parser_type = pt;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_value = var_location;
parser_vars->m_lldb_var = var;
@@ -1783,7 +1784,7 @@ void ClangExpressionDeclMap::AddOneVariable(NameSearchContext &context,
->GetParserVars(GetParserID());
parser_vars->m_parser_type = parser_type;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_value.Clear();
if (log) {
@@ -1802,7 +1803,7 @@ void ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context,
Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();
- if (target == NULL)
+ if (target == nullptr)
return;
ASTContext *scratch_ast_context =
@@ -1841,7 +1842,7 @@ void ClangExpressionDeclMap::AddOneGenericVariable(NameSearchContext &context,
parser_vars->m_parser_type = parser_type;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_sym = &symbol;
if (log) {
@@ -1889,7 +1890,7 @@ bool ClangExpressionDeclMap::ResolveUnknownTypes() {
var_type.getAsOpaquePtr(),
ClangASTContext::GetASTContext(&var_decl->getASTContext()));
- lldb::opaque_compiler_type_t copied_type = 0;
+ lldb::opaque_compiler_type_t copied_type = nullptr;
if (m_ast_importer_sp) {
copied_type = m_ast_importer_sp->CopyType(
scratch_ast_context->getASTContext(), &var_decl->getASTContext(),
@@ -1962,7 +1963,7 @@ void ClangExpressionDeclMap::AddOneRegister(NameSearchContext &context,
entity->GetParserVars(GetParserID());
parser_vars->m_parser_type = parser_clang_type;
parser_vars->m_named_decl = var_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
parser_vars->m_lldb_value.Clear();
entity->m_flags |= ClangExpressionVariable::EVBareRegister;
@@ -1981,7 +1982,7 @@ void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- NamedDecl *function_decl = NULL;
+ NamedDecl *function_decl = nullptr;
Address fun_address;
CompilerType function_clang_type;
@@ -2141,7 +2142,7 @@ void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
}
parser_vars->m_named_decl = function_decl;
- parser_vars->m_llvm_value = NULL;
+ parser_vars->m_llvm_value = nullptr;
if (log) {
std::string function_str =
@@ -2194,7 +2195,7 @@ void ClangExpressionDeclMap::AddThisType(NameSearchContext &context,
CXXMethodDecl *method_decl =
ClangASTContext::GetASTContext(m_ast_context)
->AddMethodToCXXRecordType(
- copied_clang_type.GetOpaqueQualType(), "$__lldb_expr", NULL,
+ copied_clang_type.GetOpaqueQualType(), "$__lldb_expr", nullptr,
method_type, lldb::eAccessPublic, is_virtual, is_static,
is_inline, is_explicit, is_attr_used, is_artificial);
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
index a7e2ced2c45..03b73e6be39 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
@@ -242,9 +242,8 @@ public:
/// \return
/// Valid load address for the symbol
lldb::addr_t GetSymbolAddress(Target &target, Process *process,
- ConstString name,
- lldb::SymbolType symbol_type,
- Module *module = NULL);
+ ConstString name, lldb::SymbolType symbol_type,
+ Module *module = nullptr);
lldb::addr_t GetSymbolAddress(ConstString name,
lldb::SymbolType symbol_type);
@@ -331,7 +330,7 @@ private:
return m_exe_ctx.GetTargetPtr();
else if (m_sym_ctx.target_sp)
m_sym_ctx.target_sp.get();
- return NULL;
+ return nullptr;
}
ExecutionContext m_exe_ctx; ///< The execution context to use when parsing.
@@ -368,7 +367,7 @@ private:
struct StructVars {
StructVars()
: m_struct_alignment(0), m_struct_size(0), m_struct_laid_out(false),
- m_result_name(), m_object_pointer_type(NULL, NULL) {}
+ m_result_name(), m_object_pointer_type(nullptr, nullptr) {}
lldb::offset_t
m_struct_alignment; ///< The alignment of the struct in bytes.
@@ -421,7 +420,7 @@ private:
lldb::VariableSP FindGlobalVariable(Target &target, lldb::ModuleSP &module,
ConstString name,
CompilerDeclContext *namespace_decl,
- TypeFromUser *type = NULL);
+ TypeFromUser *type = nullptr);
/// Get the value of a variable in a given execution context and return the
/// associated Types if needed.
@@ -449,8 +448,8 @@ private:
/// Return true if the value was successfully filled in.
bool GetVariableValue(lldb::VariableSP &var,
lldb_private::Value &var_location,
- TypeFromUser *found_type = NULL,
- TypeFromParser *parser_type = NULL);
+ TypeFromUser *found_type = nullptr,
+ TypeFromParser *parser_type = nullptr);
/// Use the NameSearchContext to generate a Decl for the given LLDB
/// Variable, and put it in the Tuple list.
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index 0659851fa08..9fd9fe9a59f 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -1229,7 +1229,7 @@ lldb_private::Status ClangExpressionParser::PrepareForExecution(
type_system_helper->DeclMap(); // result can be NULL
if (decl_map) {
- Stream *error_stream = NULL;
+ Stream *error_stream = nullptr;
Target *target = exe_ctx.GetTargetPtr();
error_stream = target->GetDebugger().GetErrorFile().get();
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
index bb5e6e79870..eb7f74f20a2 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
@@ -117,8 +117,8 @@ public:
class ParserVars {
public:
ParserVars()
- : m_parser_type(), m_named_decl(NULL), m_llvm_value(NULL),
- m_lldb_value(), m_lldb_var(), m_lldb_sym(NULL) {}
+ : m_parser_type(), m_named_decl(nullptr), m_llvm_value(nullptr),
+ m_lldb_value(), m_lldb_var(), m_lldb_sym(nullptr) {}
TypeFromParser
m_parser_type; ///< The type of the variable according to the parser
@@ -152,7 +152,7 @@ public:
ParserVarMap::iterator i = m_parser_vars.find(parser_id);
if (i == m_parser_vars.end())
- return NULL;
+ return nullptr;
else
return &i->second;
}
@@ -186,7 +186,7 @@ public:
JITVarMap::iterator i = m_jit_vars.find(parser_id);
if (i == m_jit_vars.end())
- return NULL;
+ return nullptr;
else
return &i->second;
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
index bdcead230c5..24f6f2eb91b 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
@@ -72,7 +72,7 @@ class ClangFunctionCaller : public FunctionCaller {
/// Return the object that the parser should use when resolving external
/// values. May be NULL if everything should be self-contained.
- ClangExpressionDeclMap *DeclMap() override { return NULL; }
+ ClangExpressionDeclMap *DeclMap() override { return nullptr; }
/// Return the object that the parser should allow to access ASTs. May be
/// NULL if the ASTs do not need to be transformed.
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
index e77ba86eb10..912c9ef2e1b 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
@@ -48,7 +48,7 @@ void ClangPersistentVariables::RemovePersistentVariable(
return;
name++;
- if (strtoul(name, NULL, 0) == m_next_persistent_variable_id - 1)
+ if (strtoul(name, nullptr, 0) == m_next_persistent_variable_id - 1)
m_next_persistent_variable_id--;
}
@@ -72,7 +72,7 @@ ClangPersistentVariables::GetPersistentDecl(ConstString name) {
m_persistent_decls.find(name.GetCString());
if (i == m_persistent_decls.end())
- return NULL;
+ return nullptr;
else
return i->second;
}
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 9fcf2d49845..2dae5b7022f 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -102,7 +102,7 @@ void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) {
}
StackFrame *frame = exe_ctx.GetFramePtr();
- if (frame == NULL) {
+ if (frame == nullptr) {
if (log)
log->Printf(" [CUE::SC] Null stack frame");
return;
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
index 684cffd815e..5eec224477f 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.cpp
@@ -90,7 +90,7 @@ bool ClangUtilityFunction::Install(DiagnosticManager &diagnostic_manager,
ResetDeclMap(exe_ctx, keep_result_in_memory);
- if (!DeclMap()->WillParse(exe_ctx, NULL)) {
+ if (!DeclMap()->WillParse(exe_ctx, nullptr)) {
diagnostic_manager.PutString(
eDiagnosticSeverityError,
"current process state is unsuitable for expression parsing");
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 9c928054cfb..f083b92e3d6 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -60,7 +60,7 @@ IRForTarget::FunctionValueCache::GetValue(llvm::Function *function) {
static llvm::Value *FindEntryInstruction(llvm::Function *function) {
if (function->empty())
- return NULL;
+ return nullptr;
return function->getEntryBlock().getFirstNonPHIOrDbg();
}
@@ -71,11 +71,12 @@ IRForTarget::IRForTarget(lldb_private::ClangExpressionDeclMap *decl_map,
lldb_private::Stream &error_stream,
const char *func_name)
: ModulePass(ID), m_resolve_vars(resolve_vars), m_func_name(func_name),
- m_module(NULL), m_decl_map(decl_map), m_CFStringCreateWithBytes(NULL),
- m_sel_registerName(NULL), m_objc_getClass(NULL), m_intptr_ty(NULL),
- m_error_stream(error_stream),
- m_execution_unit(execution_unit), m_result_store(NULL),
- m_result_is_pointer(false), m_reloc_placeholder(NULL),
+ m_module(nullptr), m_decl_map(decl_map),
+ m_CFStringCreateWithBytes(nullptr), m_sel_registerName(nullptr),
+ m_objc_getClass(nullptr), m_intptr_ty(nullptr),
+ m_error_stream(error_stream), m_execution_unit(execution_unit),
+ m_result_store(nullptr), m_result_is_pointer(false),
+ m_reloc_placeholder(nullptr),
m_entry_instruction_finder(FindEntryInstruction) {}
/* Handy utility functions used at several places in the code */
@@ -116,7 +117,7 @@ clang::NamedDecl *IRForTarget::DeclForGlobal(const GlobalValue *global_val,
module->getNamedMetadata("clang.global.decl.ptrs");
if (!named_metadata)
- return NULL;
+ return nullptr;
unsigned num_nodes = named_metadata->getNumOperands();
unsigned node_index;
@@ -125,7 +126,7 @@ clang::NamedDecl *IRForTarget::DeclForGlobal(const GlobalValue *global_val,
llvm::MDNode *metadata_node =
dyn_cast<llvm::MDNode>(named_metadata->getOperand(node_index));
if (!metadata_node)
- return NULL;
+ return nullptr;
if (metadata_node->getNumOperands() != 2)
continue;
@@ -138,14 +139,14 @@ clang::NamedDecl *IRForTarget::DeclForGlobal(const GlobalValue *global_val,
mdconst::dyn_extract<ConstantInt>(metadata_node->getOperand(1));
if (!constant_int)
- return NULL;
+ return nullptr;
uintptr_t ptr = constant_int->getZExtValue();
return reinterpret_cast<clang::NamedDecl *>(ptr);
}
- return NULL;
+ return nullptr;
}
clang::NamedDecl *IRForTarget::DeclForGlobal(GlobalValue *global_val) {
@@ -164,7 +165,7 @@ bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
ValueSymbolTable &value_symbol_table = m_module->getValueSymbolTable();
std::string result_name_str;
- const char *result_name = NULL;
+ const char *result_name = nullptr;
for (ValueSymbolTable::iterator vi = value_symbol_table.begin(),
ve = value_symbol_table.end();
@@ -342,8 +343,8 @@ bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
GlobalVariable *new_result_global = new GlobalVariable(
(*m_module), result_global->getType()->getElementType(),
- false, /* not constant */
- GlobalValue::ExternalLinkage, NULL, /* no initializer */
+ false, /* not constant */
+ GlobalValue::ExternalLinkage, nullptr, /* no initializer */
m_result_name.GetCString());
// It's too late in compilation to create a new VarDecl for this, but we
@@ -488,7 +489,7 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
CFSCWB_ty, ConstantExpr::getIntToPtr(CFSCWB_addr_int, CFSCWB_ptr_ty)};
}
- ConstantDataSequential *string_array = NULL;
+ ConstantDataSequential *string_array = nullptr;
if (cstr)
string_array = dyn_cast<ConstantDataSequential>(cstr->getInitializer());
@@ -733,7 +734,7 @@ bool IRForTarget::RewriteObjCConstStrings() {
}
if (!cstr_array)
- cstr_global = NULL;
+ cstr_global = nullptr;
if (!RewriteObjCConstString(nsstring_global, cstr_global)) {
if (log)
@@ -1149,8 +1150,8 @@ bool IRForTarget::RewritePersistentAlloc(llvm::Instruction *persistent_alloc) {
return false;
GlobalVariable *persistent_global = new GlobalVariable(
- (*m_module), alloc->getType(), false, /* not constant */
- GlobalValue::ExternalLinkage, NULL, /* no initializer */
+ (*m_module), alloc->getType(), false, /* not constant */
+ GlobalValue::ExternalLinkage, nullptr, /* no initializer */
alloc->getName().str());
// What we're going to do here is make believe this was a regular old
@@ -1346,13 +1347,13 @@ bool IRForTarget::MaybeHandleVariable(Value *llvm_value_ptr) {
std::string name(named_decl->getName().str());
clang::ValueDecl *value_decl = dyn_cast<clang::ValueDecl>(named_decl);
- if (value_decl == NULL)
+ if (value_decl == nullptr)
return false;
lldb_private::CompilerType compiler_type(&value_decl->getASTContext(),
value_decl->getType());
- const Type *value_type = NULL;
+ const Type *value_type = nullptr;
if (name[0] == '$') {
// The $__lldb_expr_result name indicates the return value has allocated
@@ -1630,12 +1631,12 @@ bool IRForTarget::ResolveExternals(Function &llvm_function) {
}
static bool isGuardVariableRef(Value *V) {
- Constant *Old = NULL;
+ Constant *Old = nullptr;
if (!(Old = dyn_cast<Constant>(V)))
return false;
- ConstantExpr *CE = NULL;
+ ConstantExpr *CE = nullptr;
if ((CE = dyn_cast<ConstantExpr>(V))) {
if (CE->getOpcode() != Instruction::BitCast)
@@ -1930,8 +1931,8 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
}
for (element_index = 0; element_index < num_elements; ++element_index) {
- const clang::NamedDecl *decl = NULL;
- Value *value = NULL;
+ const clang::NamedDecl *decl = nullptr;
+ Value *value = nullptr;
lldb::offset_t offset;
lldb_private::ConstString name;
@@ -2051,7 +2052,7 @@ bool IRForTarget::runOnModule(Module &llvm_module) {
std::string s;
raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
@@ -2088,7 +2089,7 @@ bool IRForTarget::runOnModule(Module &llvm_module) {
m_reloc_placeholder = new llvm::GlobalVariable(
(*m_module), int8_ty, false /* IsConstant */,
GlobalVariable::InternalLinkage, Constant::getNullValue(int8_ty),
- "reloc_placeholder", NULL /* InsertBefore */,
+ "reloc_placeholder", nullptr /* InsertBefore */,
GlobalVariable::NotThreadLocal /* ThreadLocal */, 0 /* AddressSpace */);
////////////////////////////////////////////////////////////
@@ -2110,7 +2111,7 @@ bool IRForTarget::runOnModule(Module &llvm_module) {
std::string s;
raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
@@ -2245,7 +2246,7 @@ bool IRForTarget::runOnModule(Module &llvm_module) {
std::string s;
raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
diff --git a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
index 130adbd6071..6323889c2e0 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ b/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -749,7 +749,7 @@ EmulateInstructionARM::CreateInstance(const ArchSpec &arch,
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionARM::SetTargetTriple(const ArchSpec &arch) {
@@ -13213,7 +13213,7 @@ EmulateInstructionARM::GetARMOpcodeForInstruction(const uint32_t opcode,
(g_arm_opcodes[i].variants & arm_isa) != 0)
return &g_arm_opcodes[i];
}
- return NULL;
+ return nullptr;
}
EmulateInstructionARM::ARMOpcode *
@@ -13763,7 +13763,7 @@ EmulateInstructionARM::GetThumbOpcodeForInstruction(const uint32_t opcode,
(g_thumb_opcodes[i].variants & arm_isa) != 0)
return &g_thumb_opcodes[i];
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionARM::SetArchitecture(const ArchSpec &arch) {
@@ -14311,7 +14311,7 @@ bool EmulateInstructionARM::WriteFlags(Context &context, const uint32_t result,
}
bool EmulateInstructionARM::EvaluateInstruction(uint32_t evaluate_options) {
- ARMOpcode *opcode_data = NULL;
+ ARMOpcode *opcode_data = nullptr;
if (m_opcode_mode == eModeThumb)
opcode_data =
@@ -14400,7 +14400,7 @@ bool EmulateInstructionARM::TestEmulation(Stream *out_stream, ArchSpec &arch,
OptionValueSP value_sp = test_data->GetValueForKey(opcode_key);
uint32_t test_opcode;
- if ((value_sp.get() == NULL) ||
+ if ((value_sp.get() == nullptr) ||
(value_sp->GetType() != OptionValue::eTypeUInt64)) {
out_stream->Printf("TestEmulation: Error reading opcode from test file.\n");
return false;
@@ -14426,7 +14426,7 @@ bool EmulateInstructionARM::TestEmulation(Stream *out_stream, ArchSpec &arch,
EmulationStateARM after_state;
value_sp = test_data->GetValueForKey(before_key);
- if ((value_sp.get() == NULL) ||
+ if ((value_sp.get() == nullptr) ||
(value_sp->GetType() != OptionValue::eTypeDictionary)) {
out_stream->Printf("TestEmulation: Failed to find 'before' state.\n");
return false;
@@ -14439,7 +14439,7 @@ bool EmulateInstructionARM::TestEmulation(Stream *out_stream, ArchSpec &arch,
}
value_sp = test_data->GetValueForKey(after_key);
- if ((value_sp.get() == NULL) ||
+ if ((value_sp.get() == nullptr) ||
(value_sp->GetType() != OptionValue::eTypeDictionary)) {
out_stream->Printf("TestEmulation: Failed to find 'after' state.\n");
return false;
diff --git a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
index 37ec53bba2b..11c7677c201 100644
--- a/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
+++ b/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.cpp
@@ -284,14 +284,14 @@ bool EmulationStateARM::LoadStateFromDictionary(
// Load memory, if present.
- if (value_sp.get() != NULL) {
+ if (value_sp.get() != nullptr) {
static ConstString address_key("address");
static ConstString data_key("data");
uint64_t start_address = 0;
OptionValueDictionary *mem_dict = value_sp->GetAsDictionary();
value_sp = mem_dict->GetValueForKey(address_key);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
else
start_address = value_sp->GetUInt64Value();
@@ -306,7 +306,7 @@ bool EmulationStateARM::LoadStateFromDictionary(
for (uint32_t i = 0; i < num_elts; ++i) {
value_sp = mem_array->GetValueAtIndex(i);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
uint64_t value = value_sp->GetUInt64Value();
StoreToPseudoAddress(address, value);
@@ -315,7 +315,7 @@ bool EmulationStateARM::LoadStateFromDictionary(
}
value_sp = test_data->GetValueForKey(registers_key);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
// Load General Registers
@@ -328,7 +328,7 @@ bool EmulationStateARM::LoadStateFromDictionary(
sstr.Printf("r%d", i);
ConstString reg_name(sstr.GetString());
value_sp = reg_dict->GetValueForKey(reg_name);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
uint64_t reg_value = value_sp->GetUInt64Value();
StorePseudoRegisterValue(dwarf_r0 + i, reg_value);
@@ -336,7 +336,7 @@ bool EmulationStateARM::LoadStateFromDictionary(
static ConstString cpsr_name("cpsr");
value_sp = reg_dict->GetValueForKey(cpsr_name);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
StorePseudoRegisterValue(dwarf_cpsr, value_sp->GetUInt64Value());
@@ -346,7 +346,7 @@ bool EmulationStateARM::LoadStateFromDictionary(
sstr.Printf("s%d", i);
ConstString reg_name(sstr.GetString());
value_sp = reg_dict->GetValueForKey(reg_name);
- if (value_sp.get() == NULL)
+ if (value_sp.get() == nullptr)
return false;
uint64_t reg_value = value_sp->GetUInt64Value();
StorePseudoRegisterValue(dwarf_s0 + i, reg_value);
diff --git a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
index c30d9bc906d..d835d62ad2e 100644
--- a/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
+++ b/lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
@@ -154,7 +154,7 @@ EmulateInstructionARM64::CreateInstance(const ArchSpec &arch,
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionARM64::SetTargetTriple(const ArchSpec &arch) {
@@ -411,7 +411,7 @@ bool EmulateInstructionARM64::ReadInstruction() {
bool EmulateInstructionARM64::EvaluateInstruction(uint32_t evaluate_options) {
const uint32_t opcode = m_opcode.GetOpcode32();
Opcode *opcode_data = GetOpcodeForInstruction(opcode);
- if (opcode_data == NULL)
+ if (opcode_data == nullptr)
return false;
// printf ("opcode template for 0x%8.8x: %s\n", opcode, opcode_data->name);
diff --git a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
index b5a657819af..cbf3dda7896 100644
--- a/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
@@ -213,7 +213,7 @@ EmulateInstructionMIPS::CreateInstance(const ArchSpec &arch,
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionMIPS::SetTargetTriple(const ArchSpec &arch) {
@@ -966,7 +966,7 @@ EmulateInstructionMIPS::GetOpcodeForInstruction(const char *op_name) {
return &g_opcodes[i];
}
- return NULL;
+ return nullptr;
}
uint32_t
@@ -1083,7 +1083,7 @@ bool EmulateInstructionMIPS::EvaluateInstruction(uint32_t evaluate_options) {
*/
const char *op_name = m_insn_info->getName(mc_insn.getOpcode()).data();
- if (op_name == NULL)
+ if (op_name == nullptr)
return false;
/*
@@ -1092,7 +1092,7 @@ bool EmulateInstructionMIPS::EvaluateInstruction(uint32_t evaluate_options) {
*/
MipsOpcode *opcode_data = GetOpcodeForInstruction(op_name);
- if (opcode_data == NULL)
+ if (opcode_data == nullptr)
return false;
uint64_t old_pc = 0, new_pc = 0;
@@ -2875,7 +2875,7 @@ bool EmulateInstructionMIPS::Emulate_MSA_Branch_DF(llvm::MCInst &insn,
bool success = false, branch_hit = true;
int32_t target = 0;
RegisterValue reg_value;
- const uint8_t *ptr = NULL;
+ const uint8_t *ptr = nullptr;
uint32_t wt = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
int32_t offset = insn.getOperand(1).getImm();
diff --git a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
index 7c1044c499a..69f0278d143 100644
--- a/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
+++ b/lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
@@ -200,7 +200,7 @@ EmulateInstructionMIPS64::CreateInstance(const ArchSpec &arch,
}
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionMIPS64::SetTargetTriple(const ArchSpec &arch) {
@@ -931,7 +931,7 @@ EmulateInstructionMIPS64::GetOpcodeForInstruction(const char *op_name) {
return &g_opcodes[i];
}
- return NULL;
+ return nullptr;
}
bool EmulateInstructionMIPS64::ReadInstruction() {
@@ -974,7 +974,7 @@ bool EmulateInstructionMIPS64::EvaluateInstruction(uint32_t evaluate_options) {
*/
const char *op_name = m_insn_info->getName(mc_insn.getOpcode()).data();
- if (op_name == NULL)
+ if (op_name == nullptr)
return false;
/*
@@ -983,7 +983,7 @@ bool EmulateInstructionMIPS64::EvaluateInstruction(uint32_t evaluate_options) {
*/
MipsOpcode *opcode_data = GetOpcodeForInstruction(op_name);
- if (opcode_data == NULL)
+ if (opcode_data == nullptr)
return false;
uint64_t old_pc = 0, new_pc = 0;
@@ -2186,7 +2186,7 @@ bool EmulateInstructionMIPS64::Emulate_MSA_Branch_DF(llvm::MCInst &insn,
bool success = false, branch_hit = true;
int64_t target = 0;
RegisterValue reg_value;
- const uint8_t *ptr = NULL;
+ const uint8_t *ptr = nullptr;
uint32_t wt = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
int64_t offset = insn.getOperand(1).getImm();
diff --git a/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp b/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
index 60c8ed01ac1..c8ac04641e6 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp
@@ -287,7 +287,7 @@ void AddressSanitizerRuntime::Activate() {
const Symbol *symbol = GetRuntimeModuleSP()->FindFirstSymbolWithNameAndType(
symbol_name, eSymbolTypeCode);
- if (symbol == NULL)
+ if (symbol == nullptr)
return;
if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid())
diff --git a/lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp b/lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
index afdd97e6a74..fac20de0eb4 100644
--- a/lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
+++ b/lldb/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
@@ -900,7 +900,7 @@ void ThreadSanitizerRuntime::Activate() {
const Symbol *symbol = GetRuntimeModuleSP()->FindFirstSymbolWithNameAndType(
symbol_name, eSymbolTypeCode);
- if (symbol == NULL)
+ if (symbol == nullptr)
return;
if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid())
diff --git a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index ca2847f6a8c..24683e68718 100644
--- a/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -46,7 +46,7 @@ static const char *vtable_demangled_prefix = "vtable for ";
bool ItaniumABILanguageRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
const bool check_cxx = true;
const bool check_objc = false;
- return in_value.GetCompilerType().IsPossibleDynamicType(NULL, check_cxx,
+ return in_value.GetCompilerType().IsPossibleDynamicType(nullptr, check_cxx,
check_objc);
}
@@ -69,7 +69,7 @@ TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
target.GetImages().ResolveSymbolContextForAddress(
vtable_addr, eSymbolContextSymbol, sc);
Symbol *symbol = sc.symbol;
- if (symbol != NULL) {
+ if (symbol != nullptr) {
const char *name =
symbol->GetMangled()
.GetDemangledName(lldb::eLanguageTypeC_plus_plus)
@@ -306,7 +306,7 @@ TypeAndOrName ItaniumABILanguageRuntime::FixUpDynamicType(
}
bool ItaniumABILanguageRuntime::IsVTableName(const char *name) {
- if (name == NULL)
+ if (name == nullptr)
return false;
// Can we maybe ask Clang about this?
@@ -326,7 +326,7 @@ ItaniumABILanguageRuntime::CreateInstance(Process *process,
language == eLanguageTypeC_plus_plus_14)
return new ItaniumABILanguageRuntime(process);
else
- return NULL;
+ return nullptr;
}
class CommandObjectMultiwordItaniumABI_Demangle : public CommandObjectParsed {
@@ -490,7 +490,7 @@ lldb::BreakpointSP ItaniumABILanguageRuntime::CreateExceptionBreakpoint(
Target &target = m_process->GetTarget();
FileSpecList filter_modules;
BreakpointResolverSP exception_resolver_sp =
- CreateExceptionResolver(NULL, catch_bp, throw_bp, for_expressions);
+ CreateExceptionResolver(nullptr, catch_bp, throw_bp, for_expressions);
SearchFilterSP filter_sp(CreateExceptionSearchFilter());
const bool hardware = false;
const bool resolve_indirect_functions = false;
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
index 6b51177437c..b5cac92213b 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
@@ -173,7 +173,7 @@ AppleObjCDeclVendor::GetDeclForISA(ObjCLanguageRuntime::ObjCISA isa) {
m_runtime.GetClassDescriptorFromISA(isa);
if (!descriptor)
- return NULL;
+ return nullptr;
ConstString name(descriptor->GetClassName());
@@ -203,7 +203,7 @@ public:
ObjCRuntimeMethodType(const char *types) : m_is_valid(false) {
const char *cursor = types;
enum ParserState { Start = 0, InType, InPos } state = Start;
- const char *type = NULL;
+ const char *type = nullptr;
int brace_depth = 0;
uint32_t stepsLeft = 256;
@@ -261,7 +261,7 @@ public:
m_is_valid = false;
return;
}
- type = NULL;
+ type = nullptr;
} else {
++cursor;
}
@@ -319,7 +319,7 @@ public:
bool instance,
ObjCLanguageRuntime::EncodingToTypeSP type_realizer_sp) {
if (!m_is_valid || m_type_vector.size() < 3)
- return NULL;
+ return nullptr;
clang::ASTContext &ast_ctx(interface_decl->getASTContext());
@@ -354,7 +354,7 @@ public:
clang::IdentifierInfo **identifier_infos = selector_components.data();
if (!identifier_infos) {
- return NULL;
+ return nullptr;
}
clang::Selector sel = ast_ctx.Selectors.getSelector(
@@ -367,12 +367,13 @@ public:
for_expression));
if (ret_type.isNull())
- return NULL;
+ return nullptr;
clang::ObjCMethodDecl *ret = clang::ObjCMethodDecl::Create(
ast_ctx, clang::SourceLocation(), clang::SourceLocation(), sel,
- ret_type, NULL, interface_decl, isInstance, isVariadic, isSynthesized,
- isImplicitlyDeclared, isDefined, impControl, HasRelatedResultType);
+ ret_type, nullptr, interface_decl, isInstance, isVariadic,
+ isSynthesized, isImplicitlyDeclared, isDefined, impControl,
+ HasRelatedResultType);
std::vector<clang::ParmVarDecl *> parm_vars;
@@ -383,12 +384,12 @@ public:
ast_ctx, m_type_vector[ai].c_str(), for_expression));
if (arg_type.isNull())
- return NULL; // well, we just wasted a bunch of time. Wish we could
- // delete the stuff we'd just made!
+ return nullptr; // well, we just wasted a bunch of time. Wish we could
+ // delete the stuff we'd just made!
parm_vars.push_back(clang::ParmVarDecl::Create(
- ast_ctx, ret, clang::SourceLocation(), clang::SourceLocation(), NULL,
- arg_type, NULL, clang::SC_None, NULL));
+ ast_ctx, ret, clang::SourceLocation(), clang::SourceLocation(),
+ nullptr, arg_type, nullptr, clang::SC_None, nullptr));
}
ret->setMethodParams(ast_ctx,
@@ -512,7 +513,7 @@ bool AppleObjCDeclVendor::FinishDecl(clang::ObjCInterfaceDecl *interface_decl) {
clang::SourceLocation(), &m_ast_ctx.getASTContext()->Idents.get(name),
ClangUtil::GetQualType(ivar_type),
type_source_info, // TypeSourceInfo *
- clang::ObjCIvarDecl::Public, 0, is_synthesized);
+ clang::ObjCIvarDecl::Public, nullptr, is_synthesized);
if (ivar_decl) {
interface_decl->addDecl(ivar_decl);
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index 8e7014dcd61..8a0b5bf392c 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -128,9 +128,9 @@ bool AppleObjCRuntime::GetObjectDescription(Stream &strm, Value &value,
// ret.SetContext(Value::eContextTypeClangType, return_compiler_type);
ret.SetCompilerType(return_compiler_type);
- if (exe_ctx.GetFramePtr() == NULL) {
+ if (exe_ctx.GetFramePtr() == nullptr) {
Thread *thread = exe_ctx.GetThreadPtr();
- if (thread == NULL) {
+ if (thread == nullptr) {
exe_ctx.SetThreadSP(process->GetThreadList().GetSelectedThread());
thread = exe_ctx.GetThreadPtr();
}
@@ -225,7 +225,7 @@ Address *AppleObjCRuntime::GetPrintForDebuggerAddr() {
eSymbolTypeCode, contexts)) &&
(!modules.FindSymbolsWithNameAndType(ConstString("_CFPrintForDebugger"),
eSymbolTypeCode, contexts)))
- return NULL;
+ return nullptr;
contexts.GetContextAtIndex(0, context);
@@ -237,7 +237,7 @@ Address *AppleObjCRuntime::GetPrintForDebuggerAddr() {
bool AppleObjCRuntime::CouldHaveDynamicValue(ValueObject &in_value) {
return in_value.GetCompilerType().IsPossibleDynamicType(
- NULL,
+ nullptr,
false, // do not check C++
true); // check ObjC
}
@@ -327,7 +327,7 @@ bool AppleObjCRuntime::ReadObjCLibrary(const ModuleSP &module_sp) {
// reread it?
m_objc_trampoline_handler_up.reset(
new AppleObjCTrampolineHandler(m_process->shared_from_this(), module_sp));
- if (m_objc_trampoline_handler_up != NULL) {
+ if (m_objc_trampoline_handler_up != nullptr) {
m_read_objc_library = true;
return true;
} else
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
index 116f4d78ea2..31f9c40066e 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
@@ -75,9 +75,9 @@ AppleObjCRuntimeV1::CreateInstance(Process *process,
ObjCRuntimeVersions::eAppleObjC_V1)
return new AppleObjCRuntimeV1(process);
else
- return NULL;
+ return nullptr;
} else
- return NULL;
+ return nullptr;
}
void AppleObjCRuntimeV1::Initialize() {
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index 9f2540fd625..5d8d068a76c 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -414,8 +414,9 @@ AppleObjCRuntimeV2::AppleObjCRuntimeV2(Process *process,
m_encoding_to_type_sp(), m_noclasses_warning_emitted(false),
m_CFBoolean_values() {
static const ConstString g_gdb_object_getClass("gdb_object_getClass");
- m_has_object_getClass = (objc_module_sp->FindFirstSymbolWithNameAndType(
- g_gdb_object_getClass, eSymbolTypeCode) != NULL);
+ m_has_object_getClass =
+ (objc_module_sp->FindFirstSymbolWithNameAndType(
+ g_gdb_object_getClass, eSymbolTypeCode) != nullptr);
RegisterObjCExceptionRecognizer();
}
@@ -424,7 +425,7 @@ bool AppleObjCRuntimeV2::GetDynamicTypeAndAddress(
TypeAndOrName &class_type_or_name, Address &address,
Value::ValueType &value_type) {
// We should never get here with a null process...
- assert(m_process != NULL);
+ assert(m_process != nullptr);
// The Runtime is attached to a particular process, you shouldn't pass in a
// value from another process. Note, however, the process might be NULL (e.g.
@@ -488,9 +489,9 @@ LanguageRuntime *AppleObjCRuntimeV2::CreateInstance(Process *process,
ObjCRuntimeVersions::eAppleObjC_V2)
return new AppleObjCRuntimeV2(process, objc_module_sp);
else
- return NULL;
+ return nullptr;
} else
- return NULL;
+ return nullptr;
}
static constexpr OptionDefinition g_objc_classtable_dump_options[] = {
@@ -938,7 +939,7 @@ class RemoteNXMapTable {
public:
RemoteNXMapTable()
: m_count(0), m_num_buckets_minus_one(0),
- m_buckets_ptr(LLDB_INVALID_ADDRESS), m_process(NULL),
+ m_buckets_ptr(LLDB_INVALID_ADDRESS), m_process(nullptr),
m_end_iterator(*this, -1), m_load_addr(LLDB_INVALID_ADDRESS),
m_map_pair_size(0), m_invalid_key(0) {}
@@ -1273,7 +1274,7 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(
RemoteNXMapTable &hash_table) {
Process *process = GetProcess();
- if (process == NULL)
+ if (process == nullptr)
return DescriptorMapUpdateResult::Fail();
uint32_t num_class_infos = 0;
@@ -1509,7 +1510,8 @@ uint32_t AppleObjCRuntimeV2::ParseClassInfoArray(const DataExtractor &data,
} else {
// Read the 32 bit hash for the class name
const uint32_t name_hash = data.GetU32(&offset);
- ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, NULL));
+ ClassDescriptorSP descriptor_sp(
+ new ClassDescriptorV2(*this, isa, nullptr));
// The code in g_get_shared_cache_class_info_body sets the value of the hash
// to 0 to signal a demangled symbol. We use class_getName() in that code to
@@ -1538,7 +1540,7 @@ AppleObjCRuntimeV2::DescriptorMapUpdateResult
AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() {
Process *process = GetProcess();
- if (process == NULL)
+ if (process == nullptr)
return DescriptorMapUpdateResult::Fail();
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_TYPES));
@@ -1752,7 +1754,7 @@ bool AppleObjCRuntimeV2::UpdateISAToDescriptorMapFromMemory(
Process *process = GetProcess();
- if (process == NULL)
+ if (process == nullptr)
return false;
uint32_t num_map_table_isas = 0;
@@ -2037,18 +2039,18 @@ AppleObjCRuntimeV2::NonPointerISACache::CreateInstance(
auto objc_debug_isa_magic_mask = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_isa_magic_mask"), objc_module_sp, error);
if (error.Fail())
- return NULL;
+ return nullptr;
auto objc_debug_isa_magic_value = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_isa_magic_value"), objc_module_sp,
error);
if (error.Fail())
- return NULL;
+ return nullptr;
auto objc_debug_isa_class_mask = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_isa_class_mask"), objc_module_sp, error);
if (error.Fail())
- return NULL;
+ return nullptr;
if (log)
log->PutCString("AOCRT::NPI: Found all the non-indexed ISA masks");
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
index 377c8b3c713..4589b1f5d5e 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
@@ -470,7 +470,7 @@ bool AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols() {
const Symbol *trampoline_symbol =
m_objc_module_sp->FindFirstSymbolWithNameAndType(trampoline_name,
eSymbolTypeData);
- if (trampoline_symbol != NULL) {
+ if (trampoline_symbol != nullptr) {
m_trampoline_header = trampoline_symbol->GetLoadAddress(&target);
if (m_trampoline_header == LLDB_INVALID_ADDRESS)
return false;
@@ -480,7 +480,7 @@ bool AppleObjCTrampolineHandler::AppleObjCVTables::InitializeVTableSymbols() {
const Symbol *changed_symbol =
m_objc_module_sp->FindFirstSymbolWithNameAndType(changed_name,
eSymbolTypeCode);
- if (changed_symbol != NULL) {
+ if (changed_symbol != nullptr) {
const Address changed_symbol_addr = changed_symbol->GetAddress();
if (!changed_symbol_addr.IsValid())
return false;
@@ -541,7 +541,7 @@ bool AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines(
Status error;
DataExtractor data;
error = argument_values.GetValueAtIndex(0)->GetValueAsData(&exe_ctx, data,
- 0, NULL);
+ 0, nullptr);
lldb::offset_t offset = 0;
lldb::addr_t region_addr = data.GetPointer(&offset);
@@ -668,7 +668,7 @@ AppleObjCTrampolineHandler::AppleObjCTrampolineHandler(
ConstString msg_forward_name("_objc_msgForward");
ConstString msg_forward_stret_name("_objc_msgForward_stret");
- Target *target = process_sp ? &process_sp->GetTarget() : NULL;
+ Target *target = process_sp ? &process_sp->GetTarget() : nullptr;
const Symbol *class_getMethodImplementation =
m_objc_module_sp->FindFirstSymbolWithNameAndType(get_impl_name,
eSymbolTypeCode);
@@ -771,7 +771,7 @@ AppleObjCTrampolineHandler::SetupDispatchFunction(Thread &thread,
// First stage is to make the ClangUtility to hold our injected function:
if (!m_impl_code) {
- if (m_lookup_implementation_function_code != NULL) {
+ if (m_lookup_implementation_function_code != nullptr) {
Status error;
m_impl_code.reset(exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
m_lookup_implementation_function_code, eLanguageTypeObjC,
@@ -886,11 +886,11 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
lldb::StackFrameSP thread_cur_frame = thread.GetStackFrameAtIndex(0);
- const ABI *abi = NULL;
+ const ABI *abi = nullptr;
ProcessSP process_sp(thread.CalculateProcess());
if (process_sp)
abi = process_sp->GetABI().get();
- if (abi == NULL)
+ if (abi == nullptr)
return ret_plan_sp;
TargetSP target_sp(thread.CalculateTarget());
@@ -1037,7 +1037,7 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
}
ObjCLanguageRuntime *objc_runtime =
thread.GetProcess()->GetObjCLanguageRuntime();
- assert(objc_runtime != NULL);
+ assert(objc_runtime != nullptr);
impl_addr = objc_runtime->LookupInMethodCache(isa_addr, sel_addr);
}
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
index f1356afe6df..d120d671eeb 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.h
@@ -74,8 +74,9 @@ private:
class VTableRegion {
public:
VTableRegion()
- : m_valid(false), m_owner(NULL), m_header_addr(LLDB_INVALID_ADDRESS),
- m_code_start_addr(0), m_code_end_addr(0), m_next_region(0) {}
+ : m_valid(false), m_owner(nullptr),
+ m_header_addr(LLDB_INVALID_ADDRESS), m_code_start_addr(0),
+ m_code_end_addr(0), m_next_region(0) {}
VTableRegion(AppleObjCVTables *owner, lldb::addr_t header_addr);
diff --git a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
index 3436464d024..f3f38d3f9de 100644
--- a/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
+++ b/lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
@@ -36,7 +36,7 @@ AppleThreadPlanStepThroughObjCTrampoline::
eVoteNoOpinion),
m_trampoline_handler(trampoline_handler),
m_args_addr(LLDB_INVALID_ADDRESS), m_input_values(input_values),
- m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(NULL),
+ m_isa_addr(isa_addr), m_sel_addr(sel_addr), m_impl_function(nullptr),
m_stop_others(stop_others) {}
// Destructor
@@ -172,7 +172,7 @@ bool AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(Event *event_ptr) {
ObjCLanguageRuntime *objc_runtime =
GetThread().GetProcess()->GetObjCLanguageRuntime();
- assert(objc_runtime != NULL);
+ assert(objc_runtime != nullptr);
objc_runtime->AddToMethodCache(m_isa_addr, m_sel_addr, target_addr);
if (log)
log->Printf("Adding {isa-addr=0x%" PRIx64 ", sel-addr=0x%" PRIx64
diff --git a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
index 95aeb41e55c..a2dafdbd526 100644
--- a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
+++ b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
@@ -30,7 +30,7 @@ using namespace lldb_private;
MemoryHistorySP MemoryHistoryASan::CreateInstance(const ProcessSP &process_sp) {
if (!process_sp.get())
- return NULL;
+ return nullptr;
Target &target = process_sp->GetTarget();
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index c364dd07578..ddd7ba7ce82 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -121,7 +121,7 @@ ObjectContainerBSDArchive::Object::Extract(const DataExtractor &data,
if (ar_name_len > 0) {
const void *ar_name_ptr = data.GetData(&offset, ar_name_len);
// Make sure there was enough data for the string value and bail if not
- if (ar_name_ptr == NULL)
+ if (ar_name_ptr == nullptr)
return LLDB_INVALID_OFFSET;
str.assign((const char *)ar_name_ptr, ar_name_len);
ar_name.SetCString(str.c_str());
@@ -190,7 +190,7 @@ ObjectContainerBSDArchive::Archive::FindObject(
return &m_objects[match->value];
}
}
- return NULL;
+ return nullptr;
}
ObjectContainerBSDArchive::Archive::shared_ptr
@@ -351,7 +351,7 @@ ObjectContainer *ObjectContainerBSDArchive::CreateInstance(
}
}
}
- return NULL;
+ return nullptr;
}
bool ObjectContainerBSDArchive::MagicBytesMatch(const DataExtractor &data) {
@@ -378,7 +378,7 @@ void ObjectContainerBSDArchive::SetArchive(Archive::shared_ptr &archive_sp) {
ObjectContainerBSDArchive::~ObjectContainerBSDArchive() {}
bool ObjectContainerBSDArchive::ParseHeader() {
- if (m_archive_sp.get() == NULL) {
+ if (m_archive_sp.get() == nullptr) {
if (m_data.GetByteSize() > 0) {
ModuleSP module_sp(GetModule());
if (module_sp) {
@@ -391,7 +391,7 @@ bool ObjectContainerBSDArchive::ParseHeader() {
m_data.Clear();
}
}
- return m_archive_sp.get() != NULL;
+ return m_archive_sp.get() != nullptr;
}
void ObjectContainerBSDArchive::Dump(Stream *s) const {
diff --git a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
index 84ddd058571..fdcf39ed576 100644
--- a/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
+++ b/lldb/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h
@@ -125,7 +125,7 @@ protected:
const Object *GetObjectAtIndex(size_t idx) {
if (idx < m_objects.size())
return &m_objects[idx];
- return NULL;
+ return nullptr;
}
size_t ParseObjects();
diff --git a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
index c392addc82b..839a71cfdc7 100644
--- a/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
+++ b/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
@@ -57,7 +57,7 @@ ObjectContainer *ObjectContainerUniversalMachO::CreateInstance(
}
}
}
- return NULL;
+ return nullptr;
}
bool ObjectContainerUniversalMachO::MagicBytesMatch(const DataExtractor &data) {
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
index 7f9665af9a3..aa9871071b0 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -114,7 +114,7 @@ void ELFHeader::ParseHeaderExtension(lldb_private::DataExtractor &data) {
bool ELFHeader::Parse(lldb_private::DataExtractor &data,
lldb::offset_t *offset) {
// Read e_ident. This provides byte order and address size info.
- if (data.GetU8(offset, &e_ident, EI_NIDENT) == NULL)
+ if (data.GetU8(offset, &e_ident, EI_NIDENT) == nullptr)
return false;
const unsigned byte_size = Is32Bit() ? 4 : 8;
@@ -122,11 +122,11 @@ bool ELFHeader::Parse(lldb_private::DataExtractor &data,
data.SetAddressByteSize(byte_size);
// Read e_type and e_machine.
- if (data.GetU16(offset, &e_type, 2) == NULL)
+ if (data.GetU16(offset, &e_type, 2) == nullptr)
return false;
// Read e_version.
- if (data.GetU32(offset, &e_version, 1) == NULL)
+ if (data.GetU32(offset, &e_version, 1) == nullptr)
return false;
// Read e_entry, e_phoff and e_shoff.
@@ -134,11 +134,11 @@ bool ELFHeader::Parse(lldb_private::DataExtractor &data,
return false;
// Read e_flags.
- if (data.GetU32(offset, &e_flags, 1) == NULL)
+ if (data.GetU32(offset, &e_flags, 1) == nullptr)
return false;
// Read e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum and e_shstrndx.
- if (data.GetU16(offset, &e_ehsize, 6) == NULL)
+ if (data.GetU16(offset, &e_ehsize, 6) == nullptr)
return false;
// Initialize e_phnum, e_shnum, and e_shstrndx with the values read from the
@@ -224,7 +224,7 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,
const unsigned byte_size = data.GetAddressByteSize();
// Read sh_name and sh_type.
- if (data.GetU32(offset, &sh_name, 2) == NULL)
+ if (data.GetU32(offset, &sh_name, 2) == nullptr)
return false;
// Read sh_flags.
@@ -236,7 +236,7 @@ bool ELFSectionHeader::Parse(const lldb_private::DataExtractor &data,
return false;
// Read sh_link and sh_info.
- if (data.GetU32(offset, &sh_link, 2) == NULL)
+ if (data.GetU32(offset, &sh_link, 2) == nullptr)
return false;
// Read sh_addralign and sh_entsize.
@@ -322,7 +322,7 @@ bool ELFSymbol::Parse(const lldb_private::DataExtractor &data,
const bool parsing_32 = byte_size == 4;
// Read st_name.
- if (data.GetU32(offset, &st_name, 1) == NULL)
+ if (data.GetU32(offset, &st_name, 1) == nullptr)
return false;
if (parsing_32) {
@@ -331,23 +331,23 @@ bool ELFSymbol::Parse(const lldb_private::DataExtractor &data,
return false;
// Read st_info and st_other.
- if (data.GetU8(offset, &st_info, 2) == NULL)
+ if (data.GetU8(offset, &st_info, 2) == nullptr)
return false;
// Read st_shndx.
- if (data.GetU16(offset, &st_shndx, 1) == NULL)
+ if (data.GetU16(offset, &st_shndx, 1) == nullptr)
return false;
} else {
// Read st_info and st_other.
- if (data.GetU8(offset, &st_info, 2) == NULL)
+ if (data.GetU8(offset, &st_info, 2) == nullptr)
return false;
// Read st_shndx.
- if (data.GetU16(offset, &st_shndx, 1) == NULL)
+ if (data.GetU16(offset, &st_shndx, 1) == nullptr)
return false;
// Read st_value and st_size.
- if (data.GetU64(offset, &st_value, 2) == NULL)
+ if (data.GetU64(offset, &st_value, 2) == nullptr)
return false;
}
return true;
@@ -365,7 +365,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
const bool parsing_32 = byte_size == 4;
// Read p_type;
- if (data.GetU32(offset, &p_type, 1) == NULL)
+ if (data.GetU32(offset, &p_type, 1) == nullptr)
return false;
if (parsing_32) {
@@ -374,7 +374,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
return false;
// Read p_flags.
- if (data.GetU32(offset, &p_flags, 1) == NULL)
+ if (data.GetU32(offset, &p_flags, 1) == nullptr)
return false;
// Read p_align.
@@ -382,7 +382,7 @@ bool ELFProgramHeader::Parse(const lldb_private::DataExtractor &data,
return false;
} else {
// Read p_flags.
- if (data.GetU32(offset, &p_flags, 1) == NULL)
+ if (data.GetU32(offset, &p_flags, 1) == nullptr)
return false;
// Read p_offset, p_vaddr, p_paddr, p_filesz, p_memsz and p_align.
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 0040599c1b5..bc802040bf7 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -162,7 +162,7 @@ ELFRelocation::ELFRelocation(unsigned type) {
reloc = new ELFRela();
else {
assert(false && "unexpected relocation type");
- reloc = static_cast<ELFRel *>(NULL);
+ reloc = static_cast<ELFRel *>(nullptr);
}
}
@@ -243,7 +243,7 @@ static user_id_t SegmentID(size_t PHdrIndex) { return ~PHdrIndex; }
bool ELFNote::Parse(const DataExtractor &data, lldb::offset_t *offset) {
// Read all fields.
- if (data.GetU32(offset, &n_namesz, 3) == NULL)
+ if (data.GetU32(offset, &n_namesz, 3) == nullptr)
return false;
// The name field is required to be nul-terminated, and n_namesz includes the
@@ -262,7 +262,7 @@ bool ELFNote::Parse(const DataExtractor &data, lldb::offset_t *offset) {
}
const char *cstr = data.GetCStr(offset, llvm::alignTo(n_namesz, 4));
- if (cstr == NULL) {
+ if (cstr == nullptr) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS));
if (log)
log->Printf("Failed to parse note name lacking nul terminator");
@@ -396,7 +396,7 @@ ObjectFile *ObjectFileELF::CreateInstance(const lldb::ModuleSP &module_sp,
return objfile_up.release();
}
- return NULL;
+ return nullptr;
}
ObjectFile *ObjectFileELF::CreateMemoryInstance(
@@ -415,7 +415,7 @@ ObjectFile *ObjectFileELF::CreateMemoryInstance(
}
}
}
- return NULL;
+ return nullptr;
}
bool ObjectFileELF::MagicBytesMatch(DataBufferSP &data_sp,
@@ -1656,12 +1656,12 @@ size_t ObjectFileELF::ParseSectionHeaders() {
const ObjectFileELF::ELFSectionHeaderInfo *
ObjectFileELF::GetSectionHeaderByIndex(lldb::user_id_t id) {
if (!ParseSectionHeaders())
- return NULL;
+ return nullptr;
if (id < m_section_headers.size())
return &m_section_headers[id];
- return NULL;
+ return nullptr;
}
lldb::user_id_t ObjectFileELF::GetSectionIndexByName(const char *name) {
@@ -2376,7 +2376,7 @@ size_t ObjectFileELF::ParseDynamicSymbols() {
const ELFDynamic *ObjectFileELF::FindDynamicSymbol(unsigned tag) {
if (!ParseDynamicSymbols())
- return NULL;
+ return nullptr;
DynamicSymbolCollIter I = m_dynamic_symbols.begin();
DynamicSymbolCollIter E = m_dynamic_symbols.end();
@@ -2387,7 +2387,7 @@ const ELFDynamic *ObjectFileELF::FindDynamicSymbol(unsigned tag) {
return symbol;
}
- return NULL;
+ return nullptr;
}
unsigned ObjectFileELF::PLTRelocationType() {
@@ -2604,7 +2604,7 @@ unsigned ObjectFileELF::ApplyRelocations(
if (!rel.Parse(rel_data, &offset))
break;
- Symbol *symbol = NULL;
+ Symbol *symbol = nullptr;
if (hdr->Is32Bit()) {
switch (reloc_type(rel)) {
@@ -2723,7 +2723,7 @@ unsigned ObjectFileELF::RelocateDebugSections(const ELFSectionHeader *rel_hdr,
Symtab *ObjectFileELF::GetSymtab() {
ModuleSP module_sp(GetModule());
if (!module_sp)
- return NULL;
+ return nullptr;
// We always want to use the main object file so we (hopefully) only have one
// cached copy of our symtab, dynamic sections, etc.
@@ -2731,10 +2731,10 @@ Symtab *ObjectFileELF::GetSymtab() {
if (module_obj_file && module_obj_file != this)
return module_obj_file->GetSymtab();
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
SectionList *section_list = module_sp->GetSectionList();
if (!section_list)
- return NULL;
+ return nullptr;
uint64_t symbol_id = 0;
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
@@ -2934,10 +2934,10 @@ void ObjectFileELF::Dump(Stream *s) {
s->EOL();
SectionList *section_list = GetSectionList();
if (section_list)
- section_list->Dump(s, NULL, true, UINT32_MAX);
+ section_list->Dump(s, nullptr, true, UINT32_MAX);
Symtab *symtab = GetSymtab();
if (symtab)
- symtab->Dump(s, NULL, eSortOrderNone);
+ symtab->Dump(s, nullptr, eSortOrderNone);
s->EOL();
DumpDependentModules(s);
s->EOL();
diff --git a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
index ad15f961736..7d7453c0a87 100644
--- a/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
+++ b/lldb/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
@@ -66,7 +66,7 @@ ObjectFile *ObjectFileJIT::CreateInstance(const lldb::ModuleSP &module_sp,
lldb::offset_t length) {
// JIT'ed object file is backed by the ObjectFileJITDelegate, never read from
// a file
- return NULL;
+ return nullptr;
}
ObjectFile *ObjectFileJIT::CreateMemoryInstance(const lldb::ModuleSP &module_sp,
@@ -75,7 +75,7 @@ ObjectFile *ObjectFileJIT::CreateMemoryInstance(const lldb::ModuleSP &module_sp,
lldb::addr_t header_addr) {
// JIT'ed object file is backed by the ObjectFileJITDelegate, never read from
// memory
- return NULL;
+ return nullptr;
}
size_t ObjectFileJIT::GetModuleSpecifications(
@@ -88,7 +88,7 @@ size_t ObjectFileJIT::GetModuleSpecifications(
ObjectFileJIT::ObjectFileJIT(const lldb::ModuleSP &module_sp,
const ObjectFileJITDelegateSP &delegate_sp)
- : ObjectFile(module_sp, NULL, 0, 0, DataBufferSP(), 0), m_delegate_wp() {
+ : ObjectFile(module_sp, nullptr, 0, 0, DataBufferSP(), 0), m_delegate_wp() {
if (delegate_sp) {
m_delegate_wp = delegate_sp;
m_data.SetByteOrder(delegate_sp->GetByteOrder());
@@ -115,7 +115,7 @@ Symtab *ObjectFileJIT::GetSymtab() {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
m_symtab_up.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> symtab_guard(
m_symtab_up->GetMutex());
@@ -159,10 +159,10 @@ void ObjectFileJIT::Dump(Stream *s) {
SectionList *sections = GetSectionList();
if (sections)
- sections->Dump(s, NULL, true, UINT32_MAX);
+ sections->Dump(s, nullptr, true, UINT32_MAX);
if (m_symtab_up)
- m_symtab_up->Dump(s, NULL, eSortOrderNone);
+ m_symtab_up->Dump(s, nullptr, eSortOrderNone);
}
}
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index b6db8d77a26..62991dc2095 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -173,7 +173,7 @@ public:
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
@@ -202,27 +202,27 @@ public:
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "rax", NULL, 8, data);
- WriteRegister(reg_ctx, "rbx", NULL, 8, data);
- WriteRegister(reg_ctx, "rcx", NULL, 8, data);
- WriteRegister(reg_ctx, "rdx", NULL, 8, data);
- WriteRegister(reg_ctx, "rdi", NULL, 8, data);
- WriteRegister(reg_ctx, "rsi", NULL, 8, data);
- WriteRegister(reg_ctx, "rbp", NULL, 8, data);
- WriteRegister(reg_ctx, "rsp", NULL, 8, data);
- WriteRegister(reg_ctx, "r8", NULL, 8, data);
- WriteRegister(reg_ctx, "r9", NULL, 8, data);
- WriteRegister(reg_ctx, "r10", NULL, 8, data);
- WriteRegister(reg_ctx, "r11", NULL, 8, data);
- WriteRegister(reg_ctx, "r12", NULL, 8, data);
- WriteRegister(reg_ctx, "r13", NULL, 8, data);
- WriteRegister(reg_ctx, "r14", NULL, 8, data);
- WriteRegister(reg_ctx, "r15", NULL, 8, data);
- WriteRegister(reg_ctx, "rip", NULL, 8, data);
- WriteRegister(reg_ctx, "rflags", NULL, 8, data);
- WriteRegister(reg_ctx, "cs", NULL, 8, data);
- WriteRegister(reg_ctx, "fs", NULL, 8, data);
- WriteRegister(reg_ctx, "gs", NULL, 8, data);
+ WriteRegister(reg_ctx, "rax", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rbx", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rcx", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rdx", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rdi", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rsi", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rbp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rsp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r8", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r9", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r10", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r11", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r12", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r13", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r14", nullptr, 8, data);
+ WriteRegister(reg_ctx, "r15", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rip", nullptr, 8, data);
+ WriteRegister(reg_ctx, "rflags", nullptr, 8, data);
+ WriteRegister(reg_ctx, "cs", nullptr, 8, data);
+ WriteRegister(reg_ctx, "fs", nullptr, 8, data);
+ WriteRegister(reg_ctx, "gs", nullptr, 8, data);
// // Write out the FPU registers
// const size_t fpu_byte_size = sizeof(FPU);
@@ -311,9 +311,9 @@ public:
// Write out the EXC registers
data.PutHex32(EXCRegSet);
data.PutHex32(EXCWordCount);
- WriteRegister(reg_ctx, "trapno", NULL, 4, data);
- WriteRegister(reg_ctx, "err", NULL, 4, data);
- WriteRegister(reg_ctx, "faultvaddr", NULL, 8, data);
+ WriteRegister(reg_ctx, "trapno", nullptr, 4, data);
+ WriteRegister(reg_ctx, "err", nullptr, 4, data);
+ WriteRegister(reg_ctx, "faultvaddr", nullptr, 8, data);
return true;
}
return false;
@@ -404,7 +404,7 @@ public:
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
@@ -433,29 +433,29 @@ public:
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "eax", NULL, 4, data);
- WriteRegister(reg_ctx, "ebx", NULL, 4, data);
- WriteRegister(reg_ctx, "ecx", NULL, 4, data);
- WriteRegister(reg_ctx, "edx", NULL, 4, data);
- WriteRegister(reg_ctx, "edi", NULL, 4, data);
- WriteRegister(reg_ctx, "esi", NULL, 4, data);
- WriteRegister(reg_ctx, "ebp", NULL, 4, data);
- WriteRegister(reg_ctx, "esp", NULL, 4, data);
- WriteRegister(reg_ctx, "ss", NULL, 4, data);
- WriteRegister(reg_ctx, "eflags", NULL, 4, data);
- WriteRegister(reg_ctx, "eip", NULL, 4, data);
- WriteRegister(reg_ctx, "cs", NULL, 4, data);
- WriteRegister(reg_ctx, "ds", NULL, 4, data);
- WriteRegister(reg_ctx, "es", NULL, 4, data);
- WriteRegister(reg_ctx, "fs", NULL, 4, data);
- WriteRegister(reg_ctx, "gs", NULL, 4, data);
+ WriteRegister(reg_ctx, "eax", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ebx", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ecx", nullptr, 4, data);
+ WriteRegister(reg_ctx, "edx", nullptr, 4, data);
+ WriteRegister(reg_ctx, "edi", nullptr, 4, data);
+ WriteRegister(reg_ctx, "esi", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ebp", nullptr, 4, data);
+ WriteRegister(reg_ctx, "esp", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ss", nullptr, 4, data);
+ WriteRegister(reg_ctx, "eflags", nullptr, 4, data);
+ WriteRegister(reg_ctx, "eip", nullptr, 4, data);
+ WriteRegister(reg_ctx, "cs", nullptr, 4, data);
+ WriteRegister(reg_ctx, "ds", nullptr, 4, data);
+ WriteRegister(reg_ctx, "es", nullptr, 4, data);
+ WriteRegister(reg_ctx, "fs", nullptr, 4, data);
+ WriteRegister(reg_ctx, "gs", nullptr, 4, data);
// Write out the EXC registers
data.PutHex32(EXCRegSet);
data.PutHex32(EXCWordCount);
- WriteRegister(reg_ctx, "trapno", NULL, 4, data);
- WriteRegister(reg_ctx, "err", NULL, 4, data);
- WriteRegister(reg_ctx, "faultvaddr", NULL, 4, data);
+ WriteRegister(reg_ctx, "trapno", nullptr, 4, data);
+ WriteRegister(reg_ctx, "err", nullptr, 4, data);
+ WriteRegister(reg_ctx, "faultvaddr", nullptr, 4, data);
return true;
}
return false;
@@ -555,7 +555,7 @@ public:
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
@@ -584,23 +584,23 @@ public:
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "r0", NULL, 4, data);
- WriteRegister(reg_ctx, "r1", NULL, 4, data);
- WriteRegister(reg_ctx, "r2", NULL, 4, data);
- WriteRegister(reg_ctx, "r3", NULL, 4, data);
- WriteRegister(reg_ctx, "r4", NULL, 4, data);
- WriteRegister(reg_ctx, "r5", NULL, 4, data);
- WriteRegister(reg_ctx, "r6", NULL, 4, data);
- WriteRegister(reg_ctx, "r7", NULL, 4, data);
- WriteRegister(reg_ctx, "r8", NULL, 4, data);
- WriteRegister(reg_ctx, "r9", NULL, 4, data);
- WriteRegister(reg_ctx, "r10", NULL, 4, data);
- WriteRegister(reg_ctx, "r11", NULL, 4, data);
- WriteRegister(reg_ctx, "r12", NULL, 4, data);
- WriteRegister(reg_ctx, "sp", NULL, 4, data);
- WriteRegister(reg_ctx, "lr", NULL, 4, data);
- WriteRegister(reg_ctx, "pc", NULL, 4, data);
- WriteRegister(reg_ctx, "cpsr", NULL, 4, data);
+ WriteRegister(reg_ctx, "r0", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r1", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r2", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r3", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r4", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r5", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r6", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r7", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r8", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r9", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r10", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r11", nullptr, 4, data);
+ WriteRegister(reg_ctx, "r12", nullptr, 4, data);
+ WriteRegister(reg_ctx, "sp", nullptr, 4, data);
+ WriteRegister(reg_ctx, "lr", nullptr, 4, data);
+ WriteRegister(reg_ctx, "pc", nullptr, 4, data);
+ WriteRegister(reg_ctx, "cpsr", nullptr, 4, data);
// Write out the EXC registers
// data.PutHex32 (EXCRegSet);
@@ -710,7 +710,7 @@ public:
const char *alt_name, size_t reg_byte_size,
Stream &data) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(name);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
reg_info = reg_ctx->GetRegisterInfoByName(alt_name);
if (reg_info) {
lldb_private::RegisterValue reg_value;
@@ -739,40 +739,40 @@ public:
data.PutHex32(GPRRegSet); // Flavor
data.PutHex32(GPRWordCount);
- WriteRegister(reg_ctx, "x0", NULL, 8, data);
- WriteRegister(reg_ctx, "x1", NULL, 8, data);
- WriteRegister(reg_ctx, "x2", NULL, 8, data);
- WriteRegister(reg_ctx, "x3", NULL, 8, data);
- WriteRegister(reg_ctx, "x4", NULL, 8, data);
- WriteRegister(reg_ctx, "x5", NULL, 8, data);
- WriteRegister(reg_ctx, "x6", NULL, 8, data);
- WriteRegister(reg_ctx, "x7", NULL, 8, data);
- WriteRegister(reg_ctx, "x8", NULL, 8, data);
- WriteRegister(reg_ctx, "x9", NULL, 8, data);
- WriteRegister(reg_ctx, "x10", NULL, 8, data);
- WriteRegister(reg_ctx, "x11", NULL, 8, data);
- WriteRegister(reg_ctx, "x12", NULL, 8, data);
- WriteRegister(reg_ctx, "x13", NULL, 8, data);
- WriteRegister(reg_ctx, "x14", NULL, 8, data);
- WriteRegister(reg_ctx, "x15", NULL, 8, data);
- WriteRegister(reg_ctx, "x16", NULL, 8, data);
- WriteRegister(reg_ctx, "x17", NULL, 8, data);
- WriteRegister(reg_ctx, "x18", NULL, 8, data);
- WriteRegister(reg_ctx, "x19", NULL, 8, data);
- WriteRegister(reg_ctx, "x20", NULL, 8, data);
- WriteRegister(reg_ctx, "x21", NULL, 8, data);
- WriteRegister(reg_ctx, "x22", NULL, 8, data);
- WriteRegister(reg_ctx, "x23", NULL, 8, data);
- WriteRegister(reg_ctx, "x24", NULL, 8, data);
- WriteRegister(reg_ctx, "x25", NULL, 8, data);
- WriteRegister(reg_ctx, "x26", NULL, 8, data);
- WriteRegister(reg_ctx, "x27", NULL, 8, data);
- WriteRegister(reg_ctx, "x28", NULL, 8, data);
- WriteRegister(reg_ctx, "fp", NULL, 8, data);
- WriteRegister(reg_ctx, "lr", NULL, 8, data);
- WriteRegister(reg_ctx, "sp", NULL, 8, data);
- WriteRegister(reg_ctx, "pc", NULL, 8, data);
- WriteRegister(reg_ctx, "cpsr", NULL, 4, data);
+ WriteRegister(reg_ctx, "x0", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x1", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x2", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x3", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x4", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x5", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x6", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x7", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x8", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x9", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x10", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x11", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x12", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x13", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x14", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x15", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x16", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x17", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x18", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x19", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x20", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x21", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x22", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x23", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x24", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x25", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x26", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x27", nullptr, 8, data);
+ WriteRegister(reg_ctx, "x28", nullptr, 8, data);
+ WriteRegister(reg_ctx, "fp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "lr", nullptr, 8, data);
+ WriteRegister(reg_ctx, "sp", nullptr, 8, data);
+ WriteRegister(reg_ctx, "pc", nullptr, 8, data);
+ WriteRegister(reg_ctx, "cpsr", nullptr, 4, data);
// Write out the EXC registers
// data.PutHex32 (EXCRegSet);
@@ -889,7 +889,7 @@ ObjectFile *ObjectFileMachO::CreateMemoryInstance(
if (objfile_up.get() && objfile_up->ParseHeader())
return objfile_up.release();
}
- return NULL;
+ return nullptr;
}
size_t ObjectFileMachO::GetModuleSpecifications(
@@ -1312,7 +1312,7 @@ Symtab *ObjectFileMachO::GetSymtab() {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
m_symtab_up.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> symtab_guard(
m_symtab_up->GetMutex());
@@ -1332,14 +1332,14 @@ bool ObjectFileMachO::IsStripped() {
const lldb::offset_t load_cmd_offset = offset;
load_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == LC_DYSYMTAB) {
m_dysymtab.cmd = lc.cmd;
m_dysymtab.cmdsize = lc.cmdsize;
if (m_data.GetU32(&offset, &m_dysymtab.ilocalsym,
(sizeof(m_dysymtab) / sizeof(uint32_t)) - 2) ==
- NULL) {
+ nullptr) {
// Clear m_dysymtab if we were unable to read all items from the
// load command
::memset(&m_dysymtab, 0, sizeof(m_dysymtab));
@@ -1361,7 +1361,7 @@ ObjectFileMachO::EncryptedFileRanges ObjectFileMachO::GetEncryptedFileRanges() {
encryption_info_command encryption_cmd;
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t load_cmd_offset = offset;
- if (m_data.GetU32(&offset, &encryption_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &encryption_cmd, 2) == nullptr)
break;
// LC_ENCRYPTION_INFO and LC_ENCRYPTION_INFO_64 have the same sizes for the
@@ -1713,15 +1713,15 @@ void ObjectFileMachO::ProcessSegmentCommand(const load_command &load_cmd_,
for (segment_sect_idx = 0; segment_sect_idx < load_cmd.nsects;
++segment_sect_idx) {
if (m_data.GetU8(&offset, (uint8_t *)sect64.sectname,
- sizeof(sect64.sectname)) == NULL)
+ sizeof(sect64.sectname)) == nullptr)
break;
if (m_data.GetU8(&offset, (uint8_t *)sect64.segname,
- sizeof(sect64.segname)) == NULL)
+ sizeof(sect64.segname)) == nullptr)
break;
sect64.addr = m_data.GetAddress(&offset);
sect64.size = m_data.GetAddress(&offset);
- if (m_data.GetU32(&offset, &sect64.offset, num_u32s) == NULL)
+ if (m_data.GetU32(&offset, &sect64.offset, num_u32s) == nullptr)
break;
// Keep a list of mach sections around in case we need to get at data that
@@ -1830,7 +1830,7 @@ void ObjectFileMachO::ProcessSegmentCommand(const load_command &load_cmd_,
bool section_is_encrypted = false;
if (!segment_is_encrypted && load_cmd.filesize != 0)
section_is_encrypted = context.EncryptedRanges.FindEntryThatContains(
- sect64.offset) != NULL;
+ sect64.offset) != nullptr;
section_sp->SetIsEncrypted(segment_is_encrypted || section_is_encrypted);
section_sp->SetPermissions(segment_permissions);
@@ -1856,7 +1856,7 @@ void ObjectFileMachO::ProcessSegmentCommand(const load_command &load_cmd_,
if (curr_section_sp.get()) {
if (curr_section_sp->GetByteSize() == 0) {
- if (next_section_sp.get() != NULL)
+ if (next_section_sp.get() != nullptr)
curr_section_sp->SetByteSize(next_section_sp->GetFileAddress() -
curr_section_sp->GetFileAddress());
else
@@ -1892,7 +1892,7 @@ void ObjectFileMachO::CreateSections(SectionList &unified_section_list) {
struct load_command load_cmd;
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t load_cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
if (load_cmd.cmd == LC_SEGMENT || load_cmd.cmd == LC_SEGMENT_64)
@@ -2021,7 +2021,7 @@ static bool ParseTrieEntries(DataExtractor &data, lldb::offset_t offset,
if (terminalSize != 0) {
TrieEntryWithOffset e(offset);
e.entry.flags = data.GetULEB128(&offset);
- const char *import_name = NULL;
+ const char *import_name = nullptr;
if (e.entry.flags & EXPORT_SYMBOL_FLAGS_REEXPORT) {
e.entry.address = 0;
e.entry.other = data.GetULEB128(&offset); // dylib ordinal
@@ -2129,7 +2129,7 @@ size_t ObjectFileMachO::ParseSymtab() {
const lldb::offset_t cmd_offset = offset;
// Read in the load command and load command size
struct load_command lc;
- if (m_data.GetU32(&offset, &lc, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc, 2) == nullptr)
break;
// Watch for the symbol table load command
switch (lc.cmd) {
@@ -2138,7 +2138,7 @@ size_t ObjectFileMachO::ParseSymtab() {
symtab_load_command.cmdsize = lc.cmdsize;
// Read in the rest of the symtab load command
if (m_data.GetU32(&offset, &symtab_load_command.symoff, 4) ==
- 0) // fill in symoff, nsyms, stroff, strsize fields
+ nullptr) // fill in symoff, nsyms, stroff, strsize fields
return 0;
if (symtab_load_command.symoff == 0) {
if (log)
@@ -2201,7 +2201,7 @@ size_t ObjectFileMachO::ParseSymtab() {
function_starts_load_command.cmd = lc.cmd;
function_starts_load_command.cmdsize = lc.cmdsize;
if (m_data.GetU32(&offset, &function_starts_load_command.dataoff, 2) ==
- NULL) // fill in symoff, nsyms, stroff, strsize fields
+ nullptr) // fill in symoff, nsyms, stroff, strsize fields
memset(&function_starts_load_command, 0,
sizeof(function_starts_load_command));
break;
@@ -2215,7 +2215,7 @@ size_t ObjectFileMachO::ParseSymtab() {
if (symtab_load_command.cmd) {
Symtab *symtab = m_symtab_up.get();
SectionList *section_list = GetSectionList();
- if (section_list == NULL)
+ if (section_list == nullptr)
return 0;
const uint32_t addr_byte_size = m_data.GetAddressByteSize();
@@ -2224,12 +2224,12 @@ size_t ObjectFileMachO::ParseSymtab() {
const size_t nlist_byte_size =
bit_width_32 ? sizeof(struct nlist) : sizeof(struct nlist_64);
- DataExtractor nlist_data(NULL, 0, byte_order, addr_byte_size);
- DataExtractor strtab_data(NULL, 0, byte_order, addr_byte_size);
- DataExtractor function_starts_data(NULL, 0, byte_order, addr_byte_size);
- DataExtractor indirect_symbol_index_data(NULL, 0, byte_order,
+ DataExtractor nlist_data(nullptr, 0, byte_order, addr_byte_size);
+ DataExtractor strtab_data(nullptr, 0, byte_order, addr_byte_size);
+ DataExtractor function_starts_data(nullptr, 0, byte_order, addr_byte_size);
+ DataExtractor indirect_symbol_index_data(nullptr, 0, byte_order,
addr_byte_size);
- DataExtractor dyld_trie_data(NULL, 0, byte_order, addr_byte_size);
+ DataExtractor dyld_trie_data(nullptr, 0, byte_order, addr_byte_size);
const addr_t nlist_data_byte_size =
symtab_load_command.nsyms * nlist_byte_size;
@@ -2550,10 +2550,10 @@ size_t ObjectFileMachO::ParseSymtab() {
// so we know
NListIndexToSymbolIndexMap m_nlist_idx_to_sym_idx;
uint32_t nlist_idx = 0;
- Symbol *symbol_ptr = NULL;
+ Symbol *symbol_ptr = nullptr;
uint32_t sym_idx = 0;
- Symbol *sym = NULL;
+ Symbol *sym = nullptr;
size_t num_syms = 0;
std::string memory_symbol_name;
uint32_t unmapped_local_symbols_found = 0;
@@ -3749,7 +3749,7 @@ size_t ObjectFileMachO::ParseSymtab() {
// If the sym array was not created while parsing the DSC unmapped
// symbols, create it now.
- if (sym == NULL) {
+ if (sym == nullptr) {
sym = symtab->Resize(symtab_load_command.nsyms +
m_dysymtab.nindirectsyms);
num_syms = symtab->GetNumSymbols();
@@ -3780,12 +3780,12 @@ size_t ObjectFileMachO::ParseSymtab() {
nlist.n_value = nlist_data.GetAddress_unchecked(&nlist_data_offset);
SymbolType type = eSymbolTypeInvalid;
- const char *symbol_name = NULL;
+ const char *symbol_name = nullptr;
if (have_strtab_data) {
symbol_name = strtab_data.PeekCStr(nlist.n_strx);
- if (symbol_name == NULL) {
+ if (symbol_name == nullptr) {
// No symbol should be NULL, even the symbols with no string values
// should have an offset zero which points to an empty C-string
Host::SystemLog(Host::eSystemLogError,
@@ -3796,7 +3796,7 @@ size_t ObjectFileMachO::ParseSymtab() {
continue;
}
if (symbol_name[0] == '\0')
- symbol_name = NULL;
+ symbol_name = nullptr;
} else {
const addr_t str_addr = strtab_addr + nlist.n_strx;
Status str_error;
@@ -3804,7 +3804,7 @@ size_t ObjectFileMachO::ParseSymtab() {
str_error))
symbol_name = memory_symbol_name.c_str();
}
- const char *symbol_name_non_abi_mangled = NULL;
+ const char *symbol_name_non_abi_mangled = nullptr;
SectionSP symbol_section;
lldb::addr_t symbol_byte_size = 0;
@@ -3957,7 +3957,7 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_SO:
// source file name
type = eSymbolTypeSourceFile;
- if (symbol_name == NULL) {
+ if (symbol_name == nullptr) {
add_nlist = false;
if (N_SO_index != UINT32_MAX) {
// Set the size of the N_SO to the terminating index of this
@@ -4426,7 +4426,7 @@ size_t ObjectFileMachO::ParseSymtab() {
if (func_start_entry->addr != symbol_lookup_file_addr &&
func_start_entry->addr != (symbol_lookup_file_addr + 1)) {
// Not the right entry, NULL it out...
- func_start_entry = NULL;
+ func_start_entry = nullptr;
}
}
if (func_start_entry) {
@@ -4710,7 +4710,7 @@ size_t ObjectFileMachO::ParseSymtab() {
NListIndexToSymbolIndexMap::const_iterator index_pos =
m_nlist_idx_to_sym_idx.find(stub_sym_id);
- Symbol *stub_symbol = NULL;
+ Symbol *stub_symbol = nullptr;
if (index_pos != end_index_pos) {
// We have a remapping from the original nlist index to a
// current symbol index, so just look this up by index
@@ -4742,7 +4742,7 @@ size_t ObjectFileMachO::ParseSymtab() {
Mangled stub_symbol_mangled_name(stub_symbol->GetMangled());
if (sym_idx >= num_syms) {
sym = symtab->Resize(++num_syms);
- stub_symbol = NULL; // this pointer no longer valid
+ stub_symbol = nullptr; // this pointer no longer valid
}
sym[sym_idx].SetID(synthetic_sym_id++);
sym[sym_idx].GetMangled() = stub_symbol_mangled_name;
@@ -4828,10 +4828,10 @@ void ObjectFileMachO::Dump(Stream *s) {
SectionList *sections = GetSectionList();
if (sections)
- sections->Dump(s, NULL, true, UINT32_MAX);
+ sections->Dump(s, nullptr, true, UINT32_MAX);
if (m_symtab_up)
- m_symtab_up->Dump(s, NULL, eSortOrderNone);
+ m_symtab_up->Dump(s, nullptr, eSortOrderNone);
}
}
@@ -4844,7 +4844,7 @@ UUID ObjectFileMachO::GetUUID(const llvm::MachO::mach_header &header,
lldb::offset_t offset = lc_offset;
for (i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
if (load_cmd.cmd == LC_UUID) {
@@ -4982,7 +4982,7 @@ ObjectFileMachO::GetArchitecture(const llvm::MachO::mach_header &header,
lldb::offset_t offset = lc_offset;
for (uint32_t i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
struct version_min_command version_min;
@@ -5015,7 +5015,7 @@ ObjectFileMachO::GetArchitecture(const llvm::MachO::mach_header &header,
offset = lc_offset;
for (uint32_t i = 0; i < header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
do {
if (load_cmd.cmd == llvm::MachO::LC_BUILD_VERSION) {
@@ -5077,7 +5077,7 @@ uint32_t ObjectFileMachO::GetDependentModules(FileSpecList &files) {
uint32_t i;
for (i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
switch (load_cmd.cmd) {
@@ -5211,7 +5211,7 @@ lldb_private::Address ObjectFileMachO::GetEntryPointAddress() {
for (i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
switch (load_cmd.cmd) {
@@ -5350,7 +5350,7 @@ uint32_t ObjectFileMachO::GetNumThreadContexts() {
thread_command thread_cmd;
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &thread_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &thread_cmd, 2) == nullptr)
break;
if (thread_cmd.cmd == LC_THREAD) {
@@ -5377,8 +5377,8 @@ std::string ObjectFileMachO::GetIdentifierString() {
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
load_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
- break;
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
+ break;
if (lc.cmd == LC_NOTE)
{
char data_owner[17];
@@ -5422,7 +5422,7 @@ std::string ObjectFileMachO::GetIdentifierString() {
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
struct ident_command ident_command;
- if (m_data.GetU32(&offset, &ident_command, 2) == NULL)
+ if (m_data.GetU32(&offset, &ident_command, 2) == nullptr)
break;
if (ident_command.cmd == LC_IDENT && ident_command.cmdsize != 0) {
char *buf = (char *) malloc (ident_command.cmdsize);
@@ -5451,8 +5451,8 @@ bool ObjectFileMachO::GetCorefileMainBinaryInfo (addr_t &address, UUID &uuid) {
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
load_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
- break;
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
+ break;
if (lc.cmd == LC_NOTE)
{
char data_owner[17];
@@ -5649,13 +5649,13 @@ llvm::VersionTuple ObjectFileMachO::GetVersion() {
uint32_t i;
for (i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd, 2) == nullptr)
break;
if (load_cmd.cmd == LC_ID_DYLIB) {
if (version_cmd == 0) {
version_cmd = load_cmd.cmd;
- if (m_data.GetU32(&offset, &load_cmd.dylib, 4) == NULL)
+ if (m_data.GetU32(&offset, &load_cmd.dylib, 4) == nullptr)
break;
version = load_cmd.dylib.current_version;
}
@@ -5795,7 +5795,7 @@ llvm::VersionTuple ObjectFileMachO::GetMinimumOSVersion() {
const lldb::offset_t load_cmd_offset = offset;
version_min_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == llvm::MachO::LC_VERSION_MIN_MACOSX ||
lc.cmd == llvm::MachO::LC_VERSION_MIN_IPHONEOS ||
@@ -5855,7 +5855,7 @@ uint32_t ObjectFileMachO::GetSDKVersion(uint32_t *versions,
const lldb::offset_t load_cmd_offset = offset;
version_min_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == llvm::MachO::LC_VERSION_MIN_MACOSX ||
lc.cmd == llvm::MachO::LC_VERSION_MIN_IPHONEOS ||
@@ -5886,7 +5886,7 @@ uint32_t ObjectFileMachO::GetSDKVersion(uint32_t *versions,
const lldb::offset_t load_cmd_offset = offset;
version_min_command lc;
- if (m_data.GetU32(&offset, &lc.cmd, 2) == NULL)
+ if (m_data.GetU32(&offset, &lc.cmd, 2) == nullptr)
break;
if (lc.cmd == llvm::MachO::LC_BUILD_VERSION) {
// struct build_version_command {
@@ -5932,7 +5932,7 @@ uint32_t ObjectFileMachO::GetSDKVersion(uint32_t *versions,
// the sentinel value indicating that this object file
// does not have a valid minimum os version #.
if (m_sdk_versions.size() > 1) {
- if (versions != NULL && num_versions > 0) {
+ if (versions != nullptr && num_versions > 0) {
for (size_t i = 0; i < num_versions; ++i) {
if (i < m_sdk_versions.size())
versions[i] = m_sdk_versions[i];
diff --git a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 2bd75a4fadf..fab379037fc 100644
--- a/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -596,7 +596,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
- if (m_symtab_up == NULL) {
+ if (m_symtab_up == nullptr) {
SectionList *sect_list = GetSectionList();
m_symtab_up.reset(new Symtab(this));
std::lock_guard<std::recursive_mutex> guard(m_symtab_up->GetMutex());
@@ -627,7 +627,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
for (uint32_t i = 0; i < num_syms; ++i) {
coff_symbol_t symbol;
const uint32_t symbol_offset = offset;
- const char *symbol_name_cstr = NULL;
+ const char *symbol_name_cstr = nullptr;
// If the first 4 bytes of the symbol string are zero, then they
// are followed by a 4-byte string table offset. Else these
// 8 bytes contain the symbol name
@@ -642,7 +642,7 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
// bytes
offset += sizeof(symbol.name) - 4; // Skip remaining
symbol_name_cstr = symtab_data.PeekCStr(symbol_offset);
- if (symbol_name_cstr == NULL)
+ if (symbol_name_cstr == nullptr)
break;
symbol_name.assign(symbol_name_cstr, sizeof(symbol.name));
}
@@ -1006,10 +1006,10 @@ void ObjectFilePECOFF::Dump(Stream *s) {
SectionList *sections = GetSectionList();
if (sections)
- sections->Dump(s, NULL, true, UINT32_MAX);
+ sections->Dump(s, nullptr, true, UINT32_MAX);
if (m_symtab_up)
- m_symtab_up->Dump(s, NULL, eSortOrderNone);
+ m_symtab_up->Dump(s, nullptr, eSortOrderNone);
if (m_dos_header.e_magic)
DumpDOSHeader(s, m_dos_header);
diff --git a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index 874ca85fb43..c1fe0cc8ddd 100644
--- a/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -59,7 +59,7 @@ OperatingSystem *OperatingSystemPython::CreateInstance(Process *process,
if (os_up.get() && os_up->IsValid())
return os_up.release();
}
- return NULL;
+ return nullptr;
}
ConstString OperatingSystemPython::GetPluginNameStatic() {
@@ -75,7 +75,7 @@ const char *OperatingSystemPython::GetPluginDescriptionStatic() {
OperatingSystemPython::OperatingSystemPython(lldb_private::Process *process,
const FileSpec &python_module_path)
: OperatingSystem(process), m_thread_list_valobj_sp(), m_register_info_up(),
- m_interpreter(NULL), m_python_object_sp() {
+ m_interpreter(nullptr), m_python_object_sp() {
if (!process)
return;
TargetSP target_sp = process->CalculateTarget();
@@ -115,9 +115,9 @@ OperatingSystemPython::OperatingSystemPython(lldb_private::Process *process,
OperatingSystemPython::~OperatingSystemPython() {}
DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() {
- if (m_register_info_up == NULL) {
+ if (m_register_info_up == nullptr) {
if (!m_interpreter || !m_python_object_sp)
- return NULL;
+ return nullptr;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OS));
if (log)
@@ -128,7 +128,7 @@ DynamicRegisterInfo *OperatingSystemPython::GetDynamicRegisterInfo() {
StructuredData::DictionarySP dictionary =
m_interpreter->OSPlugin_RegisterInfo(m_python_object_sp);
if (!dictionary)
- return NULL;
+ return nullptr;
m_register_info_up.reset(new DynamicRegisterInfo(
*dictionary, m_process->GetTarget().GetArchitecture()));
@@ -198,9 +198,9 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
StructuredData::ObjectSP thread_dict_obj =
threads_list->GetItemAtIndex(i);
if (auto thread_dict = thread_dict_obj->GetAsDictionary()) {
- ThreadSP thread_sp(
- CreateThreadFromThreadInfo(*thread_dict, core_thread_list,
- old_thread_list, core_used_map, NULL));
+ ThreadSP thread_sp(CreateThreadFromThreadInfo(
+ *thread_dict, core_thread_list, old_thread_list, core_used_map,
+ nullptr));
if (thread_sp)
new_thread_list.AddThread(thread_sp);
}
diff --git a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index 7d8f43a697a..946f0ea3a5c 100644
--- a/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -262,7 +262,7 @@ lldb::ProcessSP PlatformFreeBSD::Attach(ProcessAttachInfo &attach_info,
Status &error) {
lldb::ProcessSP process_sp;
if (IsHost()) {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
ArchSpec emptyArchSpec;
@@ -279,7 +279,7 @@ lldb::ProcessSP PlatformFreeBSD::Attach(ProcessAttachInfo &attach_info,
// even when debugging locally we are debugging remotely! Just like the
// darwin plugin.
process_sp = target->CreateProcess(
- attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
+ attach_info.GetListenerForProcess(debugger), "gdb-remote", nullptr);
if (process_sp)
error = process_sp->Attach(attach_info);
diff --git a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
index a4d381eafe9..d0ad2f34d11 100644
--- a/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -237,7 +237,7 @@ PlatformLinux::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) {
// Figure out what shell we're planning on using.
const char *shell_name = strrchr(shell_string.c_str(), '/');
- if (shell_name == NULL)
+ if (shell_name == nullptr)
shell_name = shell_string.c_str();
else
shell_name++;
@@ -372,7 +372,7 @@ PlatformLinux::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
// Handle the hijacking of process events.
if (listener_sp) {
const StateType state = process_sp->WaitForProcessToStop(
- llvm::None, NULL, false, listener_sp);
+ llvm::None, nullptr, false, listener_sp);
LLDB_LOG(log, "pid {0} state {0}", process_sp->GetID(), state);
}
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index a4b17a93d7d..955987121d6 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -374,7 +374,7 @@ Status PlatformDarwin::GetSharedModule(
new_module_spec.GetFileSpec() = bundle_directory;
if (Host::ResolveExecutableInBundle(new_module_spec.GetFileSpec())) {
Status new_error(Platform::GetSharedModule(
- new_module_spec, process, module_sp, NULL, old_module_sp_ptr,
+ new_module_spec, process, module_sp, nullptr, old_module_sp_ptr,
did_create_ptr));
if (module_sp)
@@ -401,7 +401,7 @@ Status PlatformDarwin::GetSharedModule(
ModuleSpec new_module_spec(module_spec);
new_module_spec.GetFileSpec() = new_file_spec;
Status new_error(Platform::GetSharedModule(
- new_module_spec, process, module_sp, NULL,
+ new_module_spec, process, module_sp, nullptr,
old_module_sp_ptr, did_create_ptr));
if (module_sp) {
@@ -1171,7 +1171,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
std::string command_output;
Status error =
Host::RunShellCommand("/usr/bin/xcode-select --print-path",
- NULL, // current working directory
+ nullptr, // current working directory
&exit_status, &signo, &command_output,
std::chrono::seconds(2), // short timeout
false); // don't run in a shell
@@ -1212,7 +1212,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
assert(m_developer_directory.empty() == false);
if (m_developer_directory[0])
return m_developer_directory.c_str();
- return NULL;
+ return nullptr;
}
BreakpointSP PlatformDarwin::SetThreadCreationBreakpoint(Target &target) {
@@ -1233,7 +1233,7 @@ BreakpointSP PlatformDarwin::SetThreadCreationBreakpoint(Target &target) {
bool internal = true;
bool hardware = false;
LazyBool skip_prologue = eLazyBoolNo;
- bp_sp = target.CreateBreakpoint(&bp_modules, NULL, g_bp_names,
+ bp_sp = target.CreateBreakpoint(&bp_modules, nullptr, g_bp_names,
llvm::array_lengthof(g_bp_names),
eFunctionNameTypeFull, eLanguageTypeUnknown,
0, skip_prologue, internal, hardware);
@@ -1250,7 +1250,7 @@ PlatformDarwin::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) {
std::string shell_string = shell.GetPath();
const char *shell_name = strrchr(shell_string.c_str(), '/');
- if (shell_name == NULL)
+ if (shell_name == nullptr)
shell_name = shell_string.c_str();
else
shell_name++;
@@ -1341,7 +1341,7 @@ static FileSpec GetXcodeContentsPath() {
const char *command = "/usr/bin/xcode-select -p";
lldb_private::Status error = Host::RunShellCommand(
command, // shell command to run
- NULL, // current working directory
+ nullptr, // current working directory
&status, // Put the exit status of the process in here
&signo, // Put the signal that caused the process to exit in here
&output, // Get the output from the command and place it in this
@@ -1742,7 +1742,7 @@ PlatformDarwin::FindBundleBinaryInExecSearchPaths (const ModuleSpec &module_spec
ModuleSpec new_module_spec(module_spec);
new_module_spec.GetFileSpec() = path_to_try;
Status new_error(Platform::GetSharedModule(
- new_module_spec, process, module_sp, NULL, old_module_sp_ptr,
+ new_module_spec, process, module_sp, nullptr, old_module_sp_ptr,
did_create_ptr));
if (module_sp) {
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 47b7b9f77eb..5fbb0f1babd 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -183,7 +183,7 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) {
const char *command = "xcrun -sdk macosx --show-sdk-path";
lldb_private::Status error = RunShellCommand(
command, // shell command to run
- NULL, // current working directory
+ nullptr, // current working directory
&status, // Put the exit status of the process in here
&signo, // Put the signal that caused the process to exit in
// here
@@ -309,7 +309,7 @@ lldb_private::Status PlatformMacOSX::GetSharedModule(
if (module_spec.GetArchitecture().GetCore() ==
ArchSpec::eCore_x86_64_x86_64h) {
ObjectFile *objfile = module_sp->GetObjectFile();
- if (objfile == NULL) {
+ if (objfile == nullptr) {
// We didn't find an x86_64h slice, fall back to a x86_64 slice
ModuleSpec module_spec_x86_64(module_spec);
module_spec_x86_64.GetArchitecture() = ArchSpec("x86_64-apple-macosx");
diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
index b77a54958b8..439ca8fcf05 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
@@ -81,7 +81,7 @@ Status PlatformRemoteDarwinDevice::ResolveExecutable(
if (resolved_module_spec.GetArchitecture().IsValid() ||
resolved_module_spec.GetUUID().IsValid()) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- NULL, NULL, NULL);
+ nullptr, nullptr, nullptr);
if (exe_module_sp && exe_module_sp->GetObjectFile())
return error;
@@ -95,7 +95,7 @@ Status PlatformRemoteDarwinDevice::ResolveExecutable(
idx, resolved_module_spec.GetArchitecture());
++idx) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- NULL, NULL, NULL);
+ nullptr, nullptr, nullptr);
// Did we find an executable using one of the
if (error.Success()) {
if (exe_module_sp && exe_module_sp->GetObjectFile())
@@ -308,12 +308,12 @@ PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion() {
return &m_sdk_directory_infos[i];
}
}
- return NULL;
+ return nullptr;
}
const PlatformRemoteDarwinDevice::SDKDirectoryInfo *
PlatformRemoteDarwinDevice::GetSDKDirectoryForLatestOSVersion() {
- const PlatformRemoteDarwinDevice::SDKDirectoryInfo *result = NULL;
+ const PlatformRemoteDarwinDevice::SDKDirectoryInfo *result = nullptr;
if (UpdateSDKDirectoryInfosIfNeeded()) {
auto max = std::max_element(
m_sdk_directory_infos.begin(), m_sdk_directory_infos.end(),
@@ -344,7 +344,7 @@ const char *PlatformRemoteDarwinDevice::GetDeviceSupportDirectory() {
assert(m_device_support_directory.empty() == false);
if (m_device_support_directory[0])
return m_device_support_directory.c_str();
- return NULL;
+ return nullptr;
}
const char *PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryForOSVersion() {
@@ -354,7 +354,7 @@ const char *PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryForOSVersion()
if (m_device_support_directory_for_os_version.empty()) {
const PlatformRemoteDarwinDevice::SDKDirectoryInfo *sdk_dir_info =
GetSDKDirectoryForCurrentOSVersion();
- if (sdk_dir_info == NULL)
+ if (sdk_dir_info == nullptr)
sdk_dir_info = GetSDKDirectoryForLatestOSVersion();
if (sdk_dir_info) {
char path[PATH_MAX];
@@ -374,7 +374,7 @@ const char *PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryForOSVersion()
assert(m_device_support_directory_for_os_version.empty() == false);
if (m_device_support_directory_for_os_version[0])
return m_device_support_directory_for_os_version.c_str();
- return NULL;
+ return nullptr;
}
uint32_t PlatformRemoteDarwinDevice::FindFileInAllSDKs(const char *platform_file_path,
@@ -523,7 +523,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
if (GetFileInSDK(platform_file_path, connected_sdk_idx,
platform_module_spec.GetFileSpec())) {
module_sp.reset();
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
m_last_module_sdk_idx = connected_sdk_idx;
error.Clear();
@@ -540,7 +540,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
if (GetFileInSDK(platform_file_path, m_last_module_sdk_idx,
platform_module_spec.GetFileSpec())) {
module_sp.reset();
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
error.Clear();
return error;
@@ -562,7 +562,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
if (GetFileInSDK(platform_file_path, current_sdk_idx,
platform_module_spec.GetFileSpec())) {
module_sp.reset();
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
m_last_module_sdk_idx = current_sdk_idx;
error.Clear();
@@ -583,7 +583,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
platform_module_spec.GetFileSpec())) {
// printf ("sdk[%u]: '%s'\n", sdk_idx, local_file.GetPath().c_str());
- error = ResolveExecutable(platform_module_spec, module_sp, NULL);
+ error = ResolveExecutable(platform_module_spec, module_sp, nullptr);
if (module_sp) {
// Remember the index of the last SDK that we found a file in in case
// the wrong SDK was selected.
@@ -648,7 +648,7 @@ uint32_t PlatformRemoteDarwinDevice::GetConnectedSDKIndex() {
uint32_t PlatformRemoteDarwinDevice::GetSDKIndexBySDKDirectoryInfo(
const SDKDirectoryInfo *sdk_info) {
- if (sdk_info == NULL) {
+ if (sdk_info == nullptr) {
return UINT32_MAX;
}
diff --git a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
index f741f4a0516..63245d18fc5 100644
--- a/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ b/lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -206,7 +206,7 @@ PlatformNetBSD::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) {
// Figure out what shell we're planning on using.
const char *shell_name = strrchr(shell_string.c_str(), '/');
- if (shell_name == NULL)
+ if (shell_name == nullptr)
shell_name = shell_string.c_str();
else
shell_name++;
@@ -322,7 +322,7 @@ PlatformNetBSD::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
// Handle the hijacking of process events.
if (listener_sp) {
const StateType state = process_sp->WaitForProcessToStop(
- llvm::None, NULL, false, listener_sp);
+ llvm::None, nullptr, false, listener_sp);
LLDB_LOG(log, "pid {0} state {0}", process_sp->GetID(), state);
}
diff --git a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index 4b5a985b6d5..d10557596ff 100644
--- a/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -223,8 +223,8 @@ static uint32_t chown_file(Platform *platform, const char *path,
command.Printf(":%d", gid);
command.Printf("%s", path);
int status;
- platform->RunShellCommand(command.GetData(), NULL, &status, NULL, NULL,
- std::chrono::seconds(10));
+ platform->RunShellCommand(command.GetData(), nullptr, &status, nullptr,
+ nullptr, std::chrono::seconds(10));
return status;
}
@@ -248,7 +248,7 @@ PlatformPOSIX::PutFile(const lldb_private::FileSpec &source,
StreamString command;
command.Printf("cp %s %s", src_path.c_str(), dst_path.c_str());
int status;
- RunShellCommand(command.GetData(), NULL, &status, NULL, NULL,
+ RunShellCommand(command.GetData(), nullptr, &status, nullptr, nullptr,
std::chrono::seconds(10));
if (status != 0)
return Status("unable to perform copy");
@@ -279,8 +279,8 @@ PlatformPOSIX::PutFile(const lldb_private::FileSpec &source,
if (log)
log->Printf("[PutFile] Running command: %s\n", command.GetData());
int retcode;
- Host::RunShellCommand(command.GetData(), NULL, &retcode, NULL, NULL,
- std::chrono::minutes(1));
+ Host::RunShellCommand(command.GetData(), nullptr, &retcode, nullptr,
+ nullptr, std::chrono::minutes(1));
if (retcode == 0) {
// Don't chown a local file for a remote system
// if (chown_file(this,dst_path.c_str(),uid,gid) != 0)
@@ -315,7 +315,7 @@ lldb_private::Status PlatformPOSIX::GetFile(
StreamString cp_command;
cp_command.Printf("cp %s %s", src_path.c_str(), dst_path.c_str());
int status;
- RunShellCommand(cp_command.GetData(), NULL, &status, NULL, NULL,
+ RunShellCommand(cp_command.GetData(), nullptr, &status, nullptr, nullptr,
std::chrono::seconds(10));
if (status != 0)
return Status("unable to perform copy");
@@ -337,8 +337,8 @@ lldb_private::Status PlatformPOSIX::GetFile(
if (log)
log->Printf("[GetFile] Running command: %s\n", command.GetData());
int retcode;
- Host::RunShellCommand(command.GetData(), NULL, &retcode, NULL, NULL,
- std::chrono::minutes(1));
+ Host::RunShellCommand(command.GetData(), nullptr, &retcode, nullptr,
+ nullptr, std::chrono::minutes(1));
if (retcode == 0)
return Status();
// If we are here, rsync has failed - let's try the slow way before
@@ -509,11 +509,11 @@ lldb::ProcessSP PlatformPOSIX::Attach(ProcessAttachInfo &attach_info,
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM));
if (IsHost()) {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(
- debugger, "", "", eLoadDependentsNo, NULL, new_target_sp);
+ debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp);
target = new_target_sp.get();
if (log)
log->Printf("PlatformPOSIX::%s created new target", __FUNCTION__);
@@ -537,7 +537,7 @@ lldb::ProcessSP PlatformPOSIX::Attach(ProcessAttachInfo &attach_info,
process_sp =
target->CreateProcess(attach_info.GetListenerForProcess(debugger),
- attach_info.GetProcessPluginName(), NULL);
+ attach_info.GetProcessPluginName(), nullptr);
if (process_sp) {
ListenerSP listener_sp = attach_info.GetHijackListener();
diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index dea7ccf0422..9c52b59e2b0 100644
--- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -109,7 +109,8 @@ Status PlatformRemoteGDBServer::ResolveExecutable(
if (resolved_module_spec.GetArchitecture().IsValid() ||
resolved_module_spec.GetUUID().IsValid()) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- module_search_paths_ptr, NULL, NULL);
+ module_search_paths_ptr, nullptr,
+ nullptr);
if (exe_module_sp && exe_module_sp->GetObjectFile())
return error;
@@ -123,7 +124,8 @@ Status PlatformRemoteGDBServer::ResolveExecutable(
idx, resolved_module_spec.GetArchitecture());
++idx) {
error = ModuleList::GetSharedModule(resolved_module_spec, exe_module_sp,
- module_search_paths_ptr, NULL, NULL);
+ module_search_paths_ptr, nullptr,
+ nullptr);
// Did we find an executable using one of the
if (error.Success()) {
if (exe_module_sp && exe_module_sp->GetObjectFile())
@@ -333,7 +335,7 @@ Status PlatformRemoteGDBServer::DisconnectRemote() {
const char *PlatformRemoteGDBServer::GetHostname() {
m_gdb_client.GetHostname(m_name);
if (m_name.empty())
- return NULL;
+ return nullptr;
return m_name.c_str();
}
@@ -469,11 +471,11 @@ lldb::ProcessSP PlatformRemoteGDBServer::DebugProcess(
error.SetErrorStringWithFormat("unable to launch a GDB server on '%s'",
GetHostname());
} else {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(
- debugger, "", "", eLoadDependentsNo, NULL, new_target_sp);
+ debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp);
target = new_target_sp.get();
} else
error.Clear();
@@ -484,7 +486,7 @@ lldb::ProcessSP PlatformRemoteGDBServer::DebugProcess(
// The darwin always currently uses the GDB remote debugger plug-in
// so even when debugging locally we are debugging remotely!
process_sp = target->CreateProcess(launch_info.GetListener(),
- "gdb-remote", NULL);
+ "gdb-remote", nullptr);
if (process_sp) {
error = process_sp->ConnectRemote(nullptr, connect_url.c_str());
@@ -555,11 +557,11 @@ lldb::ProcessSP PlatformRemoteGDBServer::Attach(
error.SetErrorStringWithFormat("unable to launch a GDB server on '%s'",
GetHostname());
} else {
- if (target == NULL) {
+ if (target == nullptr) {
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(
- debugger, "", "", eLoadDependentsNo, NULL, new_target_sp);
+ debugger, "", "", eLoadDependentsNo, nullptr, new_target_sp);
target = new_target_sp.get();
} else
error.Clear();
@@ -569,8 +571,9 @@ lldb::ProcessSP PlatformRemoteGDBServer::Attach(
// The darwin always currently uses the GDB remote debugger plug-in
// so even when debugging locally we are debugging remotely!
- process_sp = target->CreateProcess(
- attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
+ process_sp =
+ target->CreateProcess(attach_info.GetListenerForProcess(debugger),
+ "gdb-remote", nullptr);
if (process_sp) {
error = process_sp->ConnectRemote(nullptr, connect_url.c_str());
if (error.Success()) {
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index c35cb54bb69..029bdf48b12 100644
--- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -29,13 +29,13 @@ static inline int get_cpuid_count(unsigned int __leaf,
unsigned int *__eax, unsigned int *__ebx,
unsigned int *__ecx, unsigned int *__edx)
{
- unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, 0);
+ unsigned int __max_leaf = __get_cpuid_max(__leaf & 0x80000000, nullptr);
- if (__max_leaf == 0 || __max_leaf < __leaf)
- return 0;
+ if (__max_leaf == 0 || __max_leaf < __leaf)
+ return 0;
- __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
- return 1;
+ __cpuid_count(__leaf, __subleaf, *__eax, *__ebx, *__ecx, *__edx);
+ return 1;
}
using namespace lldb_private;
diff --git a/lldb/source/Plugins/Process/Linux/ProcessorTrace.cpp b/lldb/source/Plugins/Process/Linux/ProcessorTrace.cpp
index 749a765731b..a7e8c00f0fe 100644
--- a/lldb/source/Plugins/Process/Linux/ProcessorTrace.cpp
+++ b/lldb/source/Plugins/Process/Linux/ProcessorTrace.cpp
@@ -117,7 +117,7 @@ Status ProcessorTraceMonitor::StartTrace(lldb::pid_t pid, lldb::tid_t tid,
errno = 0;
auto base =
- mmap(NULL, (metabufsize + page_size), PROT_WRITE, MAP_SHARED, fd, 0);
+ mmap(nullptr, (metabufsize + page_size), PROT_WRITE, MAP_SHARED, fd, 0);
if (base == MAP_FAILED) {
LLDB_LOG(log, "mmap base error {0}", errno);
@@ -133,7 +133,7 @@ Status ProcessorTraceMonitor::StartTrace(lldb::pid_t pid, lldb::tid_t tid,
m_mmap_meta->aux_size = bufsize;
errno = 0;
- auto mmap_aux = mmap(NULL, bufsize, PROT_READ, MAP_SHARED, fd,
+ auto mmap_aux = mmap(nullptr, bufsize, PROT_READ, MAP_SHARED, fd,
static_cast<long int>(m_mmap_meta->aux_offset));
if (mmap_aux == MAP_FAILED) {
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessMessage.cpp b/lldb/source/Plugins/Process/POSIX/ProcessMessage.cpp
index 3dde2f43943..aa8449131a6 100644
--- a/lldb/source/Plugins/Process/POSIX/ProcessMessage.cpp
+++ b/lldb/source/Plugins/Process/POSIX/ProcessMessage.cpp
@@ -20,7 +20,7 @@ const char *ProcessMessage::PrintKind(Kind kind) {
chcar str[8];
sprintf(str, "%d", reason);
#else
- const char *str = NULL;
+ const char *str = nullptr;
switch (kind) {
case eInvalidMessage:
diff --git a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
index f59d0374f63..1afe4d92059 100644
--- a/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
+++ b/lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
@@ -67,7 +67,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
for (uint32_t i = 0; i < num_sets; ++i) {
ConstString set_name;
if (sets->GetItemAtIndexAsString(i, set_name) && !set_name.IsEmpty()) {
- m_sets.push_back({ set_name.AsCString(), NULL, 0, NULL });
+ m_sets.push_back({set_name.AsCString(), nullptr, 0, nullptr});
} else {
Clear();
printf("error: register sets must have valid names\n");
@@ -302,7 +302,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
llvm::StringRef format_str;
if (reg_info_dict->GetValueForKeyAsString("format", format_str, nullptr)) {
if (OptionArgParser::ToFormat(format_str.str().c_str(), reg_info.format,
- NULL)
+ nullptr)
.Fail()) {
Clear();
printf("error: invalid 'format' value in register dictionary\n");
@@ -414,7 +414,7 @@ void DynamicRegisterInfo::AddRegister(RegisterInfo &reg_info,
const uint32_t reg_num = m_regs.size();
reg_info.name = reg_name.AsCString();
assert(reg_info.name);
- reg_info.alt_name = reg_alt_name.AsCString(NULL);
+ reg_info.alt_name = reg_alt_name.AsCString(nullptr);
uint32_t i;
if (reg_info.value_regs) {
for (i = 0; reg_info.value_regs[i] != LLDB_INVALID_REGNUM; ++i)
@@ -480,7 +480,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
if (m_value_regs_map.find(i) != m_value_regs_map.end())
m_regs[i].value_regs = m_value_regs_map[i].data();
else
- m_regs[i].value_regs = NULL;
+ m_regs[i].value_regs = nullptr;
}
// Expand all invalidation dependencies
@@ -529,7 +529,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
if (m_invalidate_regs_map.find(i) != m_invalidate_regs_map.end())
m_regs[i].invalidate_regs = m_invalidate_regs_map[i].data();
else
- m_regs[i].invalidate_regs = NULL;
+ m_regs[i].invalidate_regs = nullptr;
}
// Check if we need to automatically set the generic registers in case they
@@ -639,19 +639,19 @@ const RegisterInfo *
DynamicRegisterInfo::GetRegisterInfoAtIndex(uint32_t i) const {
if (i < m_regs.size())
return &m_regs[i];
- return NULL;
+ return nullptr;
}
RegisterInfo *DynamicRegisterInfo::GetRegisterInfoAtIndex(uint32_t i) {
if (i < m_regs.size())
return &m_regs[i];
- return NULL;
+ return nullptr;
}
const RegisterSet *DynamicRegisterInfo::GetRegisterSet(uint32_t i) const {
if (i < m_sets.size())
return &m_sets[i];
- return NULL;
+ return nullptr;
}
uint32_t DynamicRegisterInfo::GetRegisterSetIndexByName(ConstString &set_name,
@@ -664,7 +664,7 @@ uint32_t DynamicRegisterInfo::GetRegisterSetIndexByName(ConstString &set_name,
m_set_names.push_back(set_name);
m_set_reg_nums.resize(m_set_reg_nums.size() + 1);
- RegisterSet new_set = {set_name.AsCString(), NULL, 0, NULL};
+ RegisterSet new_set = {set_name.AsCString(), nullptr, 0, nullptr};
m_sets.push_back(new_set);
return m_sets.size() - 1;
}
@@ -754,5 +754,5 @@ const lldb_private::RegisterInfo *DynamicRegisterInfo::GetRegisterInfo(
return &reg_info;
}
}
- return NULL;
+ return nullptr;
}
diff --git a/lldb/source/Plugins/Process/Utility/HistoryThread.cpp b/lldb/source/Plugins/Process/Utility/HistoryThread.cpp
index 23f6077b32c..f0e39eed092 100644
--- a/lldb/source/Plugins/Process/Utility/HistoryThread.cpp
+++ b/lldb/source/Plugins/Process/Utility/HistoryThread.cpp
@@ -66,7 +66,7 @@ lldb::StackFrameListSP HistoryThread::GetStackFrameList() {
// FIXME do not throw away the lock after we acquire it..
std::unique_lock<std::mutex> lock(m_framelist_mutex);
lock.unlock();
- if (m_framelist.get() == NULL) {
+ if (m_framelist.get() == nullptr) {
m_framelist =
std::make_shared<StackFrameList>(*this, StackFrameListSP(), true);
}
diff --git a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
index 3bf5d9b52a7..9beaf2fc7ac 100644
--- a/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
+++ b/lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp
@@ -38,7 +38,7 @@ bool lldb_private::InferiorCallMmap(Process *process, addr_t &allocated_addr,
unsigned flags, addr_t fd, addr_t offset) {
Thread *thread =
process->GetThreadList().GetExpressionExecutionThread().get();
- if (thread == NULL)
+ if (thread == nullptr)
return false;
const bool append = true;
@@ -126,7 +126,7 @@ bool lldb_private::InferiorCallMunmap(Process *process, addr_t addr,
addr_t length) {
Thread *thread =
process->GetThreadList().GetExpressionExecutionThread().get();
- if (thread == NULL)
+ if (thread == nullptr)
return false;
const bool append = true;
@@ -188,7 +188,7 @@ bool lldb_private::InferiorCall(Process *process, const Address *address,
addr_t &returned_func, bool trap_exceptions) {
Thread *thread =
process->GetThreadList().GetExpressionExecutionThread().get();
- if (thread == NULL || address == NULL)
+ if (thread == nullptr || address == nullptr)
return false;
EvaluateExpressionOptions options;
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
index ea950cee75a..e804a4d251f 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -198,7 +198,7 @@ static RegisterInfo g_register_infos[] = {
// =============== =============== =========================
// ===================== =============
{"r0",
- NULL,
+ nullptr,
4,
GPR_OFFSET(0),
eEncodingUint,
@@ -209,7 +209,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r1",
- NULL,
+ nullptr,
4,
GPR_OFFSET(1),
eEncodingUint,
@@ -220,7 +220,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r2",
- NULL,
+ nullptr,
4,
GPR_OFFSET(2),
eEncodingUint,
@@ -231,7 +231,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r3",
- NULL,
+ nullptr,
4,
GPR_OFFSET(3),
eEncodingUint,
@@ -242,7 +242,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r4",
- NULL,
+ nullptr,
4,
GPR_OFFSET(4),
eEncodingUint,
@@ -253,7 +253,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r5",
- NULL,
+ nullptr,
4,
GPR_OFFSET(5),
eEncodingUint,
@@ -264,7 +264,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r6",
- NULL,
+ nullptr,
4,
GPR_OFFSET(6),
eEncodingUint,
@@ -275,7 +275,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r7",
- NULL,
+ nullptr,
4,
GPR_OFFSET(7),
eEncodingUint,
@@ -287,7 +287,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r8",
- NULL,
+ nullptr,
4,
GPR_OFFSET(8),
eEncodingUint,
@@ -298,7 +298,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r9",
- NULL,
+ nullptr,
4,
GPR_OFFSET(9),
eEncodingUint,
@@ -309,7 +309,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r10",
- NULL,
+ nullptr,
4,
GPR_OFFSET(10),
eEncodingUint,
@@ -321,7 +321,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r11",
- NULL,
+ nullptr,
4,
GPR_OFFSET(11),
eEncodingUint,
@@ -333,7 +333,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"r12",
- NULL,
+ nullptr,
4,
GPR_OFFSET(12),
eEncodingUint,
@@ -394,7 +394,7 @@ static RegisterInfo g_register_infos[] = {
0},
{"s0",
- NULL,
+ nullptr,
4,
FPU_OFFSET(0),
eEncodingIEEE754,
@@ -406,7 +406,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s1",
- NULL,
+ nullptr,
4,
FPU_OFFSET(1),
eEncodingIEEE754,
@@ -418,7 +418,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s2",
- NULL,
+ nullptr,
4,
FPU_OFFSET(2),
eEncodingIEEE754,
@@ -430,7 +430,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s3",
- NULL,
+ nullptr,
4,
FPU_OFFSET(3),
eEncodingIEEE754,
@@ -442,7 +442,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s4",
- NULL,
+ nullptr,
4,
FPU_OFFSET(4),
eEncodingIEEE754,
@@ -454,7 +454,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s5",
- NULL,
+ nullptr,
4,
FPU_OFFSET(5),
eEncodingIEEE754,
@@ -466,7 +466,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s6",
- NULL,
+ nullptr,
4,
FPU_OFFSET(6),
eEncodingIEEE754,
@@ -478,7 +478,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s7",
- NULL,
+ nullptr,
4,
FPU_OFFSET(7),
eEncodingIEEE754,
@@ -490,7 +490,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s8",
- NULL,
+ nullptr,
4,
FPU_OFFSET(8),
eEncodingIEEE754,
@@ -502,7 +502,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s9",
- NULL,
+ nullptr,
4,
FPU_OFFSET(9),
eEncodingIEEE754,
@@ -514,7 +514,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s10",
- NULL,
+ nullptr,
4,
FPU_OFFSET(10),
eEncodingIEEE754,
@@ -526,7 +526,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s11",
- NULL,
+ nullptr,
4,
FPU_OFFSET(11),
eEncodingIEEE754,
@@ -538,7 +538,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s12",
- NULL,
+ nullptr,
4,
FPU_OFFSET(12),
eEncodingIEEE754,
@@ -550,7 +550,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s13",
- NULL,
+ nullptr,
4,
FPU_OFFSET(13),
eEncodingIEEE754,
@@ -562,7 +562,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s14",
- NULL,
+ nullptr,
4,
FPU_OFFSET(14),
eEncodingIEEE754,
@@ -574,7 +574,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s15",
- NULL,
+ nullptr,
4,
FPU_OFFSET(15),
eEncodingIEEE754,
@@ -586,7 +586,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s16",
- NULL,
+ nullptr,
4,
FPU_OFFSET(16),
eEncodingIEEE754,
@@ -598,7 +598,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s17",
- NULL,
+ nullptr,
4,
FPU_OFFSET(17),
eEncodingIEEE754,
@@ -610,7 +610,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s18",
- NULL,
+ nullptr,
4,
FPU_OFFSET(18),
eEncodingIEEE754,
@@ -622,7 +622,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s19",
- NULL,
+ nullptr,
4,
FPU_OFFSET(19),
eEncodingIEEE754,
@@ -634,7 +634,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s20",
- NULL,
+ nullptr,
4,
FPU_OFFSET(20),
eEncodingIEEE754,
@@ -646,7 +646,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s21",
- NULL,
+ nullptr,
4,
FPU_OFFSET(21),
eEncodingIEEE754,
@@ -658,7 +658,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s22",
- NULL,
+ nullptr,
4,
FPU_OFFSET(22),
eEncodingIEEE754,
@@ -670,7 +670,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s23",
- NULL,
+ nullptr,
4,
FPU_OFFSET(23),
eEncodingIEEE754,
@@ -682,7 +682,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s24",
- NULL,
+ nullptr,
4,
FPU_OFFSET(24),
eEncodingIEEE754,
@@ -694,7 +694,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s25",
- NULL,
+ nullptr,
4,
FPU_OFFSET(25),
eEncodingIEEE754,
@@ -706,7 +706,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s26",
- NULL,
+ nullptr,
4,
FPU_OFFSET(26),
eEncodingIEEE754,
@@ -718,7 +718,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s27",
- NULL,
+ nullptr,
4,
FPU_OFFSET(27),
eEncodingIEEE754,
@@ -730,7 +730,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s28",
- NULL,
+ nullptr,
4,
FPU_OFFSET(28),
eEncodingIEEE754,
@@ -742,7 +742,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s29",
- NULL,
+ nullptr,
4,
FPU_OFFSET(29),
eEncodingIEEE754,
@@ -754,7 +754,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s30",
- NULL,
+ nullptr,
4,
FPU_OFFSET(30),
eEncodingIEEE754,
@@ -766,7 +766,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"s31",
- NULL,
+ nullptr,
4,
FPU_OFFSET(31),
eEncodingIEEE754,
@@ -778,7 +778,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"fpscr",
- NULL,
+ nullptr,
4,
FPU_OFFSET(32),
eEncodingUint,
@@ -791,7 +791,7 @@ static RegisterInfo g_register_infos[] = {
0},
{"exception",
- NULL,
+ nullptr,
4,
EXC_OFFSET(0),
eEncodingUint,
@@ -803,7 +803,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"fsr",
- NULL,
+ nullptr,
4,
EXC_OFFSET(1),
eEncodingUint,
@@ -815,7 +815,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
0},
{"far",
- NULL,
+ nullptr,
4,
EXC_OFFSET(2),
eEncodingUint,
@@ -944,7 +944,7 @@ RegisterContextDarwin_arm::GetRegisterInfoAtIndex(size_t reg) {
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_arm::GetRegisterInfosCount() {
@@ -979,7 +979,7 @@ size_t RegisterContextDarwin_arm::GetRegisterSetCount() {
const RegisterSet *RegisterContextDarwin_arm::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
// Register information definitions for 32 bit i386.
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
index c264831c0dd..e0d67d12d49 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
@@ -122,7 +122,7 @@ RegisterContextDarwin_arm64::GetRegisterInfoAtIndex(size_t reg) {
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos_arm64_le[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_arm64::GetRegisterInfosCount() {
@@ -157,7 +157,7 @@ size_t RegisterContextDarwin_arm64::GetRegisterSetCount() {
const RegisterSet *RegisterContextDarwin_arm64::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
// Register information definitions for arm64
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
index 130a2673fde..69b56242c86 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
@@ -176,42 +176,42 @@ static RegisterInfo g_register_infos[] = {
// =============================== =======================
// =================== ========================= ==================
// =================
- {DEFINE_GPR(eax, NULL),
+ {DEFINE_GPR(eax, nullptr),
{ehframe_eax, dwarf_eax, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_eax},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(ebx, NULL),
+ {DEFINE_GPR(ebx, nullptr),
{ehframe_ebx, dwarf_ebx, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_ebx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(ecx, NULL),
+ {DEFINE_GPR(ecx, nullptr),
{ehframe_ecx, dwarf_ecx, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_ecx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(edx, NULL),
+ {DEFINE_GPR(edx, nullptr),
{ehframe_edx, dwarf_edx, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_edx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(edi, NULL),
+ {DEFINE_GPR(edi, nullptr),
{ehframe_edi, dwarf_edi, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_edi},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(esi, NULL),
+ {DEFINE_GPR(esi, nullptr),
{ehframe_esi, dwarf_esi, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
gpr_esi},
nullptr,
@@ -232,7 +232,7 @@ static RegisterInfo g_register_infos[] = {
nullptr,
nullptr,
0},
- {DEFINE_GPR(ss, NULL),
+ {DEFINE_GPR(ss, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_ss},
nullptr,
@@ -253,35 +253,35 @@ static RegisterInfo g_register_infos[] = {
nullptr,
nullptr,
0},
- {DEFINE_GPR(cs, NULL),
+ {DEFINE_GPR(cs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_cs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(ds, NULL),
+ {DEFINE_GPR(ds, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_ds},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(es, NULL),
+ {DEFINE_GPR(es, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_es},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(fs, NULL),
+ {DEFINE_GPR(fs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_fs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(gs, NULL),
+ {DEFINE_GPR(gs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_gs},
nullptr,
@@ -427,7 +427,7 @@ RegisterContextDarwin_i386::GetRegisterInfoAtIndex(size_t reg) {
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_i386::GetRegisterInfosCount() {
@@ -479,7 +479,7 @@ size_t RegisterContextDarwin_i386::GetRegisterSetCount() {
const RegisterSet *RegisterContextDarwin_i386::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
// Register information definitions for 32 bit i386.
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
index 4a37454ba8c..e908c6dffaf 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
@@ -195,42 +195,42 @@ static RegisterInfo g_register_infos[] = {
// =============================== ======================
// =================== ========================== ====================
// ===================
- {DEFINE_GPR(rax, NULL),
+ {DEFINE_GPR(rax, nullptr),
{ehframe_dwarf_gpr_rax, ehframe_dwarf_gpr_rax, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rax},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rbx, NULL),
+ {DEFINE_GPR(rbx, nullptr),
{ehframe_dwarf_gpr_rbx, ehframe_dwarf_gpr_rbx, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rbx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rcx, NULL),
+ {DEFINE_GPR(rcx, nullptr),
{ehframe_dwarf_gpr_rcx, ehframe_dwarf_gpr_rcx, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rcx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rdx, NULL),
+ {DEFINE_GPR(rdx, nullptr),
{ehframe_dwarf_gpr_rdx, ehframe_dwarf_gpr_rdx, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rdx},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rdi, NULL),
+ {DEFINE_GPR(rdi, nullptr),
{ehframe_dwarf_gpr_rdi, ehframe_dwarf_gpr_rdi, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rdi},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(rsi, NULL),
+ {DEFINE_GPR(rsi, nullptr),
{ehframe_dwarf_gpr_rsi, ehframe_dwarf_gpr_rsi, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_rsi},
nullptr,
@@ -251,56 +251,56 @@ static RegisterInfo g_register_infos[] = {
nullptr,
nullptr,
0},
- {DEFINE_GPR(r8, NULL),
+ {DEFINE_GPR(r8, nullptr),
{ehframe_dwarf_gpr_r8, ehframe_dwarf_gpr_r8, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r8},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r9, NULL),
+ {DEFINE_GPR(r9, nullptr),
{ehframe_dwarf_gpr_r9, ehframe_dwarf_gpr_r9, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r9},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r10, NULL),
+ {DEFINE_GPR(r10, nullptr),
{ehframe_dwarf_gpr_r10, ehframe_dwarf_gpr_r10, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r10},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r11, NULL),
+ {DEFINE_GPR(r11, nullptr),
{ehframe_dwarf_gpr_r11, ehframe_dwarf_gpr_r11, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r11},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r12, NULL),
+ {DEFINE_GPR(r12, nullptr),
{ehframe_dwarf_gpr_r12, ehframe_dwarf_gpr_r12, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r12},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r13, NULL),
+ {DEFINE_GPR(r13, nullptr),
{ehframe_dwarf_gpr_r13, ehframe_dwarf_gpr_r13, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r13},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r14, NULL),
+ {DEFINE_GPR(r14, nullptr),
{ehframe_dwarf_gpr_r14, ehframe_dwarf_gpr_r14, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r14},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(r15, NULL),
+ {DEFINE_GPR(r15, nullptr),
{ehframe_dwarf_gpr_r15, ehframe_dwarf_gpr_r15, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_r15},
nullptr,
@@ -321,21 +321,21 @@ static RegisterInfo g_register_infos[] = {
nullptr,
nullptr,
0},
- {DEFINE_GPR(cs, NULL),
+ {DEFINE_GPR(cs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_cs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(fs, NULL),
+ {DEFINE_GPR(fs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_fs},
nullptr,
nullptr,
nullptr,
0},
- {DEFINE_GPR(gs, NULL),
+ {DEFINE_GPR(gs, nullptr),
{LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, gpr_gs},
nullptr,
@@ -489,7 +489,7 @@ RegisterContextDarwin_x86_64::GetRegisterInfoAtIndex(size_t reg) {
assert(k_num_register_infos == k_num_registers);
if (reg < k_num_registers)
return &g_register_infos[reg];
- return NULL;
+ return nullptr;
}
size_t RegisterContextDarwin_x86_64::GetRegisterInfosCount() {
@@ -541,7 +541,7 @@ const RegisterSet *
RegisterContextDarwin_x86_64::GetRegisterSet(size_t reg_set) {
if (reg_set < k_num_regsets)
return &g_reg_sets[reg_set];
- return NULL;
+ return nullptr;
}
int RegisterContextDarwin_x86_64::GetSetForNativeRegNum(int reg_num) {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.cpp
index 5ea13a54fd2..6832b609593 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextDummy.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextDummy.cpp
@@ -49,8 +49,8 @@ RegisterContextDummy::RegisterContextDummy(Thread &thread,
m_pc_reg_info.byte_size = address_byte_size;
m_pc_reg_info.encoding = eEncodingUint;
m_pc_reg_info.format = eFormatPointer;
- m_pc_reg_info.invalidate_regs = NULL;
- m_pc_reg_info.value_regs = NULL;
+ m_pc_reg_info.invalidate_regs = nullptr;
+ m_pc_reg_info.value_regs = nullptr;
m_pc_reg_info.kinds[eRegisterKindEHFrame] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindDWARF] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindGeneric] = LLDB_REGNUM_GENERIC_PC;
@@ -71,7 +71,7 @@ size_t RegisterContextDummy::GetRegisterCount() { return 1; }
const lldb_private::RegisterInfo *
RegisterContextDummy::GetRegisterInfoAtIndex(size_t reg) {
if (reg)
- return NULL;
+ return nullptr;
return &m_pc_reg_info;
}
@@ -80,7 +80,7 @@ size_t RegisterContextDummy::GetRegisterSetCount() { return 1; }
const lldb_private::RegisterSet *
RegisterContextDummy::GetRegisterSet(size_t reg_set) {
if (reg_set)
- return NULL;
+ return nullptr;
return &m_reg_set0;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp
index 1c3f33d287c..b90b3810826 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_i386.cpp
@@ -70,7 +70,7 @@ const RegisterInfo *RegisterContextFreeBSD_i386::GetRegisterInfo() const {
return g_register_infos_i386;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp
index a0c314653af..4f869eb3b17 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextFreeBSD_powerpc.cpp
@@ -188,7 +188,7 @@ size_t RegisterContextFreeBSD_powerpc::GetGPRSize() const {
const RegisterInfo *RegisterContextFreeBSD_powerpc::GetRegisterInfo() const {
// assert (m_target_arch.GetCore() == ArchSpec::eCore_powerpc);
llvm_unreachable("Abstract class!");
- return NULL;
+ return nullptr;
}
uint32_t RegisterContextFreeBSD_powerpc::GetRegisterCount() const { return 0; }
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.cpp
index 8c2268aeaac..c19a2bfae66 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextHistory.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextHistory.cpp
@@ -50,8 +50,8 @@ RegisterContextHistory::RegisterContextHistory(Thread &thread,
m_pc_reg_info.byte_size = address_byte_size;
m_pc_reg_info.encoding = eEncodingUint;
m_pc_reg_info.format = eFormatPointer;
- m_pc_reg_info.invalidate_regs = NULL;
- m_pc_reg_info.value_regs = NULL;
+ m_pc_reg_info.invalidate_regs = nullptr;
+ m_pc_reg_info.value_regs = nullptr;
m_pc_reg_info.kinds[eRegisterKindEHFrame] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindDWARF] = LLDB_INVALID_REGNUM;
m_pc_reg_info.kinds[eRegisterKindGeneric] = LLDB_REGNUM_GENERIC_PC;
@@ -72,7 +72,7 @@ size_t RegisterContextHistory::GetRegisterCount() { return 1; }
const lldb_private::RegisterInfo *
RegisterContextHistory::GetRegisterInfoAtIndex(size_t reg) {
if (reg)
- return NULL;
+ return nullptr;
return &m_pc_reg_info;
}
@@ -81,7 +81,7 @@ size_t RegisterContextHistory::GetRegisterSetCount() { return 1; }
const lldb_private::RegisterSet *
RegisterContextHistory::GetRegisterSet(size_t reg_set) {
if (reg_set)
- return NULL;
+ return nullptr;
return &m_reg_set0;
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index ecda5556e60..4ec8bba0981 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -113,7 +113,7 @@ void RegisterContextLLDB::InitializeZerothFrame() {
ExecutionContext exe_ctx(m_thread.shared_from_this());
RegisterContextSP reg_ctx_sp = m_thread.GetRegisterContext();
- if (reg_ctx_sp.get() == NULL) {
+ if (reg_ctx_sp.get() == nullptr) {
m_frame_type = eNotAValidFrame;
UnwindLogMsg("frame does not have a register context");
return;
@@ -664,7 +664,7 @@ UnwindPlanSP RegisterContextLLDB::GetFastUnwindPlanForFrame() {
ModuleSP pc_module_sp(m_current_pc.GetModule());
if (!m_current_pc.IsValid() || !pc_module_sp ||
- pc_module_sp->GetObjectFile() == NULL)
+ pc_module_sp->GetObjectFile() == nullptr)
return unwind_plan_sp;
if (IsFrameZero())
@@ -715,7 +715,7 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
UnwindPlanSP arch_default_unwind_plan_sp;
ExecutionContext exe_ctx(m_thread.shared_from_this());
Process *process = exe_ctx.GetProcessPtr();
- ABI *abi = process ? process->GetABI().get() : NULL;
+ ABI *abi = process ? process->GetABI().get() : nullptr;
if (abi) {
arch_default_unwind_plan_sp =
std::make_shared<UnwindPlan>(lldb::eRegisterKindGeneric);
@@ -743,7 +743,7 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
// This is for jumping to memory regions without any information available.
if ((!m_sym_ctx_valid ||
- (m_sym_ctx.function == NULL && m_sym_ctx.symbol == NULL)) &&
+ (m_sym_ctx.function == nullptr && m_sym_ctx.symbol == nullptr)) &&
behaves_like_zeroth_frame && m_current_pc.IsValid()) {
uint32_t permissions;
addr_t current_pc_addr =
@@ -765,7 +765,7 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
// No Module for the current pc, try using the architecture default unwind.
ModuleSP pc_module_sp(m_current_pc.GetModule());
if (!m_current_pc.IsValid() || !pc_module_sp ||
- pc_module_sp->GetObjectFile() == NULL) {
+ pc_module_sp->GetObjectFile() == nullptr) {
m_frame_type = eNormalFrame;
return arch_default_unwind_plan_sp;
}
@@ -1349,7 +1349,7 @@ RegisterContextLLDB::SavedLocationForRegister(
// register, we may be able to fall back to some ABI-defined default. For
// example, some ABIs allow to determine the caller's SP via the CFA. Also,
// the ABI may set volatile registers to the undefined state.
- ABI *abi = process ? process->GetABI().get() : NULL;
+ ABI *abi = process ? process->GetABI().get() : nullptr;
if (abi) {
const RegisterInfo *reg_info =
GetRegisterInfoAtIndex(regnum.GetAsKind(eRegisterKindLLDB));
@@ -1702,10 +1702,10 @@ bool RegisterContextLLDB::TryFallbackUnwindPlan() {
}
bool RegisterContextLLDB::ForceSwitchToFallbackUnwindPlan() {
- if (m_fallback_unwind_plan_sp.get() == NULL)
+ if (m_fallback_unwind_plan_sp.get() == nullptr)
return false;
- if (m_full_unwind_plan_sp.get() == NULL)
+ if (m_full_unwind_plan_sp.get() == nullptr)
return false;
if (m_full_unwind_plan_sp.get() == m_fallback_unwind_plan_sp.get() ||
@@ -2067,7 +2067,7 @@ void RegisterContextLLDB::UnwindLogMsg(const char *fmt, ...) {
va_start(args, fmt);
char *logmsg;
- if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == NULL) {
+ if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == nullptr) {
if (logmsg)
free(logmsg);
va_end(args);
@@ -2088,7 +2088,7 @@ void RegisterContextLLDB::UnwindLogMsgVerbose(const char *fmt, ...) {
va_start(args, fmt);
char *logmsg;
- if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == NULL) {
+ if (vasprintf(&logmsg, fmt, args) == -1 || logmsg == nullptr) {
if (logmsg)
free(logmsg);
va_end(args);
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
index 1210a7e3857..79979639dc7 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_i386.cpp
@@ -90,8 +90,8 @@ RegisterContextLinux_i386::RegisterContextLinux_i386(
const ArchSpec &target_arch)
: RegisterInfoInterface(target_arch) {
RegisterInfo orig_ax = {"orig_eax",
- NULL,
- sizeof(((GPR *)NULL)->orig_eax),
+ nullptr,
+ sizeof(((GPR *)nullptr)->orig_eax),
(LLVM_EXTENSION offsetof(GPR, orig_eax)),
eEncodingUint,
eFormatHex,
@@ -114,7 +114,7 @@ const RegisterInfo *RegisterContextLinux_i386::GetRegisterInfo() const {
return g_register_infos_i386;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp
index 4797afbc0ee..fc60fea7917 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_mips.cpp
@@ -116,7 +116,7 @@ const RegisterInfo *RegisterContextLinux_mips::GetRegisterInfo() const {
return g_register_infos_mips;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
index 6f78f84e93f..640d5bc0225 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextLinux_x86_64.cpp
@@ -157,8 +157,8 @@ RegisterContextLinux_x86_64::RegisterContextLinux_x86_64(
m_register_info_count(GetRegisterInfoCount(target_arch)),
m_user_register_count(GetUserRegisterInfoCount(target_arch)) {
RegisterInfo orig_ax = {"orig_rax",
- NULL,
- sizeof(((GPR *)NULL)->orig_rax),
+ nullptr,
+ sizeof(((GPR *)nullptr)->orig_rax),
(LLVM_EXTENSION offsetof(GPR, orig_rax)),
eEncodingUint,
eFormatHex,
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp
index c1f141cf2d6..06eac6f7f99 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextOpenBSD_i386.cpp
@@ -67,7 +67,7 @@ const RegisterInfo *RegisterContextOpenBSD_i386::GetRegisterInfo() const {
return g_register_infos_i386;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
index 7366130dd9b..821e2aa73b5 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
@@ -146,7 +146,7 @@ RegisterContextPOSIX_arm::GetRegisterInfoAtIndex(size_t reg) {
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_arm::GetRegisterSetCount() {
@@ -167,10 +167,10 @@ RegisterContextPOSIX_arm::GetRegisterSet(size_t set) {
return &g_reg_sets_arm[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_arm::GetRegisterName(unsigned reg) {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
index 5fb9f1f85a1..99b897d441b 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
@@ -166,7 +166,7 @@ RegisterContextPOSIX_arm64::GetRegisterInfoAtIndex(size_t reg) {
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_arm64::GetRegisterSetCount() {
@@ -187,10 +187,10 @@ RegisterContextPOSIX_arm64::GetRegisterSet(size_t set) {
return &g_reg_sets_arm64[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_arm64::GetRegisterName(unsigned reg) {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
index cedbcd42373..f1fa3035b2e 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
@@ -96,7 +96,7 @@ RegisterContextPOSIX_mips64::GetRegisterInfoAtIndex(size_t reg) {
if (reg < m_num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_mips64::GetRegisterSetCount() {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
index 9698b2d84d6..a78e9ed3794 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
@@ -133,7 +133,7 @@ RegisterContextPOSIX_powerpc::GetRegisterInfoAtIndex(size_t reg) {
if (reg < k_num_registers_powerpc)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_powerpc::GetRegisterSetCount() {
@@ -150,7 +150,7 @@ const RegisterSet *RegisterContextPOSIX_powerpc::GetRegisterSet(size_t set) {
if (IsRegisterSetAvailable(set))
return &g_reg_sets_powerpc[set];
else
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_powerpc::GetRegisterName(unsigned reg) {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
index 2b380797f19..02546c0ed16 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
@@ -151,7 +151,7 @@ RegisterContextPOSIX_ppc64le::GetRegisterInfoAtIndex(size_t reg) {
if (reg < k_num_registers_ppc64le)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_ppc64le::GetRegisterSetCount() {
@@ -168,7 +168,7 @@ const RegisterSet *RegisterContextPOSIX_ppc64le::GetRegisterSet(size_t set) {
if (IsRegisterSetAvailable(set))
return &g_reg_sets_ppc64le[set];
else
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_ppc64le::GetRegisterName(unsigned reg) {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
index 2301c822907..e040e507572 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
@@ -113,7 +113,7 @@ RegisterContextPOSIX_s390x::GetRegisterInfoAtIndex(size_t reg) {
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_s390x::GetRegisterCount() {
@@ -156,10 +156,10 @@ const RegisterSet *RegisterContextPOSIX_s390x::GetRegisterSet(size_t set) {
return &g_reg_sets_s390x[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
lldb::ByteOrder RegisterContextPOSIX_s390x::GetByteOrder() {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
index ee447642426..856ce9448db 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
@@ -423,7 +423,7 @@ RegisterContextPOSIX_x86::GetRegisterInfoAtIndex(size_t reg) {
if (reg < m_reg_info.num_registers)
return &GetRegisterInfo()[reg];
else
- return NULL;
+ return nullptr;
}
size_t RegisterContextPOSIX_x86::GetRegisterSetCount() {
@@ -445,10 +445,10 @@ const RegisterSet *RegisterContextPOSIX_x86::GetRegisterSet(size_t set) {
return &g_reg_sets_x86_64[set];
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
- return NULL;
+ return nullptr;
}
const char *RegisterContextPOSIX_x86::GetRegisterName(unsigned reg) {
diff --git a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp
index c21c02f2497..bcf60cc7a33 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterContextThreadMemory.cpp
@@ -73,7 +73,7 @@ RegisterContextThreadMemory::GetRegisterInfoAtIndex(size_t reg) {
UpdateRegisterContext();
if (m_reg_ctx_sp)
return m_reg_ctx_sp->GetRegisterInfoAtIndex(reg);
- return NULL;
+ return nullptr;
}
size_t RegisterContextThreadMemory::GetRegisterSetCount() {
@@ -87,7 +87,7 @@ const RegisterSet *RegisterContextThreadMemory::GetRegisterSet(size_t reg_set) {
UpdateRegisterContext();
if (m_reg_ctx_sp)
return m_reg_ctx_sp->GetRegisterSet(reg_set);
- return NULL;
+ return nullptr;
}
bool RegisterContextThreadMemory::ReadRegister(const RegisterInfo *reg_info,
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp
index 118c9ffe654..d392d3be1c4 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm.cpp
@@ -55,7 +55,7 @@ GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
return g_register_infos_arm;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
index 14d11190264..f7471526d05 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_arm64.cpp
@@ -60,7 +60,7 @@ GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
return g_register_infos_arm64_le;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
diff --git a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp
index 63d35c291e9..35051a3ce09 100644
--- a/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp
+++ b/lldb/source/Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.cpp
@@ -27,7 +27,7 @@ GetRegisterInfoPtr(const lldb_private::ArchSpec &target_arch) {
return g_register_infos_ppc64le;
default:
assert(false && "Unhandled target architecture.");
- return NULL;
+ return nullptr;
}
}
diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
index 64b88e66504..588015a51ef 100644
--- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
+++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp
@@ -37,11 +37,11 @@ const char *StopInfoMachException::GetDescription() {
target ? target->GetArchitecture().GetMachine()
: llvm::Triple::UnknownArch;
- const char *exc_desc = NULL;
+ const char *exc_desc = nullptr;
const char *code_label = "code";
- const char *code_desc = NULL;
+ const char *code_desc = nullptr;
const char *subcode_label = "subcode";
- const char *subcode_desc = NULL;
+ const char *subcode_desc = nullptr;
#if defined(__APPLE__)
char code_desc_buf[32];
@@ -593,7 +593,7 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
// the thread ID so we must always report the breakpoint regardless
// of the thread.
if (bp_site_sp->ValidForThisThread(&thread) ||
- thread.GetProcess()->GetOperatingSystem() != NULL)
+ thread.GetProcess()->GetOperatingSystem() != nullptr)
return StopInfo::CreateStopReasonWithBreakpointSiteID(
thread, bp_site_sp->GetID());
else if (is_trace_if_actual_breakpoint_missing)
diff --git a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp
index d11fda293f8..38209fb2494 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp
+++ b/lldb/source/Plugins/Process/Utility/UnwindLLDB.cpp
@@ -50,7 +50,7 @@ uint32_t UnwindLLDB::DoGetFrameCount() {
return 0;
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
while (AddOneMoreFrame(abi)) {
#if DEBUG_FRAME_SPEED
@@ -73,13 +73,13 @@ bool UnwindLLDB::AddFirstFrame() {
return true;
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
// First, set up the 0th (initial) frame
CursorSP first_cursor_sp(new Cursor());
RegisterContextLLDBSP reg_ctx_sp(new RegisterContextLLDB(
m_thread, RegisterContextLLDBSP(), first_cursor_sp->sctx, 0, *this));
- if (reg_ctx_sp.get() == NULL)
+ if (reg_ctx_sp.get() == nullptr)
goto unwind_done;
if (!reg_ctx_sp->IsValid())
@@ -147,7 +147,7 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
return nullptr;
}
- if (reg_ctx_sp.get() == NULL) {
+ if (reg_ctx_sp.get() == nullptr) {
// If the RegisterContextLLDB has a fallback UnwindPlan, it will switch to
// that and return true. Subsequent calls to TryFallbackUnwindPlan() will
// return false.
@@ -402,7 +402,7 @@ bool UnwindLLDB::DoGetFrameInfoAtIndex(uint32_t idx, addr_t &cfa, addr_t &pc) {
}
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
while (idx >= m_frames.size() && AddOneMoreFrame(abi))
;
@@ -430,7 +430,7 @@ UnwindLLDB::DoCreateRegisterContextForFrame(StackFrame *frame) {
}
ProcessSP process_sp(m_thread.GetProcess());
- ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
+ ABI *abi = process_sp ? process_sp->GetABI().get() : nullptr;
while (idx >= m_frames.size()) {
if (!AddOneMoreFrame(abi))
diff --git a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
index 4a35637cffb..7dc5a5f5fdd 100644
--- a/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
+++ b/lldb/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
@@ -79,7 +79,7 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_i386(
StackFrame *first_frame = exe_ctx.GetFramePtr();
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return 0;
struct Frame_i386 {
@@ -121,7 +121,7 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_i386(
SymbolContext first_frame_sc(
first_frame->GetSymbolContext(resolve_scope));
- const AddressRange *addr_range_ptr = NULL;
+ const AddressRange *addr_range_ptr = nullptr;
AddressRange range;
if (first_frame_sc.function)
addr_range_ptr = &first_frame_sc.function->GetAddressRange();
@@ -169,7 +169,7 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_x86_64(
m_cursors.clear();
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return 0;
StackFrame *first_frame = exe_ctx.GetFramePtr();
@@ -212,7 +212,7 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_x86_64(
SymbolContext first_frame_sc(
first_frame->GetSymbolContext(resolve_scope));
- const AddressRange *addr_range_ptr = NULL;
+ const AddressRange *addr_range_ptr = nullptr;
AddressRange range;
if (first_frame_sc.function)
addr_range_ptr = &first_frame_sc.function->GetAddressRange();
diff --git a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index 25074f85492..f40ff130cf5 100644
--- a/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/lldb/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -80,7 +80,7 @@ bool ProcessElfCore::CanDebug(lldb::TargetSP target_sp,
if (!m_core_module_sp && FileSystem::Instance().Exists(m_core_file)) {
ModuleSpec core_module_spec(m_core_file, target_sp->GetArchitecture());
Status error(ModuleList::GetSharedModule(core_module_spec, m_core_module_sp,
- NULL, NULL, NULL));
+ nullptr, nullptr, nullptr));
if (m_core_module_sp) {
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
if (core_objfile && core_objfile->GetType() == ObjectFile::eTypeCoreFile)
@@ -149,7 +149,7 @@ Status ProcessElfCore::DoLoadCore() {
}
ObjectFileELF *core = (ObjectFileELF *)(m_core_module_sp->GetObjectFile());
- if (core == NULL) {
+ if (core == nullptr) {
error.SetErrorString("invalid core object file");
return error;
}
@@ -247,7 +247,7 @@ Status ProcessElfCore::DoLoadCore() {
}
lldb_private::DynamicLoader *ProcessElfCore::GetDynamicLoader() {
- if (m_dyld_up.get() == NULL)
+ if (m_dyld_up.get() == nullptr)
m_dyld_up.reset(DynamicLoader::FindPlugin(
this, DynamicLoaderPOSIXDYLD::GetPluginNameStatic().GetCString()));
return m_dyld_up.get();
@@ -327,13 +327,13 @@ size_t ProcessElfCore::DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
Status &error) {
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
- if (core_objfile == NULL)
+ if (core_objfile == nullptr)
return 0;
// Get the address range
const VMRangeToFileOffset::Entry *address_range =
m_core_aranges.FindEntryThatContains(addr);
- if (address_range == NULL || address_range->GetRangeEnd() < addr) {
+ if (address_range == nullptr || address_range->GetRangeEnd() < addr) {
error.SetErrorStringWithFormat("core file does not contain 0x%" PRIx64,
addr);
return 0;
diff --git a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
index 13291d56a0c..ddcf35013b3 100644
--- a/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
+++ b/lldb/source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -149,7 +149,7 @@ public:
const char *GetName() override {
if (m_thread_name.empty())
- return NULL;
+ return nullptr;
return m_thread_name.c_str();
}
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
index 3bf0f5c2ce5..fe7ef6b3ace 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
@@ -285,7 +285,7 @@ bool GDBRemoteClientBase::ShouldStop(const UnixSignals &signals,
void GDBRemoteClientBase::OnRunPacketSent(bool first) {
if (first)
- BroadcastEvent(eBroadcastBitRunPacketSent, NULL);
+ BroadcastEvent(eBroadcastBitRunPacketSent, nullptr);
}
///////////////////////////////////////
@@ -365,7 +365,7 @@ void GDBRemoteClientBase::Lock::SyncWithContinueThread(bool interrupt) {
// packet. Let's interrupt it.
const char ctrl_c = '\x03';
ConnectionStatus status = eConnectionStatusSuccess;
- size_t bytes_written = m_comm.Write(&ctrl_c, 1, status, NULL);
+ size_t bytes_written = m_comm.Write(&ctrl_c, 1, status, nullptr);
if (bytes_written == 0) {
--m_comm.m_async_count;
if (log)
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 31af1cd26b7..9c3a02e77e5 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -98,7 +98,7 @@ size_t GDBRemoteCommunication::SendAck() {
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '+';
- const size_t bytes_written = Write(&ch, 1, status, NULL);
+ const size_t bytes_written = Write(&ch, 1, status, nullptr);
if (log)
log->Printf("<%4" PRIu64 "> send packet: %c", (uint64_t)bytes_written, ch);
m_history.AddPacket(ch, GDBRemoteCommunicationHistory::ePacketTypeSend,
@@ -110,7 +110,7 @@ size_t GDBRemoteCommunication::SendNack() {
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
ConnectionStatus status = eConnectionStatusSuccess;
char ch = '-';
- const size_t bytes_written = Write(&ch, 1, status, NULL);
+ const size_t bytes_written = Write(&ch, 1, status, nullptr);
if (log)
log->Printf("<%4" PRIu64 "> send packet: %c", (uint64_t)bytes_written, ch);
m_history.AddPacket(ch, GDBRemoteCommunicationHistory::ePacketTypeSend,
@@ -138,7 +138,7 @@ GDBRemoteCommunication::SendRawPacketNoLock(llvm::StringRef packet,
ConnectionStatus status = eConnectionStatusSuccess;
const char *packet_data = packet.data();
const size_t packet_length = packet.size();
- size_t bytes_written = Write(packet_data, packet_length, status, NULL);
+ size_t bytes_written = Write(packet_data, packet_length, status, nullptr);
if (log) {
size_t binary_start_offset = 0;
if (strncmp(packet_data, "$vFile:pwrite:", strlen("$vFile:pwrite:")) ==
@@ -274,7 +274,7 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet,
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PACKETS));
// Check for a packet from our cache first without trying any reading...
- if (CheckForPacket(NULL, 0, packet) != PacketType::Invalid)
+ if (CheckForPacket(nullptr, 0, packet) != PacketType::Invalid)
return PacketResult::Success;
bool timed_out = false;
@@ -470,7 +470,7 @@ bool GDBRemoteCommunication::DecompressPacket() {
content_length = hash_mark_idx - content_start;
std::string bufsize_str(m_bytes.data() + 2, i - 2 - 1);
errno = 0;
- decompressed_bufsize = ::strtoul(bufsize_str.c_str(), NULL, 10);
+ decompressed_bufsize = ::strtoul(bufsize_str.c_str(), nullptr, 10);
if (errno != 0 || decompressed_bufsize == ULONG_MAX) {
m_bytes.erase(0, size_of_first_packet);
return false;
@@ -483,7 +483,7 @@ bool GDBRemoteCommunication::DecompressPacket() {
packet_checksum_cstr[0] = m_bytes[checksum_idx];
packet_checksum_cstr[1] = m_bytes[checksum_idx + 1];
packet_checksum_cstr[2] = '\0';
- long packet_checksum = strtol(packet_checksum_cstr, NULL, 16);
+ long packet_checksum = strtol(packet_checksum_cstr, nullptr, 16);
long actual_checksum = CalculcateChecksum(
llvm::StringRef(m_bytes).substr(1, hash_mark_idx - 1));
@@ -848,7 +848,7 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
::isxdigit(m_bytes[checksum_idx + 1])) {
if (GetSendAcks()) {
const char *packet_checksum_cstr = &m_bytes[checksum_idx];
- char packet_checksum = strtol(packet_checksum_cstr, NULL, 16);
+ char packet_checksum = strtol(packet_checksum_cstr, nullptr, 16);
char actual_checksum = CalculcateChecksum(
llvm::StringRef(m_bytes).slice(content_start, content_end));
success = packet_checksum == actual_checksum;
@@ -923,9 +923,9 @@ GDBRemoteCommunication::ListenThread(lldb::thread_arg_t arg) {
// Do the listen on another thread so we can continue on...
if (connection->Connect(comm->m_listen_url.c_str(), &error) !=
eConnectionStatusSuccess)
- comm->SetConnection(NULL);
+ comm->SetConnection(nullptr);
}
- return NULL;
+ return nullptr;
}
Status GDBRemoteCommunication::StartDebugserverProcess(
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index c6b792e70fc..9797184026e 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -386,14 +386,14 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
std::vector<std::string> supported_compressions;
compressions += sizeof("SupportedCompressions=") - 1;
const char *end_of_compressions = strchr(compressions, ';');
- if (end_of_compressions == NULL) {
+ if (end_of_compressions == nullptr) {
end_of_compressions = strchr(compressions, '\0');
}
const char *current_compression = compressions;
while (current_compression < end_of_compressions) {
const char *next_compression_name = strchr(current_compression, ',');
const char *end_of_this_word = next_compression_name;
- if (next_compression_name == NULL ||
+ if (next_compression_name == nullptr ||
end_of_compressions < next_compression_name) {
end_of_this_word = end_of_compressions;
}
@@ -775,7 +775,7 @@ int GDBRemoteCommunicationClient::SendArgumentsPacket(
std::vector<const char *> argv;
FileSpec exe_file = launch_info.GetExecutableFile();
std::string exe_path;
- const char *arg = NULL;
+ const char *arg = nullptr;
const Args &launch_args = launch_info.GetArguments();
if (exe_file)
exe_path = exe_file.GetPath(false);
@@ -786,7 +786,7 @@ int GDBRemoteCommunicationClient::SendArgumentsPacket(
}
if (!exe_path.empty()) {
argv.push_back(exe_path.c_str());
- for (uint32_t i = 1; (arg = launch_args.GetArgumentAtIndex(i)) != NULL;
+ for (uint32_t i = 1; (arg = launch_args.GetArgumentAtIndex(i)) != nullptr;
++i) {
if (arg)
argv.push_back(arg);
@@ -1094,7 +1094,7 @@ const char *GDBRemoteCommunicationClient::GetGDBServerProgramName() {
if (!m_gdb_server_name.empty())
return m_gdb_server_name.c_str();
}
- return NULL;
+ return nullptr;
}
uint32_t GDBRemoteCommunicationClient::GetGDBServerProgramVersion() {
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index 56ee0a1463c..a77e659a55f 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -98,7 +98,7 @@ bool GDBRemoteRegisterContext::ReadRegister(const RegisterInfo *reg_info,
bool GDBRemoteRegisterContext::PrivateSetRegisterValue(
uint32_t reg, llvm::ArrayRef<uint8_t> data) {
const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
return false;
// Invalidate if needed
@@ -122,7 +122,7 @@ bool GDBRemoteRegisterContext::PrivateSetRegisterValue(
bool GDBRemoteRegisterContext::PrivateSetRegisterValue(uint32_t reg,
uint64_t new_reg_val) {
const RegisterInfo *reg_info = GetRegisterInfoAtIndex(reg);
- if (reg_info == NULL)
+ if (reg_info == nullptr)
return false;
// Early in process startup, we can get a thread that has an invalid byte
@@ -148,7 +148,7 @@ bool GDBRemoteRegisterContext::PrivateSetRegisterValue(uint32_t reg,
uint8_t *dst = const_cast<uint8_t *>(
m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size));
- if (dst == NULL)
+ if (dst == nullptr)
return false;
if (data.CopyByteOrderedData(0, // src offset
@@ -183,7 +183,7 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info,
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
@@ -228,7 +228,7 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info,
// We have a valid primordial register as our constituent. Grab the
// corresponding register info.
const RegisterInfo *prim_reg_info = GetRegisterInfoAtIndex(prim_reg);
- if (prim_reg_info == NULL)
+ if (prim_reg_info == nullptr)
success = false;
else {
// Read the containing register if it hasn't already been read
@@ -301,7 +301,7 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
@@ -319,7 +319,7 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
uint8_t *dst = const_cast<uint8_t *>(
m_reg_data.PeekData(reg_info->byte_offset, reg_info->byte_size));
- if (dst == NULL)
+ if (dst == nullptr)
return false;
if (data.CopyByteOrderedData(data_offset, // src offset
@@ -361,7 +361,7 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
// We have a valid primordial register as our constituent. Grab the
// corresponding register info.
const RegisterInfo *value_reg_info = GetRegisterInfoAtIndex(reg);
- if (value_reg_info == NULL)
+ if (value_reg_info == nullptr)
success = false;
else
success = SetPrimordialRegister(value_reg_info, gdb_comm);
@@ -409,7 +409,7 @@ bool GDBRemoteRegisterContext::ReadAllRegisterValues(
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
@@ -434,7 +434,7 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
@@ -452,7 +452,7 @@ bool GDBRemoteRegisterContext::ReadAllRegisterValues(
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
@@ -474,7 +474,8 @@ bool GDBRemoteRegisterContext::ReadAllRegisterValues(
// individually and store them as binary data in a buffer.
const RegisterInfo *reg_info;
- for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != NULL; i++) {
+ for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != nullptr;
+ i++) {
if (reg_info
->value_regs) // skip registers that are slices of real registers
continue;
@@ -508,14 +509,14 @@ bool GDBRemoteRegisterContext::ReadAllRegisterValues(
bool GDBRemoteRegisterContext::WriteAllRegisterValues(
const lldb::DataBufferSP &data_sp) {
- if (!data_sp || data_sp->GetBytes() == NULL || data_sp->GetByteSize() == 0)
+ if (!data_sp || data_sp->GetBytes() == nullptr || data_sp->GetByteSize() == 0)
return false;
ExecutionContext exe_ctx(CalculateThread());
Process *process = exe_ctx.GetProcessPtr();
Thread *thread = exe_ctx.GetThreadPtr();
- if (process == NULL || thread == NULL)
+ if (process == nullptr || thread == nullptr)
return false;
GDBRemoteCommunicationClient &gdb_comm(
@@ -557,9 +558,9 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
uint64_t size_by_highest_offset = 0;
for (uint32_t reg_idx = 0;
- (reg_info = GetRegisterInfoAtIndex(reg_idx)) != NULL; ++reg_idx) {
+ (reg_info = GetRegisterInfoAtIndex(reg_idx)) != nullptr; ++reg_idx) {
size_including_slice_registers += reg_info->byte_size;
- if (reg_info->value_regs == NULL)
+ if (reg_info->value_regs == nullptr)
size_not_including_slice_registers += reg_info->byte_size;
if (reg_info->byte_offset >= size_by_highest_offset)
size_by_highest_offset = reg_info->byte_offset + reg_info->byte_size;
@@ -591,7 +592,7 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
// keep track of the size of each reg & compute offset based on that.
uint32_t running_byte_offset = 0;
for (uint32_t reg_idx = 0;
- (reg_info = GetRegisterInfoAtIndex(reg_idx)) != NULL;
+ (reg_info = GetRegisterInfoAtIndex(reg_idx)) != nullptr;
++reg_idx, running_byte_offset += reg_info->byte_size) {
// Skip composite aka slice registers (e.g. eax is a slice of rax).
if (reg_info->value_regs)
@@ -637,7 +638,7 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
}
uint32_t num_restored = 0;
const RegisterInfo *reg_info;
- for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != NULL;
+ for (uint32_t i = 0; (reg_info = GetRegisterInfoAtIndex(i)) != nullptr;
i++) {
if (reg_info->value_regs) // skip registers that are slices of real
// registers
diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index db95d91449e..422b0928955 100644
--- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -114,12 +114,12 @@ static constexpr PropertyDefinition g_properties[] = {
{"packet-timeout", OptionValue::eTypeUInt64, true, 5
#if defined(__has_feature)
#if __has_feature(address_sanitizer)
- * 2
+ * 2
#endif
#endif
- , NULL, {},
+ , nullptr, {},
"Specify the default packet timeout in seconds."},
- {"target-definition-file", OptionValue::eTypeFileSpec, true, 0, NULL, {},
+ {"target-definition-file", OptionValue::eTypeFileSpec, true, 0, nullptr, {},
"The file that provides the description for remote target registers."}};
enum { ePropertyPacketTimeout, ePropertyTargetDefinitionFile };
@@ -140,17 +140,17 @@ public:
uint64_t GetPacketTimeout() {
const uint32_t idx = ePropertyPacketTimeout;
return m_collection_sp->GetPropertyAtIndexAsUInt64(
- NULL, idx, g_properties[idx].default_uint_value);
+ nullptr, idx, g_properties[idx].default_uint_value);
}
bool SetPacketTimeout(uint64_t timeout) {
const uint32_t idx = ePropertyPacketTimeout;
- return m_collection_sp->SetPropertyAtIndexAsUInt64(NULL, idx, timeout);
+ return m_collection_sp->SetPropertyAtIndexAsUInt64(nullptr, idx, timeout);
}
FileSpec GetTargetDefinitionFile() const {
const uint32_t idx = ePropertyTargetDefinitionFile;
- return m_collection_sp->GetPropertyAtIndexAsFileSpec(NULL, idx);
+ return m_collection_sp->GetPropertyAtIndexAsFileSpec(nullptr, idx);
}
};
@@ -252,7 +252,7 @@ ProcessGDBRemote::CreateInstance(lldb::TargetSP target_sp,
ListenerSP listener_sp,
const FileSpec *crash_file_path) {
lldb::ProcessSP process_sp;
- if (crash_file_path == NULL)
+ if (crash_file_path == nullptr)
process_sp = std::make_shared<ProcessGDBRemote>(target_sp, listener_sp);
return process_sp;
}
@@ -294,7 +294,7 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
: Process(target_sp, listener_sp),
m_debugserver_pid(LLDB_INVALID_PROCESS_ID), m_last_stop_packet_mutex(),
m_register_info(),
- m_async_broadcaster(NULL, "lldb.process.gdb-remote.async-broadcaster"),
+ m_async_broadcaster(nullptr, "lldb.process.gdb-remote.async-broadcaster"),
m_async_listener_sp(
Listener::MakeListener("lldb.process.gdb-remote.async-listener")),
m_async_thread_state_mutex(), m_thread_ids(), m_thread_pcs(),
@@ -547,8 +547,8 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
std::vector<uint32_t> invalidate_regs;
std::vector<uint8_t> dwarf_opcode_bytes;
RegisterInfo reg_info = {
- NULL, // Name
- NULL, // Alt name
+ nullptr, // Name
+ nullptr, // Alt name
0, // byte size
reg_offset, // offset
eEncodingUint, // encoding
@@ -560,10 +560,10 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
reg_num, // process plugin reg num
reg_num // native register number
},
- NULL,
- NULL,
- NULL, // Dwarf expression opcode bytes pointer
- 0 // Dwarf expression opcode bytes length
+ nullptr,
+ nullptr,
+ nullptr, // Dwarf expression opcode bytes pointer
+ 0 // Dwarf expression opcode bytes length
};
while (response.GetNameColonValue(name, value)) {
@@ -583,7 +583,7 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
reg_info.encoding = encoding;
} else if (name.equals("format")) {
Format format = eFormatInvalid;
- if (OptionArgParser::ToFormat(value.str().c_str(), format, NULL)
+ if (OptionArgParser::ToFormat(value.str().c_str(), format, nullptr)
.Success())
reg_info.format = format;
else {
@@ -888,8 +888,8 @@ Status ProcessGDBRemote::DoLaunch(lldb_private::Module *exe_module,
// since 'O' packets can really slow down debugging if the inferior
// does a lot of output.
if ((!stdin_file_spec || !stdout_file_spec || !stderr_file_spec) &&
- pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY, NULL, 0)) {
- FileSpec slave_name{pty.GetSlaveName(NULL, 0)};
+ pty.OpenFirstAvailableMaster(O_RDWR | O_NOCTTY, nullptr, 0)) {
+ FileSpec slave_name{pty.GetSlaveName(nullptr, 0)};
if (!stdin_file_spec)
stdin_file_spec = slave_name;
@@ -933,7 +933,7 @@ Status ProcessGDBRemote::DoLaunch(lldb_private::Module *exe_module,
GetTarget().GetArchitecture().GetArchitectureName());
const char *launch_event_data = launch_info.GetLaunchEventData();
- if (launch_event_data != NULL && *launch_event_data != '\0')
+ if (launch_event_data != nullptr && *launch_event_data != '\0')
m_gdb_comm.SendLaunchEventDataPacket(launch_event_data);
if (working_dir) {
@@ -1847,7 +1847,7 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
gdb_thread->PrivateSetRegisterValue(pair.first, buffer_sp->GetData());
}
- thread_sp->SetName(thread_name.empty() ? NULL : thread_name.c_str());
+ thread_sp->SetName(thread_name.empty() ? nullptr : thread_name.c_str());
gdb_thread->SetThreadDispatchQAddr(thread_dispatch_qaddr);
// Check if the GDB server was able to provide the queue name, kind and
@@ -3126,7 +3126,7 @@ size_t ProcessGDBRemote::PutSTDIN(const char *src, size_t src_len,
Status &error) {
if (m_stdio_communication.IsConnected()) {
ConnectionStatus status;
- m_stdio_communication.Write(src, src_len, status, NULL);
+ m_stdio_communication.Write(src, src_len, status, nullptr);
} else if (m_stdin_forward) {
m_gdb_comm.SendStdinNotification(src, src_len);
}
@@ -3135,7 +3135,7 @@ size_t ProcessGDBRemote::PutSTDIN(const char *src, size_t src_len,
Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
Status error;
- assert(bp_site != NULL);
+ assert(bp_site != nullptr);
// Get logging info
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS));
@@ -3261,7 +3261,7 @@ Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
Status ProcessGDBRemote::DisableBreakpointSite(BreakpointSite *bp_site) {
Status error;
- assert(bp_site != NULL);
+ assert(bp_site != nullptr);
addr_t addr = bp_site->GetLoadAddress();
user_id_t site_id = bp_site->GetID();
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS));
@@ -3672,9 +3672,9 @@ bool ProcessGDBRemote::StartAsyncThread() {
// Create a thread that watches our internal state and controls which
// events make it to clients (into the DCProcess event queue).
- m_async_thread =
- ThreadLauncher::LaunchThread("<lldb.process.gdb-remote.async>",
- ProcessGDBRemote::AsyncThread, this, NULL);
+ m_async_thread = ThreadLauncher::LaunchThread(
+ "<lldb.process.gdb-remote.async>", ProcessGDBRemote::AsyncThread, this,
+ nullptr);
} else if (log)
log->Printf("ProcessGDBRemote::%s () - Called when Async thread was "
"already running.",
@@ -3768,7 +3768,7 @@ thread_result_t ProcessGDBRemote::AsyncThread(void *arg) {
") got eBroadcastBitAsyncContinue: %s",
__FUNCTION__, arg, process->GetID(), continue_cstr);
- if (::strstr(continue_cstr, "vAttach") == NULL)
+ if (::strstr(continue_cstr, "vAttach") == nullptr)
process->SetPrivateState(eStateRunning);
StringExtractorGDBRemote response;
@@ -3834,11 +3834,11 @@ thread_result_t ProcessGDBRemote::AsyncThread(void *arg) {
// the "E87" error code from debugserver -- this indicates that
// the process is not debuggable. Return a slightly more
// helpful error message about why the attach failed.
- if (::strstr(continue_cstr, "vAttach") != NULL &&
+ if (::strstr(continue_cstr, "vAttach") != nullptr &&
response.GetError() == 0x87) {
process->SetExitStatus(-1, "cannot attach to process due to "
"System Integrity Protection");
- } else if (::strstr(continue_cstr, "vAttach") != NULL &&
+ } else if (::strstr(continue_cstr, "vAttach") != nullptr &&
response.GetStatus().Fail()) {
process->SetExitStatus(-1, response.GetStatus().AsCString());
} else {
@@ -3913,7 +3913,7 @@ thread_result_t ProcessGDBRemote::AsyncThread(void *arg) {
") thread exiting...",
__FUNCTION__, arg, process->GetID());
- return NULL;
+ return nullptr;
}
// uint32_t
@@ -4009,7 +4009,7 @@ bool ProcessGDBRemote::StartNoticingNewThreads() {
}
}
}
- return m_thread_create_bp_sp.get() != NULL;
+ return m_thread_create_bp_sp.get() != nullptr;
}
bool ProcessGDBRemote::StopNoticingNewThreads() {
@@ -4024,8 +4024,8 @@ bool ProcessGDBRemote::StopNoticingNewThreads() {
}
DynamicLoader *ProcessGDBRemote::GetDynamicLoader() {
- if (m_dyld_up.get() == NULL)
- m_dyld_up.reset(DynamicLoader::FindPlugin(this, NULL));
+ if (m_dyld_up.get() == nullptr)
+ m_dyld_up.reset(DynamicLoader::FindPlugin(this, nullptr));
return m_dyld_up.get();
}
@@ -4366,8 +4366,8 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
bool encoding_set = false;
bool format_set = false;
RegisterInfo reg_info = {
- NULL, // Name
- NULL, // Alt name
+ nullptr, // Name
+ nullptr, // Alt name
0, // byte size
reg_offset, // offset
eEncodingUint, // encoding
@@ -4379,10 +4379,10 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
cur_reg_num, // process plugin reg num
cur_reg_num // native register number
},
- NULL,
- NULL,
- NULL, // Dwarf Expression opcode bytes pointer
- 0 // Dwarf Expression opcode bytes length
+ nullptr,
+ nullptr,
+ nullptr, // Dwarf Expression opcode bytes pointer
+ 0 // Dwarf Expression opcode bytes length
};
reg_node.ForEachAttribute([&target_info, &gdb_group, &gdb_type,
@@ -4416,7 +4416,8 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
} else if (name == "format") {
format_set = true;
Format format = eFormatInvalid;
- if (OptionArgParser::ToFormat(value.data(), format, NULL).Success())
+ if (OptionArgParser::ToFormat(value.data(), format, nullptr)
+ .Success())
reg_info.format = format;
else if (value == "vector-sint8")
reg_info.format = eFormatVectorOfSInt8;
@@ -5133,7 +5134,7 @@ public:
"Tests packet speeds of various sizes to determine "
"the performance characteristics of the GDB remote "
"connection. ",
- NULL),
+ nullptr),
m_option_group(),
m_num_packets(LLDB_OPT_SET_1, false, "count", 'c', 0, eArgTypeCount,
"The number of packets to send of each varying size "
@@ -5207,7 +5208,7 @@ private:
public:
CommandObjectProcessGDBRemotePacketHistory(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "process plugin packet history",
- "Dumps the packet history buffer. ", NULL) {}
+ "Dumps the packet history buffer. ", nullptr) {}
~CommandObjectProcessGDBRemotePacketHistory() override {}
@@ -5238,7 +5239,7 @@ public:
: CommandObjectParsed(
interpreter, "process plugin packet xfer-size",
"Maximum size that lldb will try to read/write one one chunk.",
- NULL) {}
+ nullptr) {}
~CommandObjectProcessGDBRemotePacketXferSize() override {}
@@ -5258,7 +5259,7 @@ public:
if (process) {
const char *packet_size = command.GetArgumentAtIndex(0);
errno = 0;
- uint64_t user_specified_max = strtoul(packet_size, NULL, 10);
+ uint64_t user_specified_max = strtoul(packet_size, nullptr, 10);
if (errno == 0 && user_specified_max != 0) {
process->SetUserSpecifiedMaxMemoryTransferSize(user_specified_max);
result.SetStatus(eReturnStatusSuccessFinishResult);
@@ -5280,7 +5281,7 @@ public:
"The packet header and footer will automatically "
"be added to the packet prior to sending and "
"stripped from the result.",
- NULL) {}
+ nullptr) {}
~CommandObjectProcessGDBRemotePacketSend() override {}
@@ -5308,7 +5309,7 @@ public:
output_strm.Printf(" packet: %s\n", packet_cstr);
std::string &response_str = response.GetStringRef();
- if (strstr(packet_cstr, "qGetProfileData") != NULL) {
+ if (strstr(packet_cstr, "qGetProfileData") != nullptr) {
response_str = process->HarmonizeThreadIdsForProfileData(response);
}
@@ -5376,7 +5377,7 @@ public:
CommandObjectProcessGDBRemotePacket(CommandInterpreter &interpreter)
: CommandObjectMultiword(interpreter, "process plugin packet",
"Commands that deal with GDB remote packets.",
- NULL) {
+ nullptr) {
LoadSubCommand(
"history",
CommandObjectSP(
diff --git a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
index f27c80b5d1a..cdb7aa00624 100644
--- a/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ b/lldb/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -93,7 +93,7 @@ bool ProcessMachCore::CanDebug(lldb::TargetSP target_sp,
// ModuleSpecList::FindMatchingModuleSpec enforces a strict arch mach.
ModuleSpec core_module_spec(m_core_file);
Status error(ModuleList::GetSharedModule(core_module_spec, m_core_module_sp,
- NULL, NULL, NULL));
+ nullptr, nullptr, nullptr));
if (m_core_module_sp) {
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
@@ -196,7 +196,7 @@ Status ProcessMachCore::DoLoadCore() {
}
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
- if (core_objfile == NULL) {
+ if (core_objfile == nullptr) {
error.SetErrorString("invalid core object file");
return error;
}
@@ -209,7 +209,7 @@ Status ProcessMachCore::DoLoadCore() {
}
SectionList *section_list = core_objfile->GetSectionList();
- if (section_list == NULL) {
+ if (section_list == nullptr) {
error.SetErrorString("core file has no sections");
return error;
}
@@ -308,7 +308,7 @@ Status ProcessMachCore::DoLoadCore() {
size_t p = corefile_identifier.find("stext=") + strlen("stext=");
if (corefile_identifier[p] == '0' && corefile_identifier[p + 1] == 'x') {
errno = 0;
- addr = ::strtoul(corefile_identifier.c_str() + p, NULL, 16);
+ addr = ::strtoul(corefile_identifier.c_str() + p, nullptr, 16);
if (errno != 0 || addr == 0)
addr = LLDB_INVALID_ADDRESS;
}
@@ -447,10 +447,10 @@ Status ProcessMachCore::DoLoadCore() {
}
lldb_private::DynamicLoader *ProcessMachCore::GetDynamicLoader() {
- if (m_dyld_up.get() == NULL)
+ if (m_dyld_up.get() == nullptr)
m_dyld_up.reset(DynamicLoader::FindPlugin(
- this,
- m_dyld_plugin_name.IsEmpty() ? NULL : m_dyld_plugin_name.GetCString()));
+ this, m_dyld_plugin_name.IsEmpty() ? nullptr
+ : m_dyld_plugin_name.GetCString()));
return m_dyld_up.get();
}
diff --git a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
index d3d2a07afac..a7fc42cad16 100644
--- a/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
+++ b/lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
@@ -600,10 +600,9 @@ private:
return DumpFacebook() || m_fb_logcat.GetOptionValue().GetCurrentValue();
}
public:
-
CommandObjectProcessMinidumpDump(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "process plugin dump",
- "Dump information from the minidump file.", NULL),
+ "Dump information from the minidump file.", nullptr),
m_option_group(),
INIT_BOOL(m_dump_all, "all", 'a',
"Dump the everything in the minidump."),
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index a4959265fad..2d2b68ceaaa 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1943,7 +1943,7 @@ lldb::StateType ScriptInterpreterPythonImpl::ScriptedThreadPlanGetRunState(
Locker py_lock(this,
Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
should_step = LLDBSWIGPythonCallThreadPlan(
- generic->GetValue(), "should_step", NULL, script_error);
+ generic->GetValue(), "should_step", nullptr, script_error);
if (script_error)
should_step = true;
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 15b91f53a80..def7eb2e1eb 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -185,7 +185,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWO(const DWARFDIE &die, Log *log) {
SymbolFileDWARF *dwarf = die.GetDWARF();
TypeSP type_sp(new Type(
die.GetID(), dwarf, dwo_type_sp->GetName(), dwo_type_sp->GetByteSize(),
- NULL, LLDB_INVALID_UID, Type::eEncodingInvalid,
+ nullptr, LLDB_INVALID_UID, Type::eEncodingInvalid,
&dwo_type_sp->GetDeclaration(), type, Type::eResolveStateForward));
dwarf->GetTypeList()->Insert(type_sp);
@@ -461,7 +461,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
sc.comp_unit->GetLanguage() == eLanguageTypeObjC_plus_plus);
if (translation_unit_is_objc) {
- if (type_name_cstr != NULL) {
+ if (type_name_cstr != nullptr) {
static ConstString g_objc_type_name_id("id");
static ConstString g_objc_type_name_Class("Class");
static ConstString g_objc_type_name_selector("SEL");
@@ -1907,7 +1907,7 @@ public:
m_property_setter_name(property_setter_name),
m_property_getter_name(property_getter_name),
m_property_attributes(property_attributes) {
- if (metadata != NULL) {
+ if (metadata != nullptr) {
m_metadata_up.reset(new ClangASTMetadata());
*m_metadata_up = *metadata;
}
@@ -2442,7 +2442,7 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
DWARFAttributes attributes;
const size_t num_child_attributes = die.GetAttributes(attributes);
if (num_child_attributes > 0) {
- const char *name = NULL;
+ const char *name = nullptr;
bool got_value = false;
int64_t enum_value = 0;
Declaration decl;
@@ -2545,8 +2545,8 @@ protected:
Function *DWARFASTParserClang::ParseFunctionFromDWARF(CompileUnit &comp_unit,
const DWARFDIE &die) {
DWARFRangeList func_ranges;
- const char *name = NULL;
- const char *mangled = NULL;
+ const char *name = nullptr;
+ const char *mangled = nullptr;
int decl_file = 0;
int decl_line = 0;
int decl_column = 0;
@@ -2558,7 +2558,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(CompileUnit &comp_unit,
const dw_tag_t tag = die.Tag();
if (tag != DW_TAG_subprogram)
- return NULL;
+ return nullptr;
if (die.GetDIENamesAndRanges(name, mangled, func_ranges, decl_file, decl_line,
decl_column, call_file, call_line, call_column,
@@ -2633,7 +2633,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(CompileUnit &comp_unit,
// Supply the type _only_ if it has already been parsed
Type *func_type = dwarf->GetDIEToType().lookup(die.GetDIE());
- assert(func_type == NULL || func_type != DIE_IS_BEING_PARSED);
+ assert(func_type == nullptr || func_type != DIE_IS_BEING_PARSED);
if (dwarf->FixupAddress(func_range.GetBaseAddress())) {
const user_id_t func_user_id = die.GetID();
@@ -2643,7 +2643,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(CompileUnit &comp_unit,
func_user_id, func_name, func_type,
func_range); // first address range
- if (func_sp.get() != NULL) {
+ if (func_sp.get() != nullptr) {
if (frame_base.IsValid())
func_sp->GetFrameBaseExpression() = frame_base;
comp_unit.AddFunction(func_sp);
@@ -2652,7 +2652,7 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(CompileUnit &comp_unit,
}
}
}
- return NULL;
+ return nullptr;
}
bool DWARFASTParserClang::ParseChildMembers(
@@ -2693,10 +2693,10 @@ bool DWARFASTParserClang::ParseChildMembers(
if (num_attributes > 0) {
Declaration decl;
// DWARFExpression location;
- const char *name = NULL;
- const char *prop_name = NULL;
- const char *prop_getter_name = NULL;
- const char *prop_setter_name = NULL;
+ const char *name = nullptr;
+ const char *prop_name = nullptr;
+ const char *prop_getter_name = nullptr;
+ const char *prop_setter_name = nullptr;
uint32_t prop_attributes = 0;
bool is_artificial = false;
@@ -2758,7 +2758,8 @@ bool DWARFASTParserClang::ParseChildMembers(
module_sp, debug_info_data, die.GetCU(), block_offset,
block_length, eRegisterKindDWARF, &initialValue,
nullptr, memberOffset, nullptr)) {
- member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
+ member_byte_offset =
+ memberOffset.ResolveValue(nullptr).UInt();
}
} else {
// With DWARF 3 and later, if the value is an integer constant,
@@ -2874,7 +2875,7 @@ bool DWARFASTParserClang::ParseChildMembers(
if (!is_artificial) {
Type *member_type = die.ResolveTypeUID(DIERef(encoding_form));
- clang::FieldDecl *field_decl = NULL;
+ clang::FieldDecl *field_decl = nullptr;
if (tag == DW_TAG_member) {
if (member_type) {
if (accessibility == eAccessNone)
@@ -3133,12 +3134,12 @@ bool DWARFASTParserClang::ParseChildMembers(
}
}
- if (prop_name != NULL && member_type) {
- clang::ObjCIvarDecl *ivar_decl = NULL;
+ if (prop_name != nullptr && member_type) {
+ clang::ObjCIvarDecl *ivar_decl = nullptr;
if (field_decl) {
ivar_decl = clang::dyn_cast<clang::ObjCIvarDecl>(field_decl);
- assert(ivar_decl != NULL);
+ assert(ivar_decl != nullptr);
}
ClangASTMetadata metadata;
@@ -3209,7 +3210,8 @@ bool DWARFASTParserClang::ParseChildMembers(
block_offset, block_length,
eRegisterKindDWARF, &initialValue,
nullptr, memberOffset, nullptr)) {
- member_byte_offset = memberOffset.ResolveValue(NULL).UInt();
+ member_byte_offset =
+ memberOffset.ResolveValue(nullptr).UInt();
}
} else {
// With DWARF 3 and later, if the value is an integer constant,
@@ -3237,7 +3239,7 @@ bool DWARFASTParserClang::ParseChildMembers(
}
Type *base_class_type = die.ResolveTypeUID(DIERef(encoding_form));
- if (base_class_type == NULL) {
+ if (base_class_type == nullptr) {
module_sp->ReportError("0x%8.8x: DW_TAG_inheritance failed to "
"resolve the base class at 0x%8.8x"
" from enclosing type 0x%8.8x. \nPlease file "
@@ -3314,7 +3316,7 @@ size_t DWARFASTParserClang::ParseChildParameters(
DWARFAttributes attributes;
const size_t num_attributes = die.GetAttributes(attributes);
if (num_attributes > 0) {
- const char *name = NULL;
+ const char *name = nullptr;
Declaration decl;
DWARFFormValue param_type_die_form;
bool is_artificial = false;
@@ -3371,7 +3373,7 @@ size_t DWARFASTParserClang::ParseChildParameters(
// Often times compilers omit the "this" name for the
// specification DIEs, so we can't rely upon the name being in
// the formal parameter DIE...
- (name == NULL || ::strcmp(name, "this") == 0)) {
+ (name == nullptr || ::strcmp(name, "this") == 0)) {
Type *this_type = die.ResolveTypeUID(DIERef(param_type_die_form));
if (this_type) {
uint32_t encoding_mask = this_type->GetEncodingMask();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
index 25d64d4f62f..e9aa8f360bc 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
@@ -66,7 +66,7 @@ DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration(
if (idx < m_decls.size())
return &m_decls[idx];
}
- return NULL;
+ return nullptr;
}
@@ -137,7 +137,7 @@ DWARFDebugAbbrev::GetAbbreviationDeclarationSet(
if (pos != m_abbrevCollMap.end())
return &(pos->second);
- return NULL;
+ return nullptr;
}
// DWARFDebugAbbrev::GetUnsupportedForms()
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index 4d22c825390..e2de7d536f1 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -68,7 +68,7 @@ DWARFDebugAranges::extract(const DWARFDataExtractor &debug_aranges_data) {
}
void DWARFDebugAranges::Dump(Log *log) const {
- if (log == NULL)
+ if (log == nullptr)
return;
const size_t num_entries = m_aranges.GetSize();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index f17caf1bca5..c81b6ce05f0 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -30,7 +30,7 @@ using namespace std;
// Constructor
DWARFDebugInfo::DWARFDebugInfo(lldb_private::DWARFContext &context)
- : m_dwarf2Data(NULL), m_context(context), m_units(), m_cu_aranges_up() {}
+ : m_dwarf2Data(nullptr), m_context(context), m_units(), m_cu_aranges_up() {}
// SetDwarfData
void DWARFDebugInfo::SetDwarfData(SymbolFileDWARF *dwarf2Data) {
@@ -114,7 +114,7 @@ size_t DWARFDebugInfo::GetNumUnits() {
}
DWARFUnit *DWARFDebugInfo::GetUnitAtIndex(user_id_t idx) {
- DWARFUnit *cu = NULL;
+ DWARFUnit *cu = nullptr;
if (idx < GetNumUnits())
cu = m_units[idx].get();
return cu;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
index 25aecf3accf..215862c1aa7 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
@@ -41,8 +41,8 @@ public:
size_t GetNumUnits();
DWARFUnit *GetUnitAtIndex(lldb::user_id_t idx);
- DWARFUnit *GetUnitAtOffset(DIERef::Section section,
- dw_offset_t cu_offset, uint32_t *idx_ptr = NULL);
+ DWARFUnit *GetUnitAtOffset(DIERef::Section section, dw_offset_t cu_offset,
+ uint32_t *idx_ptr = nullptr);
DWARFUnit *GetUnitContainingDIEOffset(DIERef::Section section,
dw_offset_t die_offset);
DWARFUnit *GetUnit(const DIERef &die_ref);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index 7dd3eef2f46..aba80705ba9 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -51,7 +51,7 @@ bool DWARFDebugInfoEntry::FastExtract(
const DWARFAbbreviationDeclaration *abbrevDecl =
cu->GetAbbreviations()->GetAbbreviationDeclaration(m_abbr_idx);
- if (abbrevDecl == NULL) {
+ if (abbrevDecl == nullptr) {
cu->GetSymbolFileDWARF()->GetObjectFile()->GetModule()->ReportError(
"{0x%8.8x}: invalid abbreviation code %u, please file a bug and "
"attach the file at the start of this error message",
@@ -451,13 +451,13 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
} break;
case DW_AT_name:
- if (name == NULL)
+ if (name == nullptr)
name = form_value.AsCString();
break;
case DW_AT_MIPS_linkage_name:
case DW_AT_linkage_name:
- if (mangled == NULL)
+ if (mangled == nullptr)
mangled = form_value.AsCString();
break;
@@ -551,7 +551,7 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
frame_base->SetLocationListSlide(lowest_range_pc - cu->GetBaseAddress());
}
- if (ranges.IsEmpty() || name == NULL || mangled == NULL) {
+ if (ranges.IsEmpty() || name == nullptr || mangled == nullptr) {
for (const DIERef &die_ref : die_refs) {
if (die_ref.die_offset != DW_INVALID_OFFSET) {
DWARFDIE die = dwarf2Data->GetDIE(die_ref);
@@ -1223,7 +1223,7 @@ DWARFDebugInfoEntry::GetQualifiedName(DWARFUnit *cu,
storage.append(name);
}
if (storage.empty())
- return NULL;
+ return nullptr;
return storage.c_str();
}
@@ -1385,13 +1385,14 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
switch (m_tag) {
case DW_TAG_compile_unit: // File
case DW_TAG_partial_unit: // File
- check_children = ((function_die != NULL) || (block_die != NULL));
+ check_children =
+ ((function_die != nullptr) || (block_die != nullptr));
break;
case DW_TAG_subprogram: // Function
if (function_die)
*function_die = this;
- check_children = (block_die != NULL);
+ check_children = (block_die != nullptr);
break;
case DW_TAG_inlined_subroutine: // Inlined Function
@@ -1411,9 +1412,9 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
// Compile units may not have a valid high/low pc when there
// are address gaps in subroutines so we must always search
// if there is no valid high and low PC.
- check_children = (m_tag == DW_TAG_compile_unit ||
- m_tag == DW_TAG_partial_unit) &&
- ((function_die != NULL) || (block_die != NULL));
+ check_children =
+ (m_tag == DW_TAG_compile_unit || m_tag == DW_TAG_partial_unit) &&
+ ((function_die != nullptr) || (block_die != nullptr));
}
} else {
DWARFFormValue form_value;
@@ -1430,13 +1431,14 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
switch (m_tag) {
case DW_TAG_compile_unit: // File
case DW_TAG_partial_unit: // File
- check_children = ((function_die != NULL) || (block_die != NULL));
+ check_children =
+ ((function_die != nullptr) || (block_die != nullptr));
break;
case DW_TAG_subprogram: // Function
if (function_die)
*function_die = this;
- check_children = (block_die != NULL);
+ check_children = (block_die != nullptr);
break;
case DW_TAG_inlined_subroutine: // Inlined Function
@@ -1500,7 +1502,7 @@ DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(
}
}
offset = DW_INVALID_OFFSET;
- return NULL;
+ return nullptr;
}
bool DWARFDebugInfoEntry::OffsetLessThan(const DWARFDebugInfoEntry &a,
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
index 6c1057a0cf0..caf2915cc74 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
@@ -143,12 +143,11 @@ public:
lldb::offset_t *offset_ptr, lldb_private::Stream &s,
dw_attr_t attr, DWARFFormValue &form_value);
- bool
- GetDIENamesAndRanges(const DWARFUnit *cu, const char *&name,
- const char *&mangled, DWARFRangeList &rangeList,
- int &decl_file, int &decl_line, int &decl_column,
- int &call_file, int &call_line, int &call_column,
- lldb_private::DWARFExpression *frame_base = NULL) const;
+ bool GetDIENamesAndRanges(
+ const DWARFUnit *cu, const char *&name, const char *&mangled,
+ DWARFRangeList &rangeList, int &decl_file, int &decl_line,
+ int &decl_column, int &call_file, int &call_line, int &call_column,
+ lldb_private::DWARFExpression *frame_base = nullptr) const;
const DWARFAbbreviationDeclaration *
GetAbbreviationDeclarationPtr(const DWARFUnit *cu,
@@ -167,27 +166,27 @@ public:
// We know we are kept in a vector of contiguous entries, so we know
// our parent will be some index behind "this".
DWARFDebugInfoEntry *GetParent() {
- return m_parent_idx > 0 ? this - m_parent_idx : NULL;
+ return m_parent_idx > 0 ? this - m_parent_idx : nullptr;
}
const DWARFDebugInfoEntry *GetParent() const {
- return m_parent_idx > 0 ? this - m_parent_idx : NULL;
+ return m_parent_idx > 0 ? this - m_parent_idx : nullptr;
}
// We know we are kept in a vector of contiguous entries, so we know
// our sibling will be some index after "this".
DWARFDebugInfoEntry *GetSibling() {
- return m_sibling_idx > 0 ? this + m_sibling_idx : NULL;
+ return m_sibling_idx > 0 ? this + m_sibling_idx : nullptr;
}
const DWARFDebugInfoEntry *GetSibling() const {
- return m_sibling_idx > 0 ? this + m_sibling_idx : NULL;
+ return m_sibling_idx > 0 ? this + m_sibling_idx : nullptr;
}
// We know we are kept in a vector of contiguous entries, so we know
// we don't need to store our child pointer, if we have a child it will
// be the next entry in the list...
DWARFDebugInfoEntry *GetFirstChild() {
- return HasChildren() ? this + 1 : NULL;
+ return HasChildren() ? this + 1 : nullptr;
}
const DWARFDebugInfoEntry *GetFirstChild() const {
- return HasChildren() ? this + 1 : NULL;
+ return HasChildren() ? this + 1 : nullptr;
}
std::vector<DWARFDIE> GetDeclContextDIEs(DWARFUnit *cu) const;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
index 0a7a44ac282..953089fee22 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
@@ -38,7 +38,7 @@ void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data) {
while (debug_line_data.ValidOffset(offset)) {
const lldb::offset_t debug_line_offset = offset;
- if (line_table_sp.get() == NULL)
+ if (line_table_sp.get() == nullptr)
break;
if (ParseStatementTable(debug_line_data, &offset, line_table_sp.get(), nullptr)) {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
index 5e2646a0ced..cb7f26264a4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
@@ -105,7 +105,7 @@ void DWARFDebugRanges::Dump(Stream &s,
dw_addr_t begin_addr = begin + base_addr;
dw_addr_t end_addr = end + base_addr;
- s.AddressRange(begin_addr, end_addr, sizeof(dw_addr_t), NULL);
+ s.AddressRange(begin_addr, end_addr, sizeof(dw_addr_t), nullptr);
}
}
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
index 455cb01e71a..a664314035e 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
@@ -29,7 +29,7 @@ const char *DWARFDeclContext::GetQualifiedName() const {
for (pos = begin; pos != end; ++pos) {
if (pos != begin)
m_qualified_name.append("::");
- if (pos->name == NULL) {
+ if (pos->name == nullptr) {
if (pos->tag == DW_TAG_namespace)
m_qualified_name.append("(anonymous namespace)");
else if (pos->tag == DW_TAG_class_type)
@@ -47,7 +47,7 @@ const char *DWARFDeclContext::GetQualifiedName() const {
}
}
if (m_qualified_name.empty())
- return NULL;
+ return nullptr;
return m_qualified_name.c_str();
}
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
index 9f5e28eb747..d0d70dd5123 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.h
@@ -23,7 +23,7 @@
class DWARFDeclContext {
public:
struct Entry {
- Entry() : tag(0), name(NULL) {}
+ Entry() : tag(0), name(nullptr) {}
Entry(dw_tag_t t, const char *n) : tag(t), name(n) {}
bool NameMatches(const Entry &rhs) const {
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index 5e2caed4d46..9b5faa6ed9b 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -120,7 +120,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
bool indirect = false;
bool is_block = false;
- m_value.data = NULL;
+ m_value.data = nullptr;
uint8_t ref_addr_size;
// Read the value for the form into value and follow and DW_FORM_indirect
// instances we run into
@@ -223,7 +223,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
if (is_block) {
m_value.data = data.PeekData(*offset_ptr, m_value.value.uval);
- if (m_value.data != NULL) {
+ if (m_value.data != nullptr) {
*offset_ptr += m_value.value.uval;
}
}
@@ -687,7 +687,7 @@ int DWARFFormValue::Compare(const DWARFFormValue &a_value,
return 0;
else if (a_string && b_string)
return strcmp(a_string, b_string);
- else if (a_string == NULL)
+ else if (a_string == nullptr)
return -1; // A string is NULL, and B is valid
else
return 1; // A string valid, and B is NULL
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
index 668bd5a568a..2143921587f 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -19,7 +19,7 @@ class DWARFDIE;
class DWARFFormValue {
public:
typedef struct ValueTypeTag {
- ValueTypeTag() : value(), data(NULL) { value.uval = 0; }
+ ValueTypeTag() : value(), data(nullptr) { value.uval = 0; }
union {
uint64_t uval;
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
index 59202061436..65a1fbf74f8 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -502,7 +502,7 @@ void DWARFUnit::ParseProducerInfo() {
if (die) {
const char *producer_cstr =
- die->GetAttributeValueAsString(this, DW_AT_producer, NULL);
+ die->GetAttributeValueAsString(this, DW_AT_producer, nullptr);
if (producer_cstr) {
RegularExpression llvm_gcc_regex(
llvm::StringRef("^4\\.[012]\\.[01] \\(Based on Apple "
@@ -653,7 +653,7 @@ void DWARFUnit::ComputeCompDirAndGuessPathStyle() {
return;
llvm::StringRef comp_dir = removeHostnameFromPathname(
- die->GetAttributeValueAsString(this, DW_AT_comp_dir, NULL));
+ die->GetAttributeValueAsString(this, DW_AT_comp_dir, nullptr));
if (!comp_dir.empty()) {
FileSpec::Style comp_dir_style =
FileSpec::GuessPathStyle(comp_dir).getValueOr(FileSpec::Style::native);
@@ -661,7 +661,8 @@ void DWARFUnit::ComputeCompDirAndGuessPathStyle() {
} else {
// Try to detect the style based on the DW_AT_name attribute, but just store
// the detected style in the m_comp_dir field.
- const char *name = die->GetAttributeValueAsString(this, DW_AT_name, NULL);
+ const char *name =
+ die->GetAttributeValueAsString(this, DW_AT_name, nullptr);
m_comp_dir = FileSpec(
"", FileSpec::GuessPathStyle(name).getValueOr(FileSpec::Style::native));
}
@@ -674,7 +675,7 @@ SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile() const {
dw_offset_t DWARFUnit::GetBaseObjOffset() const { return m_base_obj_offset; }
const DWARFDebugAranges &DWARFUnit::GetFunctionAranges() {
- if (m_func_aranges_up == NULL) {
+ if (m_func_aranges_up == nullptr) {
m_func_aranges_up.reset(new DWARFDebugAranges());
const DWARFDebugInfoEntry *die = DIEPtr();
if (die)
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
index 333e203c928..2cd7c92f1ca 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
@@ -264,7 +264,7 @@ bool DWARFMappedHash::Header::Read(const lldb_private::DWARFDataExtractor &data,
return false;
for (size_t i = 0; i < num_atoms; ++i) {
- DWARFFormValue form_value(NULL, header_data.atoms[i].form);
+ DWARFFormValue form_value(nullptr, header_data.atoms[i].form);
if (!form_value.ExtractValue(data, offset_ptr))
return false;
@@ -341,7 +341,7 @@ DWARFMappedHash::MemoryTable::GetHashDataForName(
// There definitely should be a string for this string offset, if there
// isn't, there is something wrong, return and error
const char *strp_cstr = m_string_table.PeekCStr(pair.key);
- if (strp_cstr == NULL) {
+ if (strp_cstr == nullptr) {
*hash_data_offset_ptr = UINT32_MAX;
return eResultError;
}
@@ -408,7 +408,7 @@ DWARFMappedHash::MemoryTable::AppendHashDataForRegularExpression(
// There definitely should be a string for this string offset, if there
// isn't, there is something wrong, return and error
const char *strp_cstr = m_string_table.PeekCStr(pair.key);
- if (strp_cstr == NULL)
+ if (strp_cstr == nullptr)
return eResultError;
const uint32_t count = m_data.GetU32(hash_data_offset_ptr);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
index cefe81bb176..a6fae61a6a4 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -141,8 +141,8 @@ void ManualDWARFIndex::IndexUnitImpl(
}
DWARFAttributes attributes;
- const char *name = NULL;
- const char *mangled_cstr = NULL;
+ const char *name = nullptr;
+ const char *mangled_cstr = nullptr;
bool is_declaration = false;
// bool is_artificial = false;
bool has_address = false;
@@ -194,7 +194,7 @@ void ManualDWARFIndex::IndexUnitImpl(
has_location_or_const_value = true;
if (tag == DW_TAG_variable) {
const DWARFDebugInfoEntry *parent_die = die.GetParent();
- while (parent_die != NULL) {
+ while (parent_die != nullptr) {
switch (parent_die->Tag()) {
case DW_TAG_subprogram:
case DW_TAG_lexical_block:
@@ -219,13 +219,13 @@ void ManualDWARFIndex::IndexUnitImpl(
// }
// }
// }
- parent_die = NULL; // Terminate the while loop.
+ parent_die = nullptr; // Terminate the while loop.
break;
case DW_TAG_compile_unit:
case DW_TAG_partial_unit:
is_global_or_static_variable = true;
- parent_die = NULL; // Terminate the while loop.
+ parent_die = nullptr; // Terminate the while loop.
break;
default:
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index f639b031b12..c692e8bf18d 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -292,14 +292,14 @@ size_t SymbolFileDWARF::GetTypes(SymbolContextScope *sc_scope,
ASSERT_MODULE_LOCK(this);
TypeSet type_set;
- CompileUnit *comp_unit = NULL;
- DWARFUnit *dwarf_cu = NULL;
+ CompileUnit *comp_unit = nullptr;
+ DWARFUnit *dwarf_cu = nullptr;
if (sc_scope)
comp_unit = sc_scope->CalculateSymbolContextCompileUnit();
if (comp_unit) {
dwarf_cu = GetDWARFCompileUnit(comp_unit);
- if (dwarf_cu == 0)
+ if (dwarf_cu == nullptr)
return 0;
GetTypes(dwarf_cu->DIE(), dwarf_cu->GetOffset(),
dwarf_cu->GetNextUnitOffset(), type_mask, type_set);
@@ -355,7 +355,7 @@ SymbolFileDWARF::SymbolFileDWARF(ObjectFile *objfile,
UserID(0x7fffffff00000000), // Used by SymbolFileDWARFDebugMap to
// when this class parses .o files to
// contain the .o file index/ID
- m_debug_map_module_wp(), m_debug_map_symfile(NULL),
+ m_debug_map_module_wp(), m_debug_map_symfile(nullptr),
m_context(objfile->GetModule()->GetSectionList(), dwo_section_list),
m_data_debug_loc(), m_data_debug_ranges(), m_data_debug_rnglists(),
m_abbr(), m_info(), m_line(), m_fetched_external_modules(false),
@@ -433,10 +433,10 @@ bool SymbolFileDWARF::SupportedVersion(uint16_t version) {
uint32_t SymbolFileDWARF::CalculateAbilities() {
uint32_t abilities = 0;
- if (m_obj_file != NULL) {
- const Section *section = NULL;
+ if (m_obj_file != nullptr) {
+ const Section *section = nullptr;
const SectionList *section_list = m_obj_file->GetSectionList();
- if (section_list == NULL)
+ if (section_list == nullptr)
return 0;
uint64_t debug_abbrev_file_size = 0;
@@ -450,7 +450,7 @@ uint32_t SymbolFileDWARF::CalculateAbilities() {
section =
section_list->FindSectionByType(eSectionTypeDWARFDebugInfo, true).get();
- if (section != NULL) {
+ if (section != nullptr) {
debug_info_file_size = section->GetFileSize();
section =
@@ -587,7 +587,7 @@ const DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() const {
}
DWARFDebugInfo *SymbolFileDWARF::DebugInfo() {
- if (m_info == NULL) {
+ if (m_info == nullptr) {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
static_cast<void *>(this));
@@ -612,15 +612,15 @@ SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
if (info) {
// The compile unit ID is the index of the DWARF unit.
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(comp_unit->GetID());
- if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
+ if (dwarf_cu && dwarf_cu->GetUserData() == nullptr)
dwarf_cu->SetUserData(comp_unit);
return dwarf_cu;
}
- return NULL;
+ return nullptr;
}
DWARFDebugRangesBase *SymbolFileDWARF::DebugRanges() {
- if (m_ranges == NULL) {
+ if (m_ranges == nullptr) {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
static_cast<void *>(this));
@@ -905,7 +905,7 @@ static void ParseDWARFLineTableCallback(dw_offset_t offset,
bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) {
ASSERT_MODULE_LOCK(this);
- if (comp_unit.GetLineTable() != NULL)
+ if (comp_unit.GetLineTable() != nullptr)
return true;
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
@@ -1022,7 +1022,7 @@ size_t SymbolFileDWARF::ParseBlocksRecursive(
case DW_TAG_inlined_subroutine:
case DW_TAG_subprogram:
case DW_TAG_lexical_block: {
- Block *block = NULL;
+ Block *block = nullptr;
if (tag == DW_TAG_subprogram) {
// Skip any DW_TAG_subprogram DIEs that are inside of a normal or
// inlined functions. These will be parsed on their own as separate
@@ -1038,8 +1038,8 @@ size_t SymbolFileDWARF::ParseBlocksRecursive(
block = block_sp.get();
}
DWARFRangeList ranges;
- const char *name = NULL;
- const char *mangled_name = NULL;
+ const char *name = nullptr;
+ const char *mangled_name = nullptr;
int decl_file = 0;
int decl_line = 0;
@@ -1087,7 +1087,7 @@ size_t SymbolFileDWARF::ParseBlocksRecursive(
block->FinalizeRanges();
if (tag != DW_TAG_subprogram &&
- (name != NULL || mangled_name != NULL)) {
+ (name != nullptr || mangled_name != nullptr)) {
std::unique_ptr<Declaration> decl_up;
if (decl_file != 0 || decl_line != 0 || decl_column != 0)
decl_up.reset(new Declaration(
@@ -1312,7 +1312,7 @@ Type *SymbolFileDWARF::ResolveTypeUID(const DWARFDIE &die,
}
return ResolveType(die);
}
- return NULL;
+ return nullptr;
}
// This function is used when SymbolFileDWARFDebugMap owns a bunch of
@@ -1409,7 +1409,7 @@ CompileUnit *
SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) {
// Check if the symbol vendor already knows about this compile unit?
- if (dwarf_cu->GetUserData() == NULL) {
+ if (dwarf_cu->GetUserData() == nullptr) {
// The symbol vendor doesn't know about this compile unit, we need to parse
// and add it to the symbol vendor object.
return ParseCompileUnit(dwarf_cu, cu_idx).get();
@@ -1432,7 +1432,7 @@ bool SymbolFileDWARF::GetFunction(const DWARFDIE &die, SymbolContext &sc) {
sc.comp_unit = GetCompUnitForDWARFCompUnit(die.GetCU(), UINT32_MAX);
sc.function = sc.comp_unit->FindFunctionByUID(die.GetID()).get();
- if (sc.function == NULL)
+ if (sc.function == nullptr)
sc.function = ParseFunction(*sc.comp_unit, die);
if (sc.function) {
@@ -1573,7 +1573,7 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
}
Status error = ModuleList::GetSharedModule(
- dwo_module_spec, module_sp, NULL, NULL, NULL);
+ dwo_module_spec, module_sp, nullptr, nullptr, nullptr);
if (!module_sp) {
GetObjectFile()->GetModule()->ReportWarning(
"0x%8.8x: unable to locate module needed for external types: "
@@ -1703,7 +1703,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
if (function_die) {
sc.function =
sc.comp_unit->FindFunctionByUID(function_die.GetID()).get();
- if (sc.function == NULL)
+ if (sc.function == nullptr)
sc.function = ParseFunction(*sc.comp_unit, function_die);
if (sc.function && (resolve_scope & eSymbolContextBlock))
@@ -1718,7 +1718,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
force_check_line_table = true;
}
- if (sc.function != NULL) {
+ if (sc.function != nullptr) {
resolved |= eSymbolContextFunction;
if (resolve_scope & eSymbolContextBlock) {
@@ -1737,7 +1737,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
if ((resolve_scope & eSymbolContextLineEntry) ||
force_check_line_table) {
LineTable *line_table = sc.comp_unit->GetLineTable();
- if (line_table != NULL) {
+ if (line_table != nullptr) {
// And address that makes it into this function should be in
// terms of this debug file if there is no debug map, or it
// will be an address in the .o file which needs to be fixed up
@@ -1761,7 +1761,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
// only happen when there aren't other functions from other
// compile units in these gaps. This helps keep the size of the
// aranges down.
- sc.comp_unit = NULL;
+ sc.comp_unit = nullptr;
resolved &= ~eSymbolContextCompUnit;
}
} else {
@@ -1787,14 +1787,15 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
DWARFDebugInfo *debug_info = DebugInfo();
if (debug_info) {
uint32_t cu_idx;
- DWARFUnit *dwarf_cu = NULL;
+ DWARFUnit *dwarf_cu = nullptr;
- for (cu_idx = 0; (dwarf_cu = debug_info->GetUnitAtIndex(cu_idx)) != NULL;
+ for (cu_idx = 0;
+ (dwarf_cu = debug_info->GetUnitAtIndex(cu_idx)) != nullptr;
++cu_idx) {
CompileUnit *dc_cu = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
const bool full_match = (bool)file_spec.GetDirectory();
bool file_spec_matches_cu_file_spec =
- dc_cu != NULL && FileSpec::Equal(file_spec, *dc_cu, full_match);
+ dc_cu != nullptr && FileSpec::Equal(file_spec, *dc_cu, full_match);
if (check_inlines || file_spec_matches_cu_file_spec) {
SymbolContext sc(m_obj_file->GetModule());
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
@@ -1813,7 +1814,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
if (line != 0) {
LineTable *line_table = sc.comp_unit->GetLineTable();
- if (line_table != NULL && line != 0) {
+ if (line_table != nullptr && line != 0) {
// We will have already looked up the file index if we are
// searching for inline entries.
if (!check_inlines)
@@ -1827,8 +1828,8 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
found_line = sc.line_entry.line;
while (line_idx != UINT32_MAX) {
- sc.function = NULL;
- sc.block = NULL;
+ sc.function = nullptr;
+ sc.block = nullptr;
if (resolve_scope &
(eSymbolContextFunction | eSymbolContextBlock)) {
const lldb::addr_t file_vm_addr =
@@ -1842,7 +1843,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
sc.comp_unit
->FindFunctionByUID(function_die.GetID())
.get();
- if (sc.function == NULL)
+ if (sc.function == nullptr)
sc.function =
ParseFunction(*sc.comp_unit, function_die);
@@ -1852,7 +1853,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
function_die.LookupDeepestBlock(file_vm_addr);
}
- if (sc.function != NULL) {
+ if (sc.function != nullptr) {
Block &block = sc.function->GetBlock(true);
if (block_die)
@@ -1947,7 +1948,7 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(
return 0;
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
// Remember how many variables are in the list before we search.
@@ -2050,7 +2051,7 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
}
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
// Remember how many variables are in the list before we search.
@@ -2120,12 +2121,12 @@ bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die,
if (inlined_die) {
Block &function_block = sc.function->GetBlock(true);
sc.block = function_block.FindBlockByID(inlined_die.GetID());
- if (sc.block == NULL)
+ if (sc.block == nullptr)
sc.block = function_block.FindBlockByID(inlined_die.GetOffset());
- if (sc.block == NULL || !sc.block->GetStartAddress(addr))
+ if (sc.block == nullptr || !sc.block->GetStartAddress(addr))
addr.Clear();
} else {
- sc.block = NULL;
+ sc.block = nullptr;
addr = sc.function->GetAddressRange().GetBaseAddress();
}
@@ -2196,7 +2197,7 @@ uint32_t SymbolFileDWARF::FindFunctions(
const uint32_t original_size = sc_list.GetSize();
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
llvm::DenseSet<const DWARFDebugInfoEntry *> resolved_dies;
@@ -2319,7 +2320,7 @@ uint32_t SymbolFileDWARF::FindTypes(
searched_symbol_files.insert(this);
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
@@ -2513,7 +2514,7 @@ TypeSP SymbolFileDWARF::GetTypeForDIE(const DWARFDIE &die,
TypeSP type_sp;
if (die) {
Type *type_ptr = GetDIEToType().lookup(die.GetDIE());
- if (type_ptr == NULL) {
+ if (type_ptr == nullptr) {
CompileUnit *lldb_cu = GetCompUnitForDWARFCompUnit(die.GetCU());
assert(lldb_cu);
SymbolContext sc(lldb_cu);
@@ -2528,7 +2529,7 @@ TypeSP SymbolFileDWARF::GetTypeForDIE(const DWARFDIE &die,
!GetFunction(DWARFDIE(die.GetCU(), parent_die), sc))
sc = sc_backup;
- type_sp = ParseType(sc, die, NULL);
+ type_sp = ParseType(sc, die, nullptr);
} else if (type_ptr != DIE_IS_BEING_PARSED) {
// Grab the existing type from the master types lists
type_sp = type_ptr->shared_from_this();
@@ -2591,7 +2592,7 @@ SymbolFileDWARF::GetDeclContextDIEContainingDIE(const DWARFDIE &orig_die) {
Symbol *
SymbolFileDWARF::GetObjCClassSymbol(ConstString objc_class_name) {
- Symbol *objc_class_symbol = NULL;
+ Symbol *objc_class_symbol = nullptr;
if (m_obj_file) {
Symtab *symtab = m_obj_file->GetSymtab();
if (symtab) {
@@ -3026,9 +3027,9 @@ size_t SymbolFileDWARF::ParseTypes(CompileUnit &comp_unit) {
size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
ASSERT_MODULE_LOCK(this);
- if (sc.comp_unit != NULL) {
+ if (sc.comp_unit != nullptr) {
DWARFDebugInfo *info = DebugInfo();
- if (info == NULL)
+ if (info == nullptr)
return 0;
if (sc.function) {
@@ -3047,13 +3048,13 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
} else if (sc.comp_unit) {
DWARFUnit *dwarf_cu = info->GetUnitAtIndex(sc.comp_unit->GetID());
- if (dwarf_cu == NULL)
+ if (dwarf_cu == nullptr)
return 0;
uint32_t vars_added = 0;
VariableListSP variables(sc.comp_unit->GetVariableList(false));
- if (variables.get() == NULL) {
+ if (variables.get() == nullptr) {
variables = std::make_shared<VariableList>();
sc.comp_unit->SetVariableList(variables);
@@ -3105,8 +3106,8 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
const size_t num_attributes = die.GetAttributes(attributes);
DWARFDIE spec_die;
if (num_attributes > 0) {
- const char *name = NULL;
- const char *mangled = NULL;
+ const char *name = nullptr;
+ const char *mangled = nullptr;
Declaration decl;
uint32_t i;
DWARFFormValue type_die_form;
@@ -3288,7 +3289,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
ValueType scope = eValueTypeInvalid;
const DWARFDIE sc_parent_die = GetParentSymbolContextDIE(die);
- SymbolContextScope *symbol_context_scope = NULL;
+ SymbolContextScope *symbol_context_scope = nullptr;
bool has_explicit_mangled = mangled != nullptr;
if (!mangled) {
@@ -3334,7 +3335,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
if (op_error) {
StreamString strm;
location.DumpLocationForAddress(&strm, eDescriptionLevelFull, 0, 0,
- NULL);
+ nullptr);
GetObjectFile()->GetModule()->ReportError(
"0x%8.8x: %s has an invalid location: %s", die.GetOffset(),
die.GetTagAsCString(), strm.GetData());
@@ -3437,7 +3438,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
}
}
- if (symbol_context_scope == NULL) {
+ if (symbol_context_scope == nullptr) {
switch (parent_tag) {
case DW_TAG_subprogram:
case DW_TAG_inlined_subroutine:
@@ -3445,7 +3446,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
if (sc.function) {
symbol_context_scope = sc.function->GetBlock(true).FindBlockByID(
sc_parent_die.GetID());
- if (symbol_context_scope == NULL)
+ if (symbol_context_scope == nullptr)
symbol_context_scope = sc.function;
}
break;
@@ -3557,15 +3558,15 @@ size_t SymbolFileDWARF::ParseVariables(const SymbolContext &sc,
// We haven't already parsed it, lets do that now.
if ((tag == DW_TAG_variable) || (tag == DW_TAG_constant) ||
(tag == DW_TAG_formal_parameter && sc.function)) {
- if (variable_list_sp.get() == NULL) {
+ if (variable_list_sp.get() == nullptr) {
DWARFDIE sc_parent_die = GetParentSymbolContextDIE(orig_die);
dw_tag_t parent_tag = sc_parent_die.Tag();
switch (parent_tag) {
case DW_TAG_compile_unit:
case DW_TAG_partial_unit:
- if (sc.comp_unit != NULL) {
+ if (sc.comp_unit != nullptr) {
variable_list_sp = sc.comp_unit->GetVariableList(false);
- if (variable_list_sp.get() == NULL) {
+ if (variable_list_sp.get() == nullptr) {
variable_list_sp = std::make_shared<VariableList>();
}
} else {
@@ -3581,13 +3582,13 @@ size_t SymbolFileDWARF::ParseVariables(const SymbolContext &sc,
case DW_TAG_subprogram:
case DW_TAG_inlined_subroutine:
case DW_TAG_lexical_block:
- if (sc.function != NULL) {
+ if (sc.function != nullptr) {
// Check to see if we already have parsed the variables for the
// given scope
Block *block = sc.function->GetBlock(true).FindBlockByID(
sc_parent_die.GetID());
- if (block == NULL) {
+ if (block == nullptr) {
// This must be a specification or abstract origin with a
// concrete block counterpart in the current function. We need
// to find the concrete block so we can correctly add the
@@ -3601,10 +3602,10 @@ size_t SymbolFileDWARF::ParseVariables(const SymbolContext &sc,
concrete_block_die.GetID());
}
- if (block != NULL) {
+ if (block != nullptr) {
const bool can_create = false;
variable_list_sp = block->GetBlockVariableList(can_create);
- if (variable_list_sp.get() == NULL) {
+ if (variable_list_sp.get() == nullptr) {
variable_list_sp = std::make_shared<VariableList>();
block->SetVariableList(variable_list_sp);
}
@@ -3633,7 +3634,7 @@ size_t SymbolFileDWARF::ParseVariables(const SymbolContext &sc,
}
}
- bool skip_children = (sc.function == NULL && tag == DW_TAG_subprogram);
+ bool skip_children = (sc.function == nullptr && tag == DW_TAG_subprogram);
if (!skip_children && parse_children && die.HasChildren()) {
vars_added += ParseVariables(sc, die.GetFirstChild(), func_low_pc, true,
@@ -3718,7 +3719,7 @@ void SymbolFileDWARF::DumpClangAST(Stream &s) {
}
SymbolFileDWARFDebugMap *SymbolFileDWARF::GetDebugMapSymfile() {
- if (m_debug_map_symfile == NULL && !m_debug_map_module_wp.expired()) {
+ if (m_debug_map_symfile == nullptr && !m_debug_map_module_wp.expired()) {
lldb::ModuleSP module_sp(m_debug_map_module_wp.lock());
if (module_sp) {
SymbolVendor *sym_vendor = module_sp->GetSymbolVendor();
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 426719bf0b2..d3272454d0a 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -364,7 +364,7 @@ protected:
const DWARFDIE &orig_die,
const lldb::addr_t func_low_pc, bool parse_siblings,
bool parse_children,
- lldb_private::VariableList *cc_variable_list = NULL);
+ lldb_private::VariableList *cc_variable_list = nullptr);
bool ClassOrStructIsVirtual(const DWARFDIE &die);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index e5bc63b3cb8..8ec64dbaf76 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -175,7 +175,7 @@ public:
SymbolVendor *
GetSymbolVendor(bool can_create = true,
- lldb_private::Stream *feedback_strm = NULL) override {
+ lldb_private::Stream *feedback_strm = nullptr) override {
// Scope for locker
if (m_symfile_up.get() || !can_create)
return m_symfile_up.get();
@@ -197,7 +197,7 @@ public:
symbol_vendor->GetSymbolFile());
if (!oso_symfile)
- return NULL;
+ return nullptr;
ObjectFile *exe_objfile = exe_module_sp->GetObjectFile();
SymbolVendor *exe_sym_vendor = exe_module_sp->GetSymbolVendor();
@@ -213,7 +213,7 @@ public:
}
}
}
- return NULL;
+ return nullptr;
}
protected:
@@ -368,12 +368,12 @@ void SymbolFileDWARFDebugMap::InitOSO() {
oso_symbol->GetName().GetCString());
}
} else {
- if (oso_symbol == NULL)
+ if (oso_symbol == nullptr)
m_obj_file->GetModule()->ReportError(
"N_OSO symbol[%u] can't be found, please file a bug and attach "
"the binary listed in this error",
oso_idx);
- else if (so_symbol == NULL)
+ else if (so_symbol == nullptr)
m_obj_file->GetModule()->ReportError(
"N_SO not found for N_OSO symbol[%u], please file a bug and "
"attach the binary listed in this error",
@@ -398,7 +398,7 @@ Module *SymbolFileDWARFDebugMap::GetModuleByOSOIndex(uint32_t oso_idx) {
const uint32_t cu_count = GetNumCompileUnits();
if (oso_idx < cu_count)
return GetModuleByCompUnitInfo(&m_compile_unit_infos[oso_idx]);
- return NULL;
+ return nullptr;
}
Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
@@ -428,7 +428,7 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
") since this executable was linked, file will be ignored",
oso_file.GetPath().c_str(), llvm::to_string(oso_mod_time).c_str(),
llvm::to_string(comp_unit_info->oso_mod_time).c_str());
- return NULL;
+ return nullptr;
}
} else {
@@ -436,7 +436,7 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
if (!ObjectFile::SplitArchivePathWithObject(oso_path, oso_file,
oso_object, must_exist)) {
- return NULL;
+ return nullptr;
}
}
// Always create a new module for .o files. Why? Because we use the debug
@@ -462,7 +462,7 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
}
if (comp_unit_info->oso_sp)
return comp_unit_info->oso_sp->module_sp.get();
- return NULL;
+ return nullptr;
}
bool SymbolFileDWARFDebugMap::GetFileSpecForSO(uint32_t oso_idx,
@@ -480,7 +480,7 @@ ObjectFile *SymbolFileDWARFDebugMap::GetObjectFileByOSOIndex(uint32_t oso_idx) {
Module *oso_module = GetModuleByOSOIndex(oso_idx);
if (oso_module)
return oso_module->GetObjectFile();
- return NULL;
+ return nullptr;
}
SymbolFileDWARF *
@@ -493,7 +493,7 @@ SymbolFileDWARFDebugMap::GetSymbolFile(const CompileUnit &comp_unit) {
CompileUnitInfo *comp_unit_info = GetCompUnitInfo(comp_unit);
if (comp_unit_info)
return GetSymbolFileByCompUnitInfo(comp_unit_info);
- return NULL;
+ return nullptr;
}
ObjectFile *SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo(
@@ -501,7 +501,7 @@ ObjectFile *SymbolFileDWARFDebugMap::GetObjectFileByCompUnitInfo(
Module *oso_module = GetModuleByCompUnitInfo(comp_unit_info);
if (oso_module)
return oso_module->GetObjectFile();
- return NULL;
+ return nullptr;
}
uint32_t SymbolFileDWARFDebugMap::GetCompUnitInfoIndex(
@@ -521,7 +521,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileByOSOIndex(uint32_t oso_idx) {
unsigned size = m_compile_unit_infos.size();
if (oso_idx < size)
return GetSymbolFileByCompUnitInfo(&m_compile_unit_infos[oso_idx]);
- return NULL;
+ return nullptr;
}
SymbolFileDWARF *
@@ -529,7 +529,7 @@ SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF(SymbolFile *sym_file) {
if (sym_file &&
sym_file->GetPluginName() == SymbolFileDWARF::GetPluginNameStatic())
return (SymbolFileDWARF *)sym_file;
- return NULL;
+ return nullptr;
}
SymbolFileDWARF *SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo(
@@ -540,7 +540,7 @@ SymbolFileDWARF *SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo(
if (sym_vendor)
return GetSymbolFileAsSymbolFileDWARF(sym_vendor->GetSymbolFile());
}
- return NULL;
+ return nullptr;
}
uint32_t SymbolFileDWARFDebugMap::CalculateAbilities() {
@@ -609,7 +609,7 @@ SymbolFileDWARFDebugMap::GetCompUnitInfo(const CompileUnit &comp_unit) {
if (comp_unit == m_compile_unit_infos[i].compile_unit_sp.get())
return &m_compile_unit_infos[i];
}
- return NULL;
+ return nullptr;
}
size_t SymbolFileDWARFDebugMap::GetCompUnitInfosForModule(
@@ -706,7 +706,7 @@ Type *SymbolFileDWARFDebugMap::ResolveTypeUID(lldb::user_id_t type_uid) {
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
if (oso_dwarf)
return oso_dwarf->ResolveTypeUID(type_uid);
- return NULL;
+ return nullptr;
}
llvm::Optional<SymbolFile::ArrayInfo>
@@ -750,7 +750,7 @@ SymbolFileDWARFDebugMap::ResolveSymbolContext(const Address &exe_so_addr,
sc.symbol =
symtab->SymbolAtIndex(debug_map_entry->data.GetExeSymbolIndex());
- if (sc.symbol != NULL) {
+ if (sc.symbol != nullptr) {
resolved_flags |= eSymbolContextSymbol;
uint32_t oso_idx = 0;
@@ -930,7 +930,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo *
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex(
uint32_t symbol_idx, uint32_t *oso_idx_ptr) {
const uint32_t oso_index_count = m_compile_unit_infos.size();
- CompileUnitInfo *comp_unit_info = NULL;
+ CompileUnitInfo *comp_unit_info = nullptr;
if (oso_index_count) {
comp_unit_info = (CompileUnitInfo *)bsearch(
&symbol_idx, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
@@ -939,7 +939,7 @@ SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithIndex(
}
if (oso_idx_ptr) {
- if (comp_unit_info != NULL)
+ if (comp_unit_info != nullptr)
*oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
else
*oso_idx_ptr = UINT32_MAX;
@@ -951,7 +951,7 @@ SymbolFileDWARFDebugMap::CompileUnitInfo *
SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID(
user_id_t symbol_id, uint32_t *oso_idx_ptr) {
const uint32_t oso_index_count = m_compile_unit_infos.size();
- CompileUnitInfo *comp_unit_info = NULL;
+ CompileUnitInfo *comp_unit_info = nullptr;
if (oso_index_count) {
comp_unit_info = (CompileUnitInfo *)::bsearch(
&symbol_id, &m_compile_unit_infos[0], m_compile_unit_infos.size(),
@@ -960,7 +960,7 @@ SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID(
}
if (oso_idx_ptr) {
- if (comp_unit_info != NULL)
+ if (comp_unit_info != nullptr)
*oso_idx_ptr = comp_unit_info - &m_compile_unit_infos[0];
else
*oso_idx_ptr = UINT32_MAX;
@@ -1058,7 +1058,7 @@ size_t SymbolFileDWARFDebugMap::GetTypes(SymbolContextScope *sc_scope,
type_mask);
uint32_t initial_size = type_list.GetSize();
- SymbolFileDWARF *oso_dwarf = NULL;
+ SymbolFileDWARF *oso_dwarf = nullptr;
if (sc_scope) {
SymbolContext sc;
sc_scope->CalculateSymbolContext(&sc);
@@ -1103,7 +1103,7 @@ bool SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type(
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
if (skip_dwarf_oso != oso_dwarf &&
- oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(NULL)) {
+ oso_dwarf->Supports_DW_AT_APPLE_objc_complete_type(nullptr)) {
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
return true;
}
@@ -1122,7 +1122,7 @@ TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
// contain the implementation definition since it will be scoped inside the
// N_SO and we can then locate the SymbolFileDWARF that corresponds to that
// N_SO.
- SymbolFileDWARF *oso_dwarf = NULL;
+ SymbolFileDWARF *oso_dwarf = nullptr;
TypeSP type_sp;
ObjectFile *module_objfile = m_obj_file->GetModule()->GetObjectFile();
if (module_objfile) {
@@ -1143,7 +1143,7 @@ TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
if (source_file_symbol_idx != UINT32_MAX) {
CompileUnitInfo *compile_unit_info =
GetCompileUnitInfoForSymbolWithIndex(source_file_symbol_idx,
- NULL);
+ nullptr);
if (compile_unit_info) {
oso_dwarf = GetSymbolFileByCompUnitInfo(compile_unit_info);
if (oso_dwarf) {
@@ -1268,7 +1268,7 @@ SymbolFileDWARFDebugMap::GetCompileUnitInfo(SymbolFileDWARF *oso_dwarf) {
}
}
}
- return NULL;
+ return nullptr;
}
void SymbolFileDWARFDebugMap::SetCompileUnit(SymbolFileDWARF *oso_dwarf,
@@ -1414,7 +1414,7 @@ LineTable *SymbolFileDWARFDebugMap::LinkOSOLineTable(SymbolFileDWARF *oso_dwarf,
CompileUnitInfo *cu_info = GetCompileUnitInfo(oso_dwarf);
if (cu_info)
return line_table->LinkLineTable(cu_info->GetFileRangeMap(this));
- return NULL;
+ return nullptr;
}
size_t
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
index 0f5262d2f45..8da7e222626 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
@@ -39,12 +39,12 @@ bool UniqueDWARFASTTypeList::Find(const DWARFDIE &die,
case DW_TAG_namespace: {
const char *parent_arg_die_name = parent_arg_die.GetName();
if (parent_arg_die_name ==
- NULL) // Anonymous (i.e. no-name) struct
+ nullptr) // Anonymous (i.e. no-name) struct
{
match = false;
} else {
const char *parent_pos_die_name = parent_pos_die.GetName();
- if (parent_pos_die_name == NULL ||
+ if (parent_pos_die_name == nullptr ||
((parent_arg_die_name != parent_pos_die_name) &&
strcmp(parent_arg_die_name, parent_pos_die_name)))
match = false;
diff --git a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
index 7fa3a1c5d65..a1b21e51b0f 100644
--- a/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
+++ b/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
@@ -139,8 +139,8 @@ size_t SymbolFileSymtab::ParseFunctions(CompileUnit &comp_unit) {
size_t num_added = 0;
// We must at least have a valid compile unit
const Symtab *symtab = m_obj_file->GetSymtab();
- const Symbol *curr_symbol = NULL;
- const Symbol *next_symbol = NULL;
+ const Symbol *curr_symbol = nullptr;
+ const Symbol *next_symbol = nullptr;
// const char *prefix = m_obj_file->SymbolPrefix();
// if (prefix == NULL)
// prefix == "";
@@ -188,10 +188,10 @@ size_t SymbolFileSymtab::ParseFunctions(CompileUnit &comp_unit) {
LLDB_INVALID_UID, // We don't have any type info
// for this function
curr_symbol->GetMangled(), // Linker/mangled name
- NULL, // no return type for a code symbol...
+ nullptr, // no return type for a code symbol...
func_range)); // first address range
- if (func_sp.get() != NULL) {
+ if (func_sp.get() != nullptr) {
comp_unit.AddFunction(func_sp);
++num_added;
}
@@ -230,7 +230,7 @@ size_t SymbolFileSymtab::ParseVariablesForContext(const SymbolContext &sc) {
}
Type *SymbolFileSymtab::ResolveTypeUID(lldb::user_id_t type_uid) {
- return NULL;
+ return nullptr;
}
llvm::Optional<SymbolFile::ArrayInfo>
@@ -246,7 +246,7 @@ bool SymbolFileSymtab::CompleteType(lldb_private::CompilerType &compiler_type) {
uint32_t SymbolFileSymtab::ResolveSymbolContext(const Address &so_addr,
SymbolContextItem resolve_scope,
SymbolContext &sc) {
- if (m_obj_file->GetSymtab() == NULL)
+ if (m_obj_file->GetSymtab() == nullptr)
return 0;
uint32_t resolved_flags = 0;
diff --git a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index 1efbeab934c..f279af61a13 100644
--- a/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/lldb/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -59,20 +59,20 @@ SymbolVendor *
SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
lldb_private::Stream *feedback_strm) {
if (!module_sp)
- return NULL;
+ return nullptr;
ObjectFile *obj_file = module_sp->GetObjectFile();
if (!obj_file)
- return NULL;
+ return nullptr;
static ConstString obj_file_elf("elf");
ConstString obj_name = obj_file->GetPluginName();
if (obj_name != obj_file_elf)
- return NULL;
+ return nullptr;
lldb_private::UUID uuid = obj_file->GetUUID();
if (!uuid)
- return NULL;
+ return nullptr;
// Get the .gnu_debuglink file (if specified).
FileSpecList file_spec_list = obj_file->GetDebugSymbolFilePaths();
@@ -84,7 +84,7 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
// If we have no debug symbol files, then nothing to do.
if (file_spec_list.IsEmpty())
- return NULL;
+ return nullptr;
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "SymbolVendorELF::CreateInstance (module = %s)",
@@ -153,7 +153,7 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
}
}
}
- return NULL;
+ return nullptr;
}
// PluginInterface protocol
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
index 00b2826e1f0..c97eb98557a 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
@@ -143,7 +143,7 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction(
// function:
if (!m_get_item_info_impl_code) {
- if (g_get_item_info_function_code != NULL) {
+ if (g_get_item_info_function_code != nullptr) {
Status error;
m_get_item_info_impl_code.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
index ddd3cb5d7cb..12fad7f561b 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
@@ -147,7 +147,7 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction(
// First stage is to make the ClangUtility to hold our injected function:
if (!m_get_pending_items_impl_code) {
- if (g_get_pending_items_function_code != NULL) {
+ if (g_get_pending_items_function_code != nullptr) {
Status error;
m_get_pending_items_impl_code.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
@@ -347,7 +347,7 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue,
options.SetIsForUtilityExpr(true);
thread.CalculateExecutionContext(exe_ctx);
- if (get_pending_items_caller == NULL) {
+ if (get_pending_items_caller == nullptr) {
error.SetErrorString("Unable to compile function to call "
"__introspection_dispatch_queue_get_pending_items");
return return_value;
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
index 2b6c553dd43..e1dabae0d58 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
@@ -158,7 +158,7 @@ AppleGetQueuesHandler::SetupGetQueuesFunction(Thread &thread,
// First stage is to make the ClangUtility to hold our injected function:
if (!m_get_queues_impl_code_up) {
- if (g_get_current_queues_function_code != NULL) {
+ if (g_get_current_queues_function_code != nullptr) {
Status error;
m_get_queues_impl_code_up.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
@@ -335,7 +335,7 @@ AppleGetQueuesHandler::GetCurrentQueues(Thread &thread, addr_t page_to_free,
FunctionCaller *get_queues_caller =
m_get_queues_impl_code_up->GetFunctionCaller();
- if (get_queues_caller == NULL) {
+ if (get_queues_caller == nullptr) {
error.SetErrorString(
"Unable to get caller for call __introspection_dispatch_get_queues");
return return_value;
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
index f409b674c53..7d0cbc0c100 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
@@ -154,7 +154,7 @@ lldb::addr_t AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction(
if (!m_get_thread_item_info_impl_code) {
Status error;
- if (g_get_thread_item_info_function_code != NULL) {
+ if (g_get_thread_item_info_function_code != nullptr) {
m_get_thread_item_info_impl_code.reset(
exe_ctx.GetTargetRef().GetUtilityFunctionForLanguage(
g_get_thread_item_info_function_code, eLanguageTypeC,
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
index 82be85699b2..91a60b17fc9 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -70,7 +70,7 @@ SystemRuntime *SystemRuntimeMacOSX::CreateInstance(Process *process) {
if (create)
return new SystemRuntimeMacOSX(process);
- return NULL;
+ return nullptr;
}
// Constructor
@@ -106,7 +106,7 @@ void SystemRuntimeMacOSX::Clear(bool clear_process) {
m_process->ClearBreakpointSiteByID(m_break_id);
if (clear_process)
- m_process = NULL;
+ m_process = nullptr;
m_break_id = LLDB_INVALID_BREAK_ID;
}
@@ -266,7 +266,7 @@ void SystemRuntimeMacOSX::ReadLibdispatchOffsetsAddress() {
static ConstString g_dispatch_queue_offsets_symbol_name(
"dispatch_queue_offsets");
- const Symbol *dispatch_queue_offsets_symbol = NULL;
+ const Symbol *dispatch_queue_offsets_symbol = nullptr;
// libdispatch symbols were in libSystem.B.dylib up through Mac OS X 10.6
// ("Snow Leopard")
@@ -279,7 +279,7 @@ void SystemRuntimeMacOSX::ReadLibdispatchOffsetsAddress() {
// libdispatch symbols are in their own dylib as of Mac OS X 10.7 ("Lion")
// and later
- if (dispatch_queue_offsets_symbol == NULL) {
+ if (dispatch_queue_offsets_symbol == nullptr) {
ModuleSpec libdispatch_module_spec(FileSpec("libdispatch.dylib"));
module_sp = m_process->GetTarget().GetImages().FindFirstModule(
libdispatch_module_spec);
@@ -322,7 +322,7 @@ void SystemRuntimeMacOSX::ReadLibpthreadOffsetsAddress() {
static ConstString g_libpthread_layout_offsets_symbol_name(
"pthread_layout_offsets");
- const Symbol *libpthread_layout_offsets_symbol = NULL;
+ const Symbol *libpthread_layout_offsets_symbol = nullptr;
ModuleSpec libpthread_module_spec(FileSpec("libsystem_pthread.dylib"));
ModuleSP module_sp(m_process->GetTarget().GetImages().FindFirstModule(
@@ -370,7 +370,7 @@ void SystemRuntimeMacOSX::ReadLibdispatchTSDIndexesAddress() {
static ConstString g_libdispatch_tsd_indexes_symbol_name(
"dispatch_tsd_indexes");
- const Symbol *libdispatch_tsd_indexes_symbol = NULL;
+ const Symbol *libdispatch_tsd_indexes_symbol = nullptr;
ModuleSpec libpthread_module_spec(FileSpec("libdispatch.dylib"));
ModuleSP module_sp(m_process->GetTarget().GetImages().FindFirstModule(
@@ -726,7 +726,8 @@ void SystemRuntimeMacOSX::PopulateQueueList(
for (ThreadSP thread_sp : m_process->Threads()) {
if (thread_sp->GetAssociatedWithLibdispatchQueue() != eLazyBoolNo) {
if (thread_sp->GetQueueID() != LLDB_INVALID_QUEUE_ID) {
- if (queue_list.FindQueueByID(thread_sp->GetQueueID()).get() == NULL) {
+ if (queue_list.FindQueueByID(thread_sp->GetQueueID()).get() ==
+ nullptr) {
QueueSP queue_sp(new Queue(m_process->shared_from_this(),
thread_sp->GetQueueID(),
thread_sp->GetQueueName()));
@@ -933,7 +934,7 @@ void SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(
offset = start_of_this_item +
m_lib_backtrace_recording_info.queue_info_data_offset;
const char *queue_label = extractor.GetCStr(&offset);
- if (queue_label == NULL)
+ if (queue_label == nullptr)
queue_label = "";
offset_t start_of_next_item = start_of_this_item + offset_to_next;
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index 70c13182183..4aa9fb634b6 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -67,8 +67,8 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
const bool prefer_file_cache = true;
DisassemblerSP disasm_sp(Disassembler::DisassembleBytes(
- m_arch, NULL, NULL, range.GetBaseAddress(), opcode_data, opcode_size,
- 99999, prefer_file_cache));
+ m_arch, nullptr, nullptr, range.GetBaseAddress(), opcode_data,
+ opcode_size, 99999, prefer_file_cache));
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
@@ -213,7 +213,7 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
lldb_private::FormatEntity::Entry format;
FormatEntity::Parse("${frame.pc}: ", format);
inst->Dump(&strm, inst_list.GetMaxOpcocdeByteSize(), show_address,
- show_bytes, NULL, NULL, NULL, &format, 0);
+ show_bytes, nullptr, nullptr, nullptr, &format, 0);
log->PutString(strm.GetString());
}
@@ -296,11 +296,11 @@ UnwindAssembly *
UnwindAssemblyInstEmulation::CreateInstance(const ArchSpec &arch) {
std::unique_ptr<EmulateInstruction> inst_emulator_up(
EmulateInstruction::FindPlugin(arch, eInstructionTypePrologueEpilogue,
- NULL));
+ nullptr));
// Make sure that all prologue instructions are handled
if (inst_emulator_up)
return new UnwindAssemblyInstEmulation(arch, inst_emulator_up.release());
- return NULL;
+ return nullptr;
}
// PluginInterface protocol in UnwindAssemblyParser_x86
diff --git a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
index 5232d083321..9125bd5b1fe 100644
--- a/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
+++ b/lldb/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h
@@ -65,7 +65,7 @@ private:
UnwindAssemblyInstEmulation(const lldb_private::ArchSpec &arch,
lldb_private::EmulateInstruction *inst_emulator)
: UnwindAssembly(arch), m_inst_emulator_up(inst_emulator),
- m_range_ptr(NULL), m_unwind_plan_ptr(NULL), m_curr_row(),
+ m_range_ptr(nullptr), m_unwind_plan_ptr(nullptr), m_curr_row(),
m_cfa_reg_info(), m_fp_is_cfa(false), m_register_values(),
m_pushed_regs(), m_curr_row_modified(false),
m_forward_branch_offset(0) {
diff --git a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
index 2157855009d..ce168f02104 100644
--- a/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
+++ b/lldb/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
@@ -239,7 +239,7 @@ UnwindAssembly *UnwindAssembly_x86::CreateInstance(const ArchSpec &arch) {
const llvm::Triple::ArchType cpu = arch.GetMachine();
if (cpu == llvm::Triple::x86 || cpu == llvm::Triple::x86_64)
return new UnwindAssembly_x86(arch);
- return NULL;
+ return nullptr;
}
// PluginInterface protocol in UnwindAssemblyParser_x86
OpenPOWER on IntegriCloud