summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--lldb/include/lldb/Breakpoint/BreakpointResolver.h2
-rw-r--r--lldb/source/API/SBAddress.cpp6
-rw-r--r--lldb/source/API/SBBlock.cpp12
-rw-r--r--lldb/source/API/SBBreakpointLocation.cpp6
-rw-r--r--lldb/source/API/SBBroadcaster.cpp19
-rw-r--r--lldb/source/API/SBCommunication.cpp12
-rw-r--r--lldb/source/API/SBCompileUnit.cpp10
-rw-r--r--lldb/source/API/SBData.cpp10
-rw-r--r--lldb/source/API/SBDeclaration.cpp2
-rw-r--r--lldb/source/API/SBError.cpp9
-rw-r--r--lldb/source/API/SBEvent.cpp6
-rw-r--r--lldb/source/API/SBFunction.cpp16
-rw-r--r--lldb/source/API/SBHostOS.cpp5
-rw-r--r--lldb/source/API/SBInstruction.cpp13
-rw-r--r--lldb/source/API/SBInstructionList.cpp8
-rw-r--r--lldb/source/API/SBLineEntry.cpp2
-rw-r--r--lldb/source/API/SBListener.cpp20
-rw-r--r--lldb/source/API/SBModule.cpp23
-rw-r--r--lldb/source/API/SBPlatform.cpp28
-rw-r--r--lldb/source/API/SBProcess.cpp10
-rw-r--r--lldb/source/API/SBQueue.cpp4
-rw-r--r--lldb/source/API/SBQueueItem.cpp2
-rw-r--r--lldb/source/API/SBSection.cpp4
-rw-r--r--lldb/source/API/SBSourceManager.cpp2
-rw-r--r--lldb/source/API/SBStream.cpp10
-rw-r--r--lldb/source/API/SBStringList.cpp10
-rw-r--r--lldb/source/API/SBSymbol.cpp18
-rw-r--r--lldb/source/API/SBSymbolContext.cpp17
-rw-r--r--lldb/source/API/SBSymbolContextList.cpp4
-rw-r--r--lldb/source/API/SBTarget.cpp54
-rw-r--r--lldb/source/API/SBThread.cpp22
-rw-r--r--lldb/source/API/SBThreadCollection.cpp2
-rw-r--r--lldb/source/API/SBThreadPlan.cpp4
-rw-r--r--lldb/source/API/SBType.cpp16
-rw-r--r--lldb/source/API/SBTypeCategory.cpp4
-rw-r--r--lldb/source/API/SBTypeEnumMember.cpp6
-rw-r--r--lldb/source/API/SBTypeFilter.cpp4
-rw-r--r--lldb/source/API/SBTypeFormat.cpp2
-rw-r--r--lldb/source/API/SBTypeNameSpecifier.cpp8
-rw-r--r--lldb/source/API/SBTypeSummary.cpp4
-rw-r--r--lldb/source/API/SBTypeSynthetic.cpp4
-rw-r--r--lldb/source/API/SBValue.cpp26
-rw-r--r--lldb/source/API/SBValueList.cpp4
-rw-r--r--lldb/source/API/SBWatchpoint.cpp4
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverAddress.cpp2
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverFileLine.cpp2
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp4
-rw-r--r--lldb/source/Breakpoint/BreakpointResolverScripted.cpp4
-rw-r--r--lldb/source/Commands/CommandObjectExpression.h2
-rw-r--r--lldb/source/Core/Communication.cpp2
-rw-r--r--lldb/source/Core/Debugger.cpp4
-rw-r--r--lldb/source/Core/Mangled.cpp2
-rw-r--r--lldb/source/Core/Section.cpp14
-rw-r--r--lldb/source/Core/SourceManager.cpp10
-rw-r--r--lldb/source/Core/Value.cpp30
-rw-r--r--lldb/source/Core/ValueObject.cpp67
-rw-r--r--lldb/source/Core/ValueObjectConstResultImpl.cpp20
-rw-r--r--lldb/source/Core/ValueObjectMemory.cpp2
-rw-r--r--lldb/source/Core/ValueObjectRegister.cpp20
-rw-r--r--lldb/source/Core/ValueObjectVariable.cpp8
-rw-r--r--lldb/source/DataFormatters/DataVisualization.cpp2
-rw-r--r--lldb/source/DataFormatters/FormatManager.cpp12
-rw-r--r--lldb/source/DataFormatters/FormattersHelpers.cpp2
-rw-r--r--lldb/source/DataFormatters/StringPrinter.cpp8
-rw-r--r--lldb/source/DataFormatters/TypeFormat.cpp2
-rw-r--r--lldb/source/DataFormatters/TypeSynthetic.cpp18
-rw-r--r--lldb/source/DataFormatters/ValueObjectPrinter.cpp7
-rw-r--r--lldb/source/Expression/DWARFExpression.cpp12
-rw-r--r--lldb/source/Expression/ExpressionVariable.cpp2
-rw-r--r--lldb/source/Expression/FunctionCaller.cpp21
-rw-r--r--lldb/source/Expression/IRExecutionUnit.cpp8
-rw-r--r--lldb/source/Expression/IRInterpreter.cpp2
-rw-r--r--lldb/source/Expression/IRMemoryMap.cpp2
-rw-r--r--lldb/source/Expression/LLVMUserExpression.cpp4
-rw-r--r--lldb/source/Expression/UserExpression.cpp6
-rw-r--r--lldb/source/Host/common/Editline.cpp14
-rw-r--r--lldb/source/Host/common/File.cpp8
-rw-r--r--lldb/source/Host/common/Host.cpp8
-rw-r--r--lldb/source/Host/common/HostNativeThreadBase.cpp8
-rw-r--r--lldb/source/Host/common/OptionParser.cpp6
-rw-r--r--lldb/source/Host/common/ProcessRunLock.cpp2
-rw-r--r--lldb/source/Host/common/SocketAddress.cpp6
-rw-r--r--lldb/source/Host/common/TCPSocket.cpp4
-rw-r--r--lldb/source/Host/common/TaskPool.cpp2
-rw-r--r--lldb/source/Host/common/Terminal.cpp6
-rw-r--r--lldb/source/Host/common/ThreadLauncher.cpp2
-rw-r--r--lldb/source/Host/common/XML.cpp2
-rw-r--r--lldb/source/Host/linux/Host.cpp8
-rw-r--r--lldb/source/Host/linux/HostInfoLinux.cpp3
-rw-r--r--lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp2
-rw-r--r--lldb/source/Host/posix/HostThreadPosix.cpp2
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp6
-rw-r--r--lldb/source/Interpreter/OptionValue.cpp6
-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
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp12
-rw-r--r--lldb/source/Symbol/ClangASTImporter.cpp12
-rw-r--r--lldb/source/Symbol/CompactUnwindInfo.cpp2
-rw-r--r--lldb/source/Symbol/CompilerType.cpp4
-rw-r--r--lldb/source/Symbol/LocateSymbolFile.cpp7
-rw-r--r--lldb/source/Symbol/SymbolContext.cpp2
-rw-r--r--lldb/source/Symbol/Symtab.cpp2
-rw-r--r--lldb/source/Symbol/Type.cpp2
-rw-r--r--lldb/source/Target/CPPLanguageRuntime.cpp2
-rw-r--r--lldb/source/Target/Process.cpp6
-rw-r--r--lldb/source/Target/SectionLoadHistory.cpp2
-rw-r--r--lldb/source/Target/StopInfo.cpp2
-rw-r--r--lldb/source/Target/ThreadPlanShouldStopHere.cpp2
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdExec.cpp4
-rw-r--r--lldb/tools/lldb-mi/MICmdCmdTarget.cpp2
-rw-r--r--lldb/tools/lldb-mi/MICmnBase.cpp2
-rw-r--r--lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp4
-rw-r--r--lldb/tools/lldb-mi/MICmnMIResultRecord.cpp2
-rw-r--r--lldb/tools/lldb-mi/MIDriver.cpp4
-rw-r--r--lldb/tools/lldb-mi/MIDriverBase.cpp2
-rw-r--r--lldb/tools/lldb-mi/MIDriverMgr.cpp2
-rw-r--r--lldb/tools/lldb-server/lldb-gdbserver.cpp20
-rw-r--r--lldb/tools/lldb-server/lldb-platform.cpp18
-rw-r--r--lldb/unittests/Utility/StringExtractorTest.cpp2
-rw-r--r--lldb/unittests/tools/lldb-server/inferior/thread_inferior.cpp2
-rw-r--r--lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp8
-rw-r--r--llvm/include/llvm/ADT/DenseMap.h2
-rw-r--r--llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h2
250 files changed, 1487 insertions, 1461 deletions
diff --git a/lldb/include/lldb/Breakpoint/BreakpointResolver.h b/lldb/include/lldb/Breakpoint/BreakpointResolver.h
index 8767e0d8b5c..11e183b3348 100644
--- a/lldb/include/lldb/Breakpoint/BreakpointResolver.h
+++ b/lldb/include/lldb/Breakpoint/BreakpointResolver.h
@@ -209,7 +209,7 @@ protected:
const char *) = delete;
lldb::BreakpointLocationSP AddLocation(Address loc_addr,
- bool *new_location = NULL);
+ bool *new_location = nullptr);
Breakpoint *m_breakpoint; // This is the breakpoint we add locations to.
lldb::addr_t m_offset; // A random offset the user asked us to add to any
diff --git a/lldb/source/API/SBAddress.cpp b/lldb/source/API/SBAddress.cpp
index cb67690544b..358cb400a76 100644
--- a/lldb/source/API/SBAddress.cpp
+++ b/lldb/source/API/SBAddress.cpp
@@ -83,7 +83,7 @@ bool SBAddress::IsValid() const {
SBAddress::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBAddress, operator bool);
- return m_opaque_up != NULL && m_opaque_up->IsValid();
+ return m_opaque_up != nullptr && m_opaque_up->IsValid();
}
void SBAddress::Clear() {
@@ -186,7 +186,7 @@ Address *SBAddress::operator->() { return m_opaque_up.get(); }
const Address *SBAddress::operator->() const { return m_opaque_up.get(); }
Address &SBAddress::ref() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new Address());
return *m_opaque_up;
}
@@ -208,7 +208,7 @@ bool SBAddress::GetDescription(SBStream &description) {
// case there isn't one already...
Stream &strm = description.ref();
if (m_opaque_up->IsValid()) {
- m_opaque_up->Dump(&strm, NULL, Address::DumpStyleResolvedDescription,
+ m_opaque_up->Dump(&strm, nullptr, Address::DumpStyleResolvedDescription,
Address::DumpStyleModuleWithFileAddress, 4);
StreamString sstrm;
// m_opaque_up->Dump (&sstrm, NULL,
diff --git a/lldb/source/API/SBBlock.cpp b/lldb/source/API/SBBlock.cpp
index b8ca473894f..f333d1d7b5f 100644
--- a/lldb/source/API/SBBlock.cpp
+++ b/lldb/source/API/SBBlock.cpp
@@ -25,7 +25,7 @@
using namespace lldb;
using namespace lldb_private;
-SBBlock::SBBlock() : m_opaque_ptr(NULL) {
+SBBlock::SBBlock() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBlock);
}
@@ -44,7 +44,7 @@ const SBBlock &SBBlock::operator=(const SBBlock &rhs) {
return LLDB_RECORD_RESULT(*this);
}
-SBBlock::~SBBlock() { m_opaque_ptr = NULL; }
+SBBlock::~SBBlock() { m_opaque_ptr = nullptr; }
bool SBBlock::IsValid() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, IsValid);
@@ -53,14 +53,14 @@ bool SBBlock::IsValid() const {
SBBlock::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, operator bool);
- return m_opaque_ptr != NULL;
+ return m_opaque_ptr != nullptr;
}
bool SBBlock::IsInlined() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBlock, IsInlined);
if (m_opaque_ptr)
- return m_opaque_ptr->GetInlinedFunctionInfo() != NULL;
+ return m_opaque_ptr->GetInlinedFunctionInfo() != nullptr;
return false;
}
@@ -77,10 +77,10 @@ const char *SBBlock::GetInlinedName() const {
language = function->GetLanguage();
else
language = lldb::eLanguageTypeUnknown;
- return inlined_info->GetName(language).AsCString(NULL);
+ return inlined_info->GetName(language).AsCString(nullptr);
}
}
- return NULL;
+ return nullptr;
}
SBFileSpec SBBlock::GetInlinedCallSiteFile() const {
diff --git a/lldb/source/API/SBBreakpointLocation.cpp b/lldb/source/API/SBBreakpointLocation.cpp
index 56068750709..640545f55ef 100644
--- a/lldb/source/API/SBBreakpointLocation.cpp
+++ b/lldb/source/API/SBBreakpointLocation.cpp
@@ -179,7 +179,7 @@ const char *SBBreakpointLocation::GetCondition() {
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetConditionText();
}
- return NULL;
+ return nullptr;
}
void SBBreakpointLocation::SetAutoContinue(bool auto_continue) {
@@ -357,7 +357,7 @@ const char *SBBreakpointLocation::GetThreadName() const {
loc_sp->GetTarget().GetAPIMutex());
return loc_sp->GetThreadName();
}
- return NULL;
+ return nullptr;
}
void SBBreakpointLocation::SetQueueName(const char *queue_name) {
@@ -382,7 +382,7 @@ const char *SBBreakpointLocation::GetQueueName() const {
loc_sp->GetTarget().GetAPIMutex());
loc_sp->GetQueueName();
}
- return NULL;
+ return nullptr;
}
bool SBBreakpointLocation::IsResolved() {
diff --git a/lldb/source/API/SBBroadcaster.cpp b/lldb/source/API/SBBroadcaster.cpp
index 4119fb2c134..e1efdf7baf6 100644
--- a/lldb/source/API/SBBroadcaster.cpp
+++ b/lldb/source/API/SBBroadcaster.cpp
@@ -16,20 +16,19 @@
using namespace lldb;
using namespace lldb_private;
-SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(NULL) {
+SBBroadcaster::SBBroadcaster() : m_opaque_sp(), m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBBroadcaster);
}
SBBroadcaster::SBBroadcaster(const char *name)
- : m_opaque_sp(new Broadcaster(NULL, name)), m_opaque_ptr(NULL) {
+ : m_opaque_sp(new Broadcaster(nullptr, name)), m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR(SBBroadcaster, (const char *), name);
m_opaque_ptr = m_opaque_sp.get();
}
SBBroadcaster::SBBroadcaster(lldb_private::Broadcaster *broadcaster, bool owns)
- : m_opaque_sp(owns ? broadcaster : NULL), m_opaque_ptr(broadcaster) {
-}
+ : m_opaque_sp(owns ? broadcaster : nullptr), m_opaque_ptr(broadcaster) {}
SBBroadcaster::SBBroadcaster(const SBBroadcaster &rhs)
: m_opaque_sp(rhs.m_opaque_sp), m_opaque_ptr(rhs.m_opaque_ptr) {
@@ -48,13 +47,13 @@ const SBBroadcaster &SBBroadcaster::operator=(const SBBroadcaster &rhs) {
return LLDB_RECORD_RESULT(*this);
}
-SBBroadcaster::~SBBroadcaster() { reset(NULL, false); }
+SBBroadcaster::~SBBroadcaster() { reset(nullptr, false); }
void SBBroadcaster::BroadcastEventByType(uint32_t event_type, bool unique) {
LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEventByType,
(uint32_t, bool), event_type, unique);
- if (m_opaque_ptr == NULL)
+ if (m_opaque_ptr == nullptr)
return;
if (unique)
@@ -67,7 +66,7 @@ void SBBroadcaster::BroadcastEvent(const SBEvent &event, bool unique) {
LLDB_RECORD_METHOD(void, SBBroadcaster, BroadcastEvent,
(const lldb::SBEvent &, bool), event, unique);
- if (m_opaque_ptr == NULL)
+ if (m_opaque_ptr == nullptr)
return;
EventSP event_sp = event.GetSP();
@@ -104,7 +103,7 @@ const char *SBBroadcaster::GetName() const {
if (m_opaque_ptr)
return m_opaque_ptr->GetBroadcasterName().GetCString();
- return NULL;
+ return nullptr;
}
bool SBBroadcaster::EventTypeHasListeners(uint32_t event_type) {
@@ -144,14 +143,14 @@ bool SBBroadcaster::IsValid() const {
SBBroadcaster::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBroadcaster, operator bool);
- return m_opaque_ptr != NULL;
+ return m_opaque_ptr != nullptr;
}
void SBBroadcaster::Clear() {
LLDB_RECORD_METHOD_NO_ARGS(void, SBBroadcaster, Clear);
m_opaque_sp.reset();
- m_opaque_ptr = NULL;
+ m_opaque_ptr = nullptr;
}
bool SBBroadcaster::operator==(const SBBroadcaster &rhs) const {
diff --git a/lldb/source/API/SBCommunication.cpp b/lldb/source/API/SBCommunication.cpp
index 21bcde12cb3..90df70bde72 100644
--- a/lldb/source/API/SBCommunication.cpp
+++ b/lldb/source/API/SBCommunication.cpp
@@ -16,7 +16,7 @@
using namespace lldb;
using namespace lldb_private;
-SBCommunication::SBCommunication() : m_opaque(NULL), m_opaque_owned(false) {
+SBCommunication::SBCommunication() : m_opaque(nullptr), m_opaque_owned(false) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCommunication);
}
@@ -28,7 +28,7 @@ SBCommunication::SBCommunication(const char *broadcaster_name)
SBCommunication::~SBCommunication() {
if (m_opaque && m_opaque_owned)
delete m_opaque;
- m_opaque = NULL;
+ m_opaque = nullptr;
m_opaque_owned = false;
}
@@ -39,7 +39,7 @@ bool SBCommunication::IsValid() const {
SBCommunication::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommunication, operator bool);
- return m_opaque != NULL;
+ return m_opaque != nullptr;
}
bool SBCommunication::GetCloseOnEOF() {
@@ -64,7 +64,7 @@ ConnectionStatus SBCommunication::Connect(const char *url) {
if (m_opaque) {
if (!m_opaque->HasConnection())
m_opaque->SetConnection(Host::CreateDefaultConnection(url).release());
- return m_opaque->Connect(url, NULL);
+ return m_opaque->Connect(url, nullptr);
}
return eConnectionStatusNoConnection;
}
@@ -115,7 +115,7 @@ size_t SBCommunication::Read(void *dst, size_t dst_len, uint32_t timeout_usec,
? Timeout<std::micro>(llvm::None)
: std::chrono::microseconds(timeout_usec);
if (m_opaque)
- bytes_read = m_opaque->Read(dst, dst_len, timeout, status, NULL);
+ bytes_read = m_opaque->Read(dst, dst_len, timeout, status, nullptr);
else
status = eConnectionStatusNoConnection;
@@ -130,7 +130,7 @@ size_t SBCommunication::Write(const void *src, size_t src_len,
size_t bytes_written = 0;
if (m_opaque)
- bytes_written = m_opaque->Write(src, src_len, status, NULL);
+ bytes_written = m_opaque->Write(src, src_len, status, nullptr);
else
status = eConnectionStatusNoConnection;
diff --git a/lldb/source/API/SBCompileUnit.cpp b/lldb/source/API/SBCompileUnit.cpp
index b5bac6bf7d1..48b501043e1 100644
--- a/lldb/source/API/SBCompileUnit.cpp
+++ b/lldb/source/API/SBCompileUnit.cpp
@@ -20,7 +20,7 @@
using namespace lldb;
using namespace lldb_private;
-SBCompileUnit::SBCompileUnit() : m_opaque_ptr(NULL) {
+SBCompileUnit::SBCompileUnit() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCompileUnit);
}
@@ -41,7 +41,7 @@ const SBCompileUnit &SBCompileUnit::operator=(const SBCompileUnit &rhs) {
return LLDB_RECORD_RESULT(*this);
}
-SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = NULL; }
+SBCompileUnit::~SBCompileUnit() { m_opaque_ptr = nullptr; }
SBFileSpec SBCompileUnit::GetFileSpec() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBFileSpec, SBCompileUnit,
@@ -108,8 +108,8 @@ uint32_t SBCompileUnit::FindLineEntryIndex(uint32_t start_idx, uint32_t line,
file_spec = *m_opaque_ptr;
index = m_opaque_ptr->FindLineEntry(
- start_idx, line, inline_file_spec ? inline_file_spec->get() : NULL,
- exact, NULL);
+ start_idx, line, inline_file_spec ? inline_file_spec->get() : nullptr,
+ exact, nullptr);
}
return index;
@@ -193,7 +193,7 @@ bool SBCompileUnit::IsValid() const {
SBCompileUnit::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCompileUnit, operator bool);
- return m_opaque_ptr != NULL;
+ return m_opaque_ptr != nullptr;
}
bool SBCompileUnit::operator==(const SBCompileUnit &rhs) const {
diff --git a/lldb/source/API/SBData.cpp b/lldb/source/API/SBData.cpp
index d9e54d54a18..528cd8d43ec 100644
--- a/lldb/source/API/SBData.cpp
+++ b/lldb/source/API/SBData.cpp
@@ -64,7 +64,7 @@ bool SBData::IsValid() {
SBData::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBData, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
uint8_t SBData::GetAddressByteSize() {
@@ -312,13 +312,13 @@ const char *SBData::GetString(lldb::SBError &error, lldb::offset_t offset) {
LLDB_RECORD_METHOD(const char *, SBData, GetString,
(lldb::SBError &, lldb::offset_t), error, offset);
- const char *value = 0;
+ const char *value = nullptr;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
} else {
uint32_t old_offset = offset;
value = m_opaque_sp->GetCStr(&offset);
- if (offset == old_offset || (value == NULL))
+ if (offset == old_offset || (value == nullptr))
error.SetErrorString("unable to read data");
}
return value;
@@ -346,13 +346,13 @@ size_t SBData::ReadRawData(lldb::SBError &error, lldb::offset_t offset,
(lldb::SBError &, lldb::offset_t, void *, size_t), error,
offset, buf, size);
- void *ok = NULL;
+ void *ok = nullptr;
if (!m_opaque_sp.get()) {
error.SetErrorString("no value to read from");
} else {
uint32_t old_offset = offset;
ok = m_opaque_sp->GetU8(&offset, buf, size);
- if ((offset == old_offset) || (ok == NULL))
+ if ((offset == old_offset) || (ok == nullptr))
error.SetErrorString("unable to read data");
}
return ok ? size : 0;
diff --git a/lldb/source/API/SBDeclaration.cpp b/lldb/source/API/SBDeclaration.cpp
index f14ca3993f4..a7790b29398 100644
--- a/lldb/source/API/SBDeclaration.cpp
+++ b/lldb/source/API/SBDeclaration.cpp
@@ -147,7 +147,7 @@ const lldb_private::Declaration *SBDeclaration::operator->() const {
}
lldb_private::Declaration &SBDeclaration::ref() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new lldb_private::Declaration());
return *m_opaque_up;
}
diff --git a/lldb/source/API/SBError.cpp b/lldb/source/API/SBError.cpp
index c4627898282..7256e8e55de 100644
--- a/lldb/source/API/SBError.cpp
+++ b/lldb/source/API/SBError.cpp
@@ -41,7 +41,7 @@ const char *SBError::GetCString() const {
if (m_opaque_up)
return m_opaque_up->AsCString();
- return NULL;
+ return nullptr;
}
void SBError::Clear() {
@@ -144,11 +144,11 @@ bool SBError::IsValid() const {
SBError::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBError, operator bool);
- return m_opaque_up != NULL;
+ return m_opaque_up != nullptr;
}
void SBError::CreateIfNeeded() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new Status());
}
@@ -175,7 +175,8 @@ bool SBError::GetDescription(SBStream &description) {
description.Printf("success");
else {
const char *err_string = GetCString();
- description.Printf("error: %s", (err_string != NULL ? err_string : ""));
+ description.Printf("error: %s",
+ (err_string != nullptr ? err_string : ""));
}
} else
description.Printf("error: <NULL>");
diff --git a/lldb/source/API/SBEvent.cpp b/lldb/source/API/SBEvent.cpp
index b63108ec1fc..75ca2830df9 100644
--- a/lldb/source/API/SBEvent.cpp
+++ b/lldb/source/API/SBEvent.cpp
@@ -22,7 +22,7 @@
using namespace lldb;
using namespace lldb_private;
-SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(NULL) {
+SBEvent::SBEvent() : m_event_sp(), m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBEvent);
}
@@ -69,7 +69,7 @@ const char *SBEvent::GetDataFlavor() {
if (event_data)
return lldb_event->GetData()->GetFlavor().AsCString();
}
- return NULL;
+ return nullptr;
}
uint32_t SBEvent::GetType() const {
@@ -168,7 +168,7 @@ SBEvent::operator bool() const {
// Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get() accessor.
// See comments in SBEvent::get()....
- return SBEvent::get() != NULL;
+ return SBEvent::get() != nullptr;
}
const char *SBEvent::GetCStringFromEvent(const SBEvent &event) {
diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp
index 35ddb1c7cd6..1770bede2f4 100644
--- a/lldb/source/API/SBFunction.cpp
+++ b/lldb/source/API/SBFunction.cpp
@@ -22,7 +22,7 @@
using namespace lldb;
using namespace lldb_private;
-SBFunction::SBFunction() : m_opaque_ptr(NULL) {
+SBFunction::SBFunction() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBFunction);
}
@@ -42,7 +42,7 @@ const SBFunction &SBFunction::operator=(const SBFunction &rhs) {
return LLDB_RECORD_RESULT(*this);
}
-SBFunction::~SBFunction() { m_opaque_ptr = NULL; }
+SBFunction::~SBFunction() { m_opaque_ptr = nullptr; }
bool SBFunction::IsValid() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFunction, IsValid);
@@ -51,13 +51,13 @@ bool SBFunction::IsValid() const {
SBFunction::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBFunction, operator bool);
- return m_opaque_ptr != NULL;
+ return m_opaque_ptr != nullptr;
}
const char *SBFunction::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetName);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetName().AsCString();
@@ -67,7 +67,7 @@ const char *SBFunction::GetName() const {
const char *SBFunction::GetDisplayName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetDisplayName);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetMangled()
.GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
@@ -79,7 +79,7 @@ const char *SBFunction::GetDisplayName() const {
const char *SBFunction::GetMangledName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBFunction, GetMangledName);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
if (m_opaque_ptr)
cstr = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
return cstr;
@@ -118,7 +118,7 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target) {
LLDB_RECORD_METHOD(lldb::SBInstructionList, SBFunction, GetInstructions,
(lldb::SBTarget), target);
- return LLDB_RECORD_RESULT(GetInstructions(target, NULL));
+ return LLDB_RECORD_RESULT(GetInstructions(target, nullptr));
}
SBInstructionList SBFunction::GetInstructions(SBTarget target,
@@ -141,7 +141,7 @@ SBInstructionList SBFunction::GetInstructions(SBTarget target,
if (module_sp) {
const bool prefer_file_cache = false;
sb_instructions.SetDisassembler(Disassembler::DisassembleRange(
- module_sp->GetArchitecture(), NULL, flavor, exe_ctx,
+ module_sp->GetArchitecture(), nullptr, flavor, exe_ctx,
m_opaque_ptr->GetAddressRange(), prefer_file_cache));
}
}
diff --git a/lldb/source/API/SBHostOS.cpp b/lldb/source/API/SBHostOS.cpp
index b8aa94d97a1..b5464c4e7df 100644
--- a/lldb/source/API/SBHostOS.cpp
+++ b/lldb/source/API/SBHostOS.cpp
@@ -107,8 +107,9 @@ lldb::thread_t SBHostOS::ThreadCreate(const char *name,
LLDB_RECORD_DUMMY(lldb::thread_t, SBHostOS, ThreadCreate,
(lldb::thread_func_t, void *, SBError *), name,
thread_function, thread_arg, error_ptr);
- HostThread thread(ThreadLauncher::LaunchThread(
- name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL));
+ HostThread thread(
+ ThreadLauncher::LaunchThread(name, thread_function, thread_arg,
+ error_ptr ? error_ptr->get() : nullptr));
return thread.Release();
}
diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp
index 8502aad9dbb..fcf66fd2582 100644
--- a/lldb/source/API/SBInstruction.cpp
+++ b/lldb/source/API/SBInstruction.cpp
@@ -127,7 +127,7 @@ const char *SBInstruction::GetMnemonic(SBTarget target) {
}
return inst_sp->GetMnemonic(&exe_ctx);
}
- return NULL;
+ return nullptr;
}
const char *SBInstruction::GetOperands(SBTarget target) {
@@ -147,7 +147,7 @@ const char *SBInstruction::GetOperands(SBTarget target) {
}
return inst_sp->GetOperands(&exe_ctx);
}
- return NULL;
+ return nullptr;
}
const char *SBInstruction::GetComment(SBTarget target) {
@@ -167,7 +167,7 @@ const char *SBInstruction::GetComment(SBTarget target) {
}
return inst_sp->GetComment(&exe_ctx);
}
- return NULL;
+ return nullptr;
}
size_t SBInstruction::GetByteSize() {
@@ -249,7 +249,7 @@ bool SBInstruction::GetDescription(lldb::SBStream &s) {
// didn't have a stream already created, one will get created...
FormatEntity::Entry format;
FormatEntity::Parse("${addr}: ", format);
- inst_sp->Dump(&s.ref(), 0, true, false, NULL, &sc, NULL, &format, 0);
+ inst_sp->Dump(&s.ref(), 0, true, false, nullptr, &sc, nullptr, &format, 0);
return true;
}
return false;
@@ -258,7 +258,7 @@ bool SBInstruction::GetDescription(lldb::SBStream &s) {
void SBInstruction::Print(FILE *out) {
LLDB_RECORD_METHOD(void, SBInstruction, Print, (FILE *), out);
- if (out == NULL)
+ if (out == nullptr)
return;
lldb::InstructionSP inst_sp(GetOpaque());
@@ -272,7 +272,8 @@ void SBInstruction::Print(FILE *out) {
StreamFile out_stream(out, false);
FormatEntity::Entry format;
FormatEntity::Parse("${addr}: ", format);
- inst_sp->Dump(&out_stream, 0, true, false, NULL, &sc, NULL, &format, 0);
+ inst_sp->Dump(&out_stream, 0, true, false, nullptr, &sc, nullptr, &format,
+ 0);
}
}
diff --git a/lldb/source/API/SBInstructionList.cpp b/lldb/source/API/SBInstructionList.cpp
index 390ad475061..cce923bf04a 100644
--- a/lldb/source/API/SBInstructionList.cpp
+++ b/lldb/source/API/SBInstructionList.cpp
@@ -49,7 +49,7 @@ bool SBInstructionList::IsValid() const {
SBInstructionList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBInstructionList, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
size_t SBInstructionList::GetSize() {
@@ -119,7 +119,7 @@ void SBInstructionList::SetDisassembler(const lldb::DisassemblerSP &opaque_sp) {
void SBInstructionList::Print(FILE *out) {
LLDB_RECORD_METHOD(void, SBInstructionList, Print, (FILE *), out);
- if (out == NULL)
+ if (out == nullptr)
return;
}
@@ -142,7 +142,7 @@ bool SBInstructionList::GetDescription(lldb::SBStream &description) {
for (size_t i = 0; i < num_instructions; ++i) {
Instruction *inst =
m_opaque_sp->GetInstructionList().GetInstructionAtIndex(i).get();
- if (inst == NULL)
+ if (inst == nullptr)
break;
const Address &addr = inst->GetAddress();
@@ -153,7 +153,7 @@ bool SBInstructionList::GetDescription(lldb::SBStream &description) {
addr, eSymbolContextEverything, sc);
}
- inst->Dump(&sref, max_opcode_byte_size, true, false, NULL, &sc,
+ inst->Dump(&sref, max_opcode_byte_size, true, false, nullptr, &sc,
&prev_sc, &format, 0);
sref.EOL();
}
diff --git a/lldb/source/API/SBLineEntry.cpp b/lldb/source/API/SBLineEntry.cpp
index b7aac0be935..010a6057cd3 100644
--- a/lldb/source/API/SBLineEntry.cpp
+++ b/lldb/source/API/SBLineEntry.cpp
@@ -162,7 +162,7 @@ const lldb_private::LineEntry *SBLineEntry::operator->() const {
}
lldb_private::LineEntry &SBLineEntry::ref() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new lldb_private::LineEntry());
return *m_opaque_up;
}
diff --git a/lldb/source/API/SBListener.cpp b/lldb/source/API/SBListener.cpp
index 5eb5abd8028..4fe90f6f686 100644
--- a/lldb/source/API/SBListener.cpp
+++ b/lldb/source/API/SBListener.cpp
@@ -20,7 +20,7 @@
using namespace lldb;
using namespace lldb_private;
-SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(NULL) {
+SBListener::SBListener() : m_opaque_sp(), m_unused_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBListener);
}
@@ -160,7 +160,7 @@ bool SBListener::WaitForEvent(uint32_t timeout_secs, SBEvent &event) {
}
if (!success)
- event.reset(NULL);
+ event.reset(nullptr);
return success;
}
@@ -182,7 +182,7 @@ bool SBListener::WaitForEventForBroadcaster(uint32_t num_seconds,
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
@@ -205,7 +205,7 @@ bool SBListener::WaitForEventForBroadcasterWithType(
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
@@ -217,7 +217,7 @@ bool SBListener::PeekAtNextEvent(SBEvent &event) {
event.reset(m_opaque_sp->PeekAtNextEvent());
return event.IsValid();
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
@@ -231,7 +231,7 @@ bool SBListener::PeekAtNextEventForBroadcaster(const SBBroadcaster &broadcaster,
event.reset(m_opaque_sp->PeekAtNextEventForBroadcaster(broadcaster.get()));
return event.IsValid();
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
@@ -247,7 +247,7 @@ bool SBListener::PeekAtNextEventForBroadcasterWithType(
broadcaster.get(), event_type_mask));
return event.IsValid();
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
@@ -261,7 +261,7 @@ bool SBListener::GetNextEvent(SBEvent &event) {
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
@@ -279,7 +279,7 @@ bool SBListener::GetNextEventForBroadcaster(const SBBroadcaster &broadcaster,
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
@@ -299,7 +299,7 @@ bool SBListener::GetNextEventForBroadcasterWithType(
return true;
}
}
- event.reset(NULL);
+ event.reset(nullptr);
return false;
}
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index a22d7ca2989..4bd32bce1c5 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -40,8 +40,8 @@ SBModule::SBModule(const SBModuleSpec &module_spec) : m_opaque_sp() {
LLDB_RECORD_CONSTRUCTOR(SBModule, (const lldb::SBModuleSpec &), module_spec);
ModuleSP module_sp;
- Status error = ModuleList::GetSharedModule(*module_spec.m_opaque_up,
- module_sp, NULL, NULL, NULL);
+ Status error = ModuleList::GetSharedModule(
+ *module_spec.m_opaque_up, module_sp, nullptr, nullptr, nullptr);
if (module_sp)
SetSP(module_sp);
}
@@ -85,7 +85,7 @@ bool SBModule::IsValid() const {
SBModule::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBModule, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
void SBModule::Clear() {
@@ -159,7 +159,7 @@ bool SBModule::SetRemoteInstallFileSpec(lldb::SBFileSpec &file) {
const uint8_t *SBModule::GetUUIDBytes() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const uint8_t *, SBModule, GetUUIDBytes);
- const uint8_t *uuid_bytes = NULL;
+ const uint8_t *uuid_bytes = nullptr;
ModuleSP module_sp(GetSP());
if (module_sp)
uuid_bytes = module_sp->GetUUID().GetBytes().data();
@@ -170,8 +170,7 @@ const uint8_t *SBModule::GetUUIDBytes() const {
const char *SBModule::GetUUIDString() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBModule, GetUUIDString);
-
- const char *uuid_cstr = NULL;
+ const char *uuid_cstr = nullptr;
ModuleSP module_sp(GetSP());
if (module_sp) {
// We are going to return a "const char *" value through the public API, so
@@ -185,7 +184,7 @@ const char *SBModule::GetUUIDString() const {
return uuid_cstr;
}
- return NULL;
+ return nullptr;
}
bool SBModule::operator==(const SBModule &rhs) const {
@@ -296,7 +295,7 @@ static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
if (symbols)
return symbols->GetSymtab();
}
- return NULL;
+ return nullptr;
}
size_t SBModule::GetNumSymbols() {
@@ -410,7 +409,7 @@ lldb::SBSymbolContextList SBModule::FindFunctions(const char *name,
const bool symbols_ok = true;
const bool inlines_ok = true;
FunctionNameType type = static_cast<FunctionNameType>(name_type_mask);
- module_sp->FindFunctions(ConstString(name), NULL, type, symbols_ok,
+ module_sp->FindFunctions(ConstString(name), nullptr, type, symbols_ok,
inlines_ok, append, *sb_sc_list);
}
return LLDB_RECORD_RESULT(sb_sc_list);
@@ -427,7 +426,7 @@ SBValueList SBModule::FindGlobalVariables(SBTarget &target, const char *name,
if (name && module_sp) {
VariableList variable_list;
const uint32_t match_count = module_sp->FindGlobalVariables(
- ConstString(name), NULL, max_matches, variable_list);
+ ConstString(name), nullptr, max_matches, variable_list);
if (match_count > 0) {
for (uint32_t i = 0; i < match_count; ++i) {
@@ -558,7 +557,7 @@ lldb::SBTypeList SBModule::GetTypes(uint32_t type_mask) {
TypeClass type_class = static_cast<TypeClass>(type_mask);
TypeList type_list;
- vendor->GetTypes(NULL, type_class, type_list);
+ vendor->GetTypes(nullptr, type_class, type_list);
sb_type_list.m_opaque_up->Append(type_list);
return LLDB_RECORD_RESULT(sb_type_list);
}
@@ -606,7 +605,7 @@ const char *SBModule::GetTriple() {
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
- return NULL;
+ return nullptr;
}
uint32_t SBModule::GetAddressByteSize() {
diff --git a/lldb/source/API/SBPlatform.cpp b/lldb/source/API/SBPlatform.cpp
index 235c37a8101..f3708d8e084 100644
--- a/lldb/source/API/SBPlatform.cpp
+++ b/lldb/source/API/SBPlatform.cpp
@@ -28,7 +28,7 @@ using namespace lldb_private;
// PlatformConnectOptions
struct PlatformConnectOptions {
- PlatformConnectOptions(const char *url = NULL)
+ PlatformConnectOptions(const char *url = nullptr)
: m_url(), m_rsync_options(), m_rsync_remote_path_prefix(),
m_rsync_enabled(false), m_rsync_omit_hostname_from_remote_path(false),
m_local_cache_directory() {
@@ -48,7 +48,7 @@ struct PlatformConnectOptions {
// PlatformShellCommand
struct PlatformShellCommand {
- PlatformShellCommand(const char *shell_command = NULL)
+ PlatformShellCommand(const char *shell_command = nullptr)
: m_command(), m_working_dir(), m_status(0), m_signo(0) {
if (shell_command && shell_command[0])
m_command = shell_command;
@@ -94,7 +94,7 @@ const char *SBPlatformConnectOptions::GetURL() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformConnectOptions, GetURL);
if (m_opaque_ptr->m_url.empty())
- return NULL;
+ return nullptr;
return m_opaque_ptr->m_url.c_str();
}
@@ -188,7 +188,7 @@ const char *SBPlatformShellCommand::GetCommand() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetCommand);
if (m_opaque_ptr->m_command.empty())
- return NULL;
+ return nullptr;
return m_opaque_ptr->m_command.c_str();
}
@@ -207,7 +207,7 @@ const char *SBPlatformShellCommand::GetWorkingDirectory() {
GetWorkingDirectory);
if (m_opaque_ptr->m_working_dir.empty())
- return NULL;
+ return nullptr;
return m_opaque_ptr->m_working_dir.c_str();
}
@@ -256,7 +256,7 @@ const char *SBPlatformShellCommand::GetOutput() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBPlatformShellCommand, GetOutput);
if (m_opaque_ptr->m_output.empty())
- return NULL;
+ return nullptr;
return m_opaque_ptr->m_output.c_str();
}
@@ -282,7 +282,7 @@ bool SBPlatform::IsValid() const {
SBPlatform::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBPlatform, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
void SBPlatform::Clear() {
@@ -297,7 +297,7 @@ const char *SBPlatform::GetName() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetName().GetCString();
- return NULL;
+ return nullptr;
}
lldb::PlatformSP SBPlatform::GetSP() const { return m_opaque_sp; }
@@ -312,7 +312,7 @@ const char *SBPlatform::GetWorkingDirectory() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetWorkingDirectory().GetCString();
- return NULL;
+ return nullptr;
}
bool SBPlatform::SetWorkingDirectory(const char *path) {
@@ -376,7 +376,7 @@ const char *SBPlatform::GetTriple() {
return ConstString(arch.GetTriple().getTriple().c_str()).GetCString();
}
}
- return NULL;
+ return nullptr;
}
const char *SBPlatform::GetOSBuild() {
@@ -393,7 +393,7 @@ const char *SBPlatform::GetOSBuild() {
}
}
}
- return NULL;
+ return nullptr;
}
const char *SBPlatform::GetOSDescription() {
@@ -410,7 +410,7 @@ const char *SBPlatform::GetOSDescription() {
}
}
}
- return NULL;
+ return nullptr;
}
const char *SBPlatform::GetHostname() {
@@ -419,7 +419,7 @@ const char *SBPlatform::GetHostname() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
return platform_sp->GetHostname();
- return NULL;
+ return nullptr;
}
uint32_t SBPlatform::GetOSMajorVersion() {
@@ -513,7 +513,7 @@ SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) {
return Status("invalid shell command (empty)");
const char *working_dir = shell_command.GetWorkingDirectory();
- if (working_dir == NULL) {
+ if (working_dir == nullptr) {
working_dir = platform_sp->GetWorkingDirectory().GetCString();
if (working_dir)
shell_command.SetWorkingDirectory(working_dir);
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index d97494b38c7..4226ff77ecd 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -335,7 +335,7 @@ void SBProcess::ReportEventState(const SBEvent &event, FILE *out) const {
LLDB_RECORD_METHOD_CONST(void, SBProcess, ReportEventState,
(const lldb::SBEvent &, FILE *), event, out);
- if (out == NULL)
+ if (out == nullptr)
return;
ProcessSP process_sp(GetSP());
@@ -534,7 +534,7 @@ int SBProcess::GetExitStatus() {
const char *SBProcess::GetExitDescription() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBProcess, GetExitDescription);
- const char *exit_desc = NULL;
+ const char *exit_desc = nullptr;
ProcessSP process_sp(GetSP());
if (process_sp) {
std::lock_guard<std::recursive_mutex> guard(
@@ -602,7 +602,7 @@ SBError SBProcess::Continue() {
if (process_sp->GetTarget().GetDebugger().GetAsyncExecution())
sb_error.ref() = process_sp->Resume();
else
- sb_error.ref() = process_sp->ResumeSynchronous(NULL);
+ sb_error.ref() = process_sp->ResumeSynchronous(nullptr);
} else
sb_error.SetErrorString("SBProcess is invalid");
@@ -985,7 +985,7 @@ bool SBProcess::GetDescription(SBStream &description) {
char path[PATH_MAX];
GetTarget().GetExecutable().GetPath(path, sizeof(path));
Module *exe_module = process_sp->GetTarget().GetExecutableModulePointer();
- const char *exe_name = NULL;
+ const char *exe_name = nullptr;
if (exe_module)
exe_name = exe_module->GetFileSpec().GetFilename().AsCString();
@@ -1156,7 +1156,7 @@ const char *SBProcess::GetExtendedBacktraceTypeAtIndex(uint32_t idx) {
return names[idx].AsCString();
}
}
- return NULL;
+ return nullptr;
}
SBThreadCollection SBProcess::GetHistoryThreads(addr_t addr) {
diff --git a/lldb/source/API/SBQueue.cpp b/lldb/source/API/SBQueue.cpp
index 465bbac9387..7d1581c42f6 100644
--- a/lldb/source/API/SBQueue.cpp
+++ b/lldb/source/API/SBQueue.cpp
@@ -49,7 +49,7 @@ public:
~QueueImpl() {}
- bool IsValid() { return m_queue_wp.lock() != NULL; }
+ bool IsValid() { return m_queue_wp.lock() != nullptr; }
void Clear() {
m_queue_wp.reset();
@@ -83,7 +83,7 @@ public:
}
const char *GetName() const {
- const char *name = NULL;
+ const char *name = nullptr;
lldb::QueueSP queue_sp = m_queue_wp.lock();
if (queue_sp.get()) {
name = queue_sp->GetName();
diff --git a/lldb/source/API/SBQueueItem.cpp b/lldb/source/API/SBQueueItem.cpp
index edb258029d1..5f2cbd1bdbf 100644
--- a/lldb/source/API/SBQueueItem.cpp
+++ b/lldb/source/API/SBQueueItem.cpp
@@ -41,7 +41,7 @@ bool SBQueueItem::IsValid() const {
SBQueueItem::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBQueueItem, operator bool);
- return m_queue_item_sp.get() != NULL;
+ return m_queue_item_sp.get() != nullptr;
}
void SBQueueItem::Clear() {
diff --git a/lldb/source/API/SBSection.cpp b/lldb/source/API/SBSection.cpp
index f47a799697d..14e1e14f59a 100644
--- a/lldb/source/API/SBSection.cpp
+++ b/lldb/source/API/SBSection.cpp
@@ -54,7 +54,7 @@ SBSection::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSection, operator bool);
SectionSP section_sp(GetSP());
- return section_sp && section_sp->GetModule().get() != NULL;
+ return section_sp && section_sp->GetModule().get() != nullptr;
}
const char *SBSection::GetName() {
@@ -63,7 +63,7 @@ const char *SBSection::GetName() {
SectionSP section_sp(GetSP());
if (section_sp)
return section_sp->GetName().GetCString();
- return NULL;
+ return nullptr;
}
lldb::SBSection SBSection::GetParent() {
diff --git a/lldb/source/API/SBSourceManager.cpp b/lldb/source/API/SBSourceManager.cpp
index 785f3090777..9c4ce3c7f4e 100644
--- a/lldb/source/API/SBSourceManager.cpp
+++ b/lldb/source/API/SBSourceManager.cpp
@@ -131,7 +131,7 @@ size_t SBSourceManager::DisplaySourceLinesWithLineNumbersAndColumn(
const char *, lldb::SBStream &),
file, line, column, context_before, context_after, current_line_cstr, s);
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
return 0;
return m_opaque_up->DisplaySourceLinesWithLineNumbers(
diff --git a/lldb/source/API/SBStream.cpp b/lldb/source/API/SBStream.cpp
index 2f149a24d13..ae652338e1e 100644
--- a/lldb/source/API/SBStream.cpp
+++ b/lldb/source/API/SBStream.cpp
@@ -34,7 +34,7 @@ bool SBStream::IsValid() const {
SBStream::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBStream, operator bool);
- return (m_opaque_up != NULL);
+ return (m_opaque_up != nullptr);
}
// If this stream is not redirected to a file, it will maintain a local cache
@@ -42,8 +42,8 @@ SBStream::operator bool() const {
const char *SBStream::GetData() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBStream, GetData);
- if (m_is_file || m_opaque_up == NULL)
- return NULL;
+ if (m_is_file || m_opaque_up == nullptr)
+ return nullptr;
return static_cast<StreamString *>(m_opaque_up.get())->GetData();
}
@@ -53,7 +53,7 @@ const char *SBStream::GetData() {
size_t SBStream::GetSize() {
LLDB_RECORD_METHOD_NO_ARGS(size_t, SBStream, GetSize);
- if (m_is_file || m_opaque_up == NULL)
+ if (m_is_file || m_opaque_up == nullptr)
return 0;
return static_cast<StreamString *>(m_opaque_up.get())->GetSize();
@@ -160,7 +160,7 @@ lldb_private::Stream *SBStream::operator->() { return m_opaque_up.get(); }
lldb_private::Stream *SBStream::get() { return m_opaque_up.get(); }
lldb_private::Stream &SBStream::ref() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new StreamString());
return *m_opaque_up;
}
diff --git a/lldb/source/API/SBStringList.cpp b/lldb/source/API/SBStringList.cpp
index b08f232389c..2f8bd55855a 100644
--- a/lldb/source/API/SBStringList.cpp
+++ b/lldb/source/API/SBStringList.cpp
@@ -56,13 +56,13 @@ bool SBStringList::IsValid() const {
SBStringList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBStringList, operator bool);
- return (m_opaque_up != NULL);
+ return (m_opaque_up != nullptr);
}
void SBStringList::AppendString(const char *str) {
LLDB_RECORD_METHOD(void, SBStringList, AppendString, (const char *), str);
- if (str != NULL) {
+ if (str != nullptr) {
if (IsValid())
m_opaque_up->AppendString(str);
else
@@ -74,7 +74,7 @@ void SBStringList::AppendList(const char **strv, int strc) {
LLDB_RECORD_METHOD(void, SBStringList, AppendList, (const char **, int), strv,
strc);
- if ((strv != NULL) && (strc > 0)) {
+ if ((strv != nullptr) && (strc > 0)) {
if (IsValid())
m_opaque_up->AppendList(strv, strc);
else
@@ -115,7 +115,7 @@ const char *SBStringList::GetStringAtIndex(size_t idx) {
if (IsValid()) {
return m_opaque_up->GetStringAtIndex(idx);
}
- return NULL;
+ return nullptr;
}
const char *SBStringList::GetStringAtIndex(size_t idx) const {
@@ -125,7 +125,7 @@ const char *SBStringList::GetStringAtIndex(size_t idx) const {
if (IsValid()) {
return m_opaque_up->GetStringAtIndex(idx);
}
- return NULL;
+ return nullptr;
}
void SBStringList::Clear() {
diff --git a/lldb/source/API/SBSymbol.cpp b/lldb/source/API/SBSymbol.cpp
index a3c5acf3941..6cc90e0ee36 100644
--- a/lldb/source/API/SBSymbol.cpp
+++ b/lldb/source/API/SBSymbol.cpp
@@ -18,7 +18,7 @@
using namespace lldb;
using namespace lldb_private;
-SBSymbol::SBSymbol() : m_opaque_ptr(NULL) {
+SBSymbol::SBSymbol() : m_opaque_ptr(nullptr) {
LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBSymbol);
}
@@ -37,7 +37,7 @@ const SBSymbol &SBSymbol::operator=(const SBSymbol &rhs) {
return LLDB_RECORD_RESULT(*this);
}
-SBSymbol::~SBSymbol() { m_opaque_ptr = NULL; }
+SBSymbol::~SBSymbol() { m_opaque_ptr = nullptr; }
void SBSymbol::SetSymbol(lldb_private::Symbol *lldb_object_ptr) {
m_opaque_ptr = lldb_object_ptr;
@@ -50,13 +50,13 @@ bool SBSymbol::IsValid() const {
SBSymbol::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbol, operator bool);
- return m_opaque_ptr != NULL;
+ return m_opaque_ptr != nullptr;
}
const char *SBSymbol::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetName);
- const char *name = NULL;
+ const char *name = nullptr;
if (m_opaque_ptr)
name = m_opaque_ptr->GetName().AsCString();
@@ -66,7 +66,7 @@ const char *SBSymbol::GetName() const {
const char *SBSymbol::GetDisplayName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetDisplayName);
- const char *name = NULL;
+ const char *name = nullptr;
if (m_opaque_ptr)
name = m_opaque_ptr->GetMangled()
.GetDisplayDemangledName(m_opaque_ptr->GetLanguage())
@@ -78,7 +78,7 @@ const char *SBSymbol::GetDisplayName() const {
const char *SBSymbol::GetMangledName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBSymbol, GetMangledName);
- const char *name = NULL;
+ const char *name = nullptr;
if (m_opaque_ptr)
name = m_opaque_ptr->GetMangled().GetMangledName().AsCString();
return name;
@@ -105,7 +105,7 @@ bool SBSymbol::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_ptr) {
- m_opaque_ptr->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
+ m_opaque_ptr->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr);
} else
strm.PutCString("No value");
@@ -116,7 +116,7 @@ SBInstructionList SBSymbol::GetInstructions(SBTarget target) {
LLDB_RECORD_METHOD(lldb::SBInstructionList, SBSymbol, GetInstructions,
(lldb::SBTarget), target);
- return LLDB_RECORD_RESULT(GetInstructions(target, NULL));
+ return LLDB_RECORD_RESULT(GetInstructions(target, nullptr));
}
SBInstructionList SBSymbol::GetInstructions(SBTarget target,
@@ -141,7 +141,7 @@ SBInstructionList SBSymbol::GetInstructions(SBTarget target,
AddressRange symbol_range(symbol_addr, m_opaque_ptr->GetByteSize());
const bool prefer_file_cache = false;
sb_instructions.SetDisassembler(Disassembler::DisassembleRange(
- module_sp->GetArchitecture(), NULL, flavor_string, exe_ctx,
+ module_sp->GetArchitecture(), nullptr, flavor_string, exe_ctx,
symbol_range, prefer_file_cache));
}
}
diff --git a/lldb/source/API/SBSymbolContext.cpp b/lldb/source/API/SBSymbolContext.cpp
index f8f446ba574..365f0ccc2fb 100644
--- a/lldb/source/API/SBSymbolContext.cpp
+++ b/lldb/source/API/SBSymbolContext.cpp
@@ -63,7 +63,7 @@ bool SBSymbolContext::IsValid() const {
SBSymbolContext::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbolContext, operator bool);
- return m_opaque_up != NULL;
+ return m_opaque_up != nullptr;
}
SBModule SBSymbolContext::GetModule() {
@@ -84,13 +84,13 @@ SBCompileUnit SBSymbolContext::GetCompileUnit() {
GetCompileUnit);
return LLDB_RECORD_RESULT(
- SBCompileUnit(m_opaque_up ? m_opaque_up->comp_unit : NULL));
+ SBCompileUnit(m_opaque_up ? m_opaque_up->comp_unit : nullptr));
}
SBFunction SBSymbolContext::GetFunction() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFunction, SBSymbolContext, GetFunction);
- Function *function = NULL;
+ Function *function = nullptr;
if (m_opaque_up)
function = m_opaque_up->function;
@@ -103,7 +103,8 @@ SBFunction SBSymbolContext::GetFunction() {
SBBlock SBSymbolContext::GetBlock() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBBlock, SBSymbolContext, GetBlock);
- return LLDB_RECORD_RESULT(SBBlock(m_opaque_up ? m_opaque_up->block : NULL));
+ return LLDB_RECORD_RESULT(
+ SBBlock(m_opaque_up ? m_opaque_up->block : nullptr));
}
SBLineEntry SBSymbolContext::GetLineEntry() {
@@ -119,7 +120,7 @@ SBLineEntry SBSymbolContext::GetLineEntry() {
SBSymbol SBSymbolContext::GetSymbol() {
LLDB_RECORD_METHOD_NO_ARGS(lldb::SBSymbol, SBSymbolContext, GetSymbol);
- Symbol *symbol = NULL;
+ Symbol *symbol = nullptr;
if (m_opaque_up)
symbol = m_opaque_up->symbol;
@@ -183,13 +184,13 @@ const lldb_private::SymbolContext &SBSymbolContext::operator*() const {
}
lldb_private::SymbolContext &SBSymbolContext::operator*() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new SymbolContext);
return *m_opaque_up;
}
lldb_private::SymbolContext &SBSymbolContext::ref() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new SymbolContext);
return *m_opaque_up;
}
@@ -205,7 +206,7 @@ bool SBSymbolContext::GetDescription(SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_up) {
- m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
+ m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr);
} else
strm.PutCString("No value");
diff --git a/lldb/source/API/SBSymbolContextList.cpp b/lldb/source/API/SBSymbolContextList.cpp
index 7c9a9dbb871..915d04a0282 100644
--- a/lldb/source/API/SBSymbolContextList.cpp
+++ b/lldb/source/API/SBSymbolContextList.cpp
@@ -93,7 +93,7 @@ bool SBSymbolContextList::IsValid() const {
SBSymbolContextList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBSymbolContextList, operator bool);
- return m_opaque_up != NULL;
+ return m_opaque_up != nullptr;
}
lldb_private::SymbolContextList *SBSymbolContextList::operator->() const {
@@ -111,7 +111,7 @@ bool SBSymbolContextList::GetDescription(lldb::SBStream &description) {
Stream &strm = description.ref();
if (m_opaque_up)
- m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, NULL);
+ m_opaque_up->GetDescription(&strm, lldb::eDescriptionLevelFull, nullptr);
return true;
}
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index ee0897e5950..56d258187ea 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -126,7 +126,7 @@ bool SBTarget::EventIsTargetEvent(const SBEvent &event) {
LLDB_RECORD_STATIC_METHOD(bool, SBTarget, EventIsTargetEvent,
(const lldb::SBEvent &), event);
- return Target::TargetEventData::GetEventDataFromEvent(event.get()) != NULL;
+ return Target::TargetEventData::GetEventDataFromEvent(event.get()) != nullptr;
}
SBTarget SBTarget::GetTargetFromEvent(const SBEvent &event) {
@@ -171,7 +171,7 @@ bool SBTarget::IsValid() const {
SBTarget::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTarget, operator bool);
- return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid();
+ return m_opaque_sp.get() != nullptr && m_opaque_sp->IsValid();
}
SBProcess SBTarget::GetProcess() {
@@ -288,9 +288,9 @@ SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp,
(const char **, const char **, const char *), argv, envp,
working_directory);
- char *stdin_path = NULL;
- char *stdout_path = NULL;
- char *stderr_path = NULL;
+ char *stdin_path = nullptr;
+ char *stdout_path = nullptr;
+ char *stderr_path = nullptr;
uint32_t launch_flags = 0;
bool stop_at_entry = false;
SBError error;
@@ -307,7 +307,7 @@ SBError SBTarget::Install() {
TargetSP target_sp(GetSP());
if (target_sp) {
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
- sb_error.ref() = target_sp->Install(NULL);
+ sb_error.ref() = target_sp->Install(nullptr);
}
return LLDB_RECORD_RESULT(sb_error);
}
@@ -381,7 +381,7 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
if (listener.IsValid())
launch_info.SetListener(listener.GetSP());
- error.SetError(target_sp->Launch(launch_info, NULL));
+ error.SetError(target_sp->Launch(launch_info, nullptr));
sb_process.SetSP(target_sp->GetProcessSP());
} else {
@@ -430,7 +430,7 @@ SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) {
if (arch_spec.IsValid())
launch_info.GetArchitecture() = arch_spec;
- error.SetError(target_sp->Launch(launch_info, NULL));
+ error.SetError(target_sp->Launch(launch_info, nullptr));
sb_launch_info.set_ref(launch_info);
sb_process.SetSP(target_sp->GetProcessSP());
} else {
@@ -551,14 +551,14 @@ lldb::SBProcess SBTarget::ConnectRemote(SBListener &listener, const char *url,
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
if (listener.IsValid())
process_sp =
- target_sp->CreateProcess(listener.m_opaque_sp, plugin_name, NULL);
+ target_sp->CreateProcess(listener.m_opaque_sp, plugin_name, nullptr);
else
process_sp = target_sp->CreateProcess(
- target_sp->GetDebugger().GetListener(), plugin_name, NULL);
+ target_sp->GetDebugger().GetListener(), plugin_name, nullptr);
if (process_sp) {
sb_process.SetSP(process_sp);
- error.SetError(process_sp->ConnectRemote(NULL, url));
+ error.SetError(process_sp->ConnectRemote(nullptr, url));
} else {
error.SetErrorString("unable to create lldb_private::Process");
}
@@ -788,12 +788,12 @@ SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
FileSpecList module_spec_list;
module_spec_list.Append(FileSpec(module_name));
sb_bp = target_sp->CreateBreakpoint(
- &module_spec_list, NULL, symbol_name, eFunctionNameTypeAuto,
+ &module_spec_list, nullptr, symbol_name, eFunctionNameTypeAuto,
eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
} else {
sb_bp = target_sp->CreateBreakpoint(
- NULL, NULL, symbol_name, eFunctionNameTypeAuto, eLanguageTypeUnknown,
- offset, skip_prologue, internal, hardware);
+ nullptr, nullptr, symbol_name, eFunctionNameTypeAuto,
+ eLanguageTypeUnknown, offset, skip_prologue, internal, hardware);
}
}
@@ -1425,7 +1425,7 @@ lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size,
// Target::CreateWatchpoint() is thread safe.
Status cw_error;
// This API doesn't take in a type, so we can't figure out what it is.
- CompilerType *type = NULL;
+ CompilerType *type = nullptr;
watchpoint_sp =
target_sp->CreateWatchpoint(addr, size, type, watch_type, cw_error);
error.SetError(cw_error);
@@ -1559,7 +1559,7 @@ lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
(const char *, const char *, const char *), path, triple,
uuid_cstr);
- return LLDB_RECORD_RESULT(AddModule(path, triple, uuid_cstr, NULL));
+ return LLDB_RECORD_RESULT(AddModule(path, triple, uuid_cstr, nullptr));
}
lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
@@ -1683,7 +1683,7 @@ const char *SBTarget::GetTriple() {
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
- return NULL;
+ return nullptr;
}
uint32_t SBTarget::GetDataByteSize() {
@@ -1969,7 +1969,7 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
if (match_count > 0) {
ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get();
- if (exe_scope == NULL)
+ if (exe_scope == nullptr)
exe_scope = target_sp.get();
for (uint32_t i = 0; i < match_count; ++i) {
lldb::ValueObjectSP valobj_sp(ValueObjectVariable::Create(
@@ -2017,7 +2017,7 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
if (match_count > 0) {
ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get();
- if (exe_scope == NULL)
+ if (exe_scope == nullptr)
exe_scope = target_sp.get();
for (uint32_t i = 0; i < match_count; ++i) {
lldb::ValueObjectSP valobj_sp(ValueObjectVariable::Create(
@@ -2053,7 +2053,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
LLDB_RECORD_METHOD(lldb::SBInstructionList, SBTarget, ReadInstructions,
(lldb::SBAddress, uint32_t), base_addr, count);
- return LLDB_RECORD_RESULT(ReadInstructions(base_addr, count, NULL));
+ return LLDB_RECORD_RESULT(ReadInstructions(base_addr, count, nullptr));
}
lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
@@ -2080,7 +2080,7 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
data.GetByteSize(), error, &load_addr);
const bool data_from_file = load_addr == LLDB_INVALID_ADDRESS;
sb_instructions.SetDisassembler(Disassembler::DisassembleBytes(
- target_sp->GetArchitecture(), NULL, flavor_string, *addr_ptr,
+ target_sp->GetArchitecture(), nullptr, flavor_string, *addr_ptr,
data.GetBytes(), bytes_read, count, data_from_file));
}
}
@@ -2095,7 +2095,7 @@ lldb::SBInstructionList SBTarget::GetInstructions(lldb::SBAddress base_addr,
(lldb::SBAddress, const void *, size_t), base_addr, buf,
size);
- return GetInstructionsWithFlavor(base_addr, NULL, buf, size);
+ return GetInstructionsWithFlavor(base_addr, nullptr, buf, size);
}
lldb::SBInstructionList
@@ -2119,7 +2119,7 @@ SBTarget::GetInstructionsWithFlavor(lldb::SBAddress base_addr,
const bool data_from_file = true;
sb_instructions.SetDisassembler(Disassembler::DisassembleBytes(
- target_sp->GetArchitecture(), NULL, flavor_string, addr, buf, size,
+ target_sp->GetArchitecture(), nullptr, flavor_string, addr, buf, size,
UINT32_MAX, data_from_file));
}
@@ -2132,7 +2132,7 @@ lldb::SBInstructionList SBTarget::GetInstructions(lldb::addr_t base_addr,
LLDB_RECORD_DUMMY(lldb::SBInstructionList, SBTarget, GetInstructions,
(lldb::addr_t, const void *, size_t), base_addr, buf, size);
- return GetInstructionsWithFlavor(ResolveLoadAddress(base_addr), NULL, buf,
+ return GetInstructionsWithFlavor(ResolveLoadAddress(base_addr), nullptr, buf,
size);
}
@@ -2353,9 +2353,9 @@ lldb::SBValue SBTarget::EvaluateExpression(const char *expr,
SBValue expr_result;
ValueObjectSP expr_value_sp;
TargetSP target_sp(GetSP());
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
if (target_sp) {
- if (expr == NULL || expr[0] == '\0') {
+ if (expr == nullptr || expr[0] == '\0') {
return LLDB_RECORD_RESULT(expr_result);
}
@@ -2409,7 +2409,7 @@ lldb::addr_t SBTarget::GetStackRedZoneSize() {
lldb::SBLaunchInfo SBTarget::GetLaunchInfo() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBLaunchInfo, SBTarget, GetLaunchInfo);
- lldb::SBLaunchInfo launch_info(NULL);
+ lldb::SBLaunchInfo launch_info(nullptr);
TargetSP target_sp(GetSP());
if (target_sp)
launch_info.set_ref(m_opaque_sp->GetProcessLaunchInfo());
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index 5f4f69f0213..85e9a6b4795 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -122,7 +122,7 @@ SBThread::operator bool() const {
if (target && process) {
Process::StopLocker stop_locker;
if (stop_locker.TryLock(&process->GetRunLock()))
- return m_opaque_sp->GetThreadSP().get() != NULL;
+ return m_opaque_sp->GetThreadSP().get() != nullptr;
}
// Without a valid target & process, this thread can't be valid.
return false;
@@ -359,7 +359,7 @@ size_t SBThread::GetStopDescription(char *dst, size_t dst_len) {
stop_desc =
exe_ctx.GetProcessPtr()->GetUnixSignals()->GetSignalAsCString(
stop_info_sp->GetValue());
- if (stop_desc == NULL || stop_desc[0] == '\0') {
+ if (stop_desc == nullptr || stop_desc[0] == '\0') {
static char signal_desc[] = "signal";
stop_desc = signal_desc;
stop_desc_len =
@@ -452,7 +452,7 @@ uint32_t SBThread::GetIndexID() const {
const char *SBThread::GetName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetName);
- const char *name = NULL;
+ const char *name = nullptr;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
@@ -469,7 +469,7 @@ const char *SBThread::GetName() const {
const char *SBThread::GetQueueName() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetQueueName);
- const char *name = NULL;
+ const char *name = nullptr;
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
@@ -566,7 +566,7 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx,
// User level plans should be Master Plans so they can be interrupted, other
// plans executed, and then a "continue" will resume the plan.
- if (new_plan != NULL) {
+ if (new_plan != nullptr) {
new_plan->SetIsMasterPlan(true);
new_plan->SetOkayToDiscard(false);
}
@@ -577,7 +577,7 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx,
if (process->GetTarget().GetDebugger().GetAsyncExecution())
sb_error.ref() = process->Resume();
else
- sb_error.ref() = process->ResumeSynchronous(NULL);
+ sb_error.ref() = process->ResumeSynchronous(nullptr);
return sb_error;
}
@@ -627,7 +627,7 @@ void SBThread::StepInto(lldb::RunMode stop_other_threads) {
LLDB_RECORD_METHOD(void, SBThread, StepInto, (lldb::RunMode),
stop_other_threads);
- StepInto(NULL, stop_other_threads);
+ StepInto(nullptr, stop_other_threads);
}
void SBThread::StepInto(const char *target_name,
@@ -716,7 +716,7 @@ void SBThread::StepOut(SBError &error) {
const LazyBool avoid_no_debug = eLazyBoolCalculate;
Status new_plan_status;
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
- abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
+ abort_other_plans, nullptr, false, stop_other_threads, eVoteYes,
eVoteNoOpinion, 0, new_plan_status, avoid_no_debug));
if (new_plan_status.Success())
@@ -763,7 +763,7 @@ void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) {
Status new_plan_status;
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
- abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
+ abort_other_plans, nullptr, false, stop_other_threads, eVoteYes,
eVoteNoOpinion, frame_sp->GetFrameIndex(), new_plan_status));
if (new_plan_status.Success())
@@ -878,7 +878,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame,
eSymbolContextCompUnit | eSymbolContextFunction |
eSymbolContextLineEntry | eSymbolContextSymbol);
- if (frame_sc.comp_unit == NULL) {
+ if (frame_sc.comp_unit == nullptr) {
sb_error.SetErrorStringWithFormat(
"frame %u doesn't have debug information", frame_sp->GetFrameIndex());
return LLDB_RECORD_RESULT(sb_error);
@@ -1235,7 +1235,7 @@ bool SBThread::EventIsThreadEvent(const SBEvent &event) {
LLDB_RECORD_STATIC_METHOD(bool, SBThread, EventIsThreadEvent,
(const lldb::SBEvent &), event);
- return Thread::ThreadEventData::GetEventDataFromEvent(event.get()) != NULL;
+ return Thread::ThreadEventData::GetEventDataFromEvent(event.get()) != nullptr;
}
SBFrame SBThread::GetStackFrameFromEvent(const SBEvent &event) {
diff --git a/lldb/source/API/SBThreadCollection.cpp b/lldb/source/API/SBThreadCollection.cpp
index 766fe8f5516..3c1cf986506 100644
--- a/lldb/source/API/SBThreadCollection.cpp
+++ b/lldb/source/API/SBThreadCollection.cpp
@@ -67,7 +67,7 @@ bool SBThreadCollection::IsValid() const {
SBThreadCollection::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBThreadCollection, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
size_t SBThreadCollection::GetSize() {
diff --git a/lldb/source/API/SBThreadPlan.cpp b/lldb/source/API/SBThreadPlan.cpp
index ecb1a4fd1d9..8f6802fe9ce 100644
--- a/lldb/source/API/SBThreadPlan.cpp
+++ b/lldb/source/API/SBThreadPlan.cpp
@@ -92,7 +92,7 @@ bool SBThreadPlan::IsValid() const {
SBThreadPlan::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBThreadPlan, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
void SBThreadPlan::Clear() {
@@ -262,7 +262,7 @@ SBThreadPlan::QueueThreadPlanForStepInRange(SBAddress &sb_start_address,
Status plan_status;
SBThreadPlan plan =
SBThreadPlan(m_opaque_sp->GetThread().QueueThreadPlanForStepInRange(
- false, range, sc, NULL, eAllThreads, plan_status));
+ false, range, sc, nullptr, eAllThreads, plan_status));
if (plan_status.Fail())
error.SetErrorString(plan_status.AsCString());
diff --git a/lldb/source/API/SBType.cpp b/lldb/source/API/SBType.cpp
index e016ee46f23..5402128b3fa 100644
--- a/lldb/source/API/SBType.cpp
+++ b/lldb/source/API/SBType.cpp
@@ -92,7 +92,7 @@ SBType &SBType::operator=(const SBType &rhs) {
SBType::~SBType() {}
TypeImpl &SBType::ref() {
- if (m_opaque_sp.get() == NULL)
+ if (m_opaque_sp.get() == nullptr)
m_opaque_sp = std::make_shared<TypeImpl>();
return *m_opaque_sp;
}
@@ -112,7 +112,7 @@ bool SBType::IsValid() const {
SBType::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBType, operator bool);
- if (m_opaque_sp.get() == NULL)
+ if (m_opaque_sp.get() == nullptr)
return false;
return m_opaque_sp->IsValid();
@@ -579,7 +579,7 @@ bool SBTypeList::IsValid() {
SBTypeList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeList, operator bool);
- return (m_opaque_up != NULL);
+ return (m_opaque_up != nullptr);
}
SBTypeList &SBTypeList::operator=(const SBTypeList &rhs) {
@@ -660,7 +660,7 @@ const char *SBTypeMember::GetName() {
if (m_opaque_up)
return m_opaque_up->GetName().GetCString();
- return NULL;
+ return nullptr;
}
SBType SBTypeMember::GetType() {
@@ -743,7 +743,7 @@ void SBTypeMember::reset(TypeMemberImpl *type_member_impl) {
}
TypeMemberImpl &SBTypeMember::ref() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new TypeMemberImpl());
return *m_opaque_up;
}
@@ -789,7 +789,7 @@ const char *SBTypeMemberFunction::GetName() {
if (m_opaque_sp)
return m_opaque_sp->GetName().GetCString();
- return NULL;
+ return nullptr;
}
const char *SBTypeMemberFunction::GetDemangledName() {
@@ -803,7 +803,7 @@ const char *SBTypeMemberFunction::GetDemangledName() {
return mangled.GetDemangledName(mangled.GuessLanguage()).GetCString();
}
}
- return NULL;
+ return nullptr;
}
const char *SBTypeMemberFunction::GetMangledName() {
@@ -812,7 +812,7 @@ const char *SBTypeMemberFunction::GetMangledName() {
if (m_opaque_sp)
return m_opaque_sp->GetMangledName().GetCString();
- return NULL;
+ return nullptr;
}
SBType SBTypeMemberFunction::GetType() {
diff --git a/lldb/source/API/SBTypeCategory.cpp b/lldb/source/API/SBTypeCategory.cpp
index c2ec8cf8522..43d5a3ab140 100644
--- a/lldb/source/API/SBTypeCategory.cpp
+++ b/lldb/source/API/SBTypeCategory.cpp
@@ -49,7 +49,7 @@ bool SBTypeCategory::IsValid() const {
SBTypeCategory::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeCategory, operator bool);
- return (m_opaque_sp.get() != NULL);
+ return (m_opaque_sp.get() != nullptr);
}
bool SBTypeCategory::GetEnabled() {
@@ -75,7 +75,7 @@ const char *SBTypeCategory::GetName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeCategory, GetName);
if (!IsValid())
- return NULL;
+ return nullptr;
return m_opaque_sp->GetName();
}
diff --git a/lldb/source/API/SBTypeEnumMember.cpp b/lldb/source/API/SBTypeEnumMember.cpp
index c0e1c7942db..bd0755a140c 100644
--- a/lldb/source/API/SBTypeEnumMember.cpp
+++ b/lldb/source/API/SBTypeEnumMember.cpp
@@ -64,7 +64,7 @@ const char *SBTypeEnumMember::GetName() {
if (m_opaque_sp.get())
return m_opaque_sp->GetName().GetCString();
- return NULL;
+ return nullptr;
}
int64_t SBTypeEnumMember::GetValueAsSigned() {
@@ -98,7 +98,7 @@ void SBTypeEnumMember::reset(TypeEnumMemberImpl *type_member_impl) {
}
TypeEnumMemberImpl &SBTypeEnumMember::ref() {
- if (m_opaque_sp.get() == NULL)
+ if (m_opaque_sp.get() == nullptr)
m_opaque_sp = std::make_shared<TypeEnumMemberImpl>();
return *m_opaque_sp.get();
}
@@ -130,7 +130,7 @@ bool SBTypeEnumMemberList::IsValid() {
SBTypeEnumMemberList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeEnumMemberList, operator bool);
- return (m_opaque_up != NULL);
+ return (m_opaque_up != nullptr);
}
SBTypeEnumMemberList &SBTypeEnumMemberList::
diff --git a/lldb/source/API/SBTypeFilter.cpp b/lldb/source/API/SBTypeFilter.cpp
index 104ef95650f..d40301b4c15 100644
--- a/lldb/source/API/SBTypeFilter.cpp
+++ b/lldb/source/API/SBTypeFilter.cpp
@@ -40,7 +40,7 @@ bool SBTypeFilter::IsValid() const {
SBTypeFilter::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeFilter, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
uint32_t SBTypeFilter::GetOptions() {
@@ -98,7 +98,7 @@ const char *SBTypeFilter::GetExpressionPathAtIndex(uint32_t i) {
item++;
return item;
}
- return NULL;
+ return nullptr;
}
bool SBTypeFilter::ReplaceExpressionPathAtIndex(uint32_t i, const char *item) {
diff --git a/lldb/source/API/SBTypeFormat.cpp b/lldb/source/API/SBTypeFormat.cpp
index 12729aaf982..6024631e705 100644
--- a/lldb/source/API/SBTypeFormat.cpp
+++ b/lldb/source/API/SBTypeFormat.cpp
@@ -49,7 +49,7 @@ bool SBTypeFormat::IsValid() const {
SBTypeFormat::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeFormat, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
lldb::Format SBTypeFormat::GetFormat() {
diff --git a/lldb/source/API/SBTypeNameSpecifier.cpp b/lldb/source/API/SBTypeNameSpecifier.cpp
index cccd0ee449e..895f6977565 100644
--- a/lldb/source/API/SBTypeNameSpecifier.cpp
+++ b/lldb/source/API/SBTypeNameSpecifier.cpp
@@ -27,7 +27,7 @@ SBTypeNameSpecifier::SBTypeNameSpecifier(const char *name, bool is_regex)
LLDB_RECORD_CONSTRUCTOR(SBTypeNameSpecifier, (const char *, bool), name,
is_regex);
- if (name == NULL || (*name) == 0)
+ if (name == nullptr || (*name) == 0)
m_opaque_sp.reset();
}
@@ -54,14 +54,14 @@ bool SBTypeNameSpecifier::IsValid() const {
SBTypeNameSpecifier::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeNameSpecifier, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
const char *SBTypeNameSpecifier::GetName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeNameSpecifier, GetName);
if (!IsValid())
- return NULL;
+ return nullptr;
return m_opaque_sp->GetName();
}
@@ -129,7 +129,7 @@ bool SBTypeNameSpecifier::IsEqualTo(lldb::SBTypeNameSpecifier &rhs) {
if (IsRegex() != rhs.IsRegex())
return false;
- if (GetName() == NULL || rhs.GetName() == NULL)
+ if (GetName() == nullptr || rhs.GetName() == nullptr)
return false;
return (strcmp(GetName(), rhs.GetName()) == 0);
diff --git a/lldb/source/API/SBTypeSummary.cpp b/lldb/source/API/SBTypeSummary.cpp
index 8ffb114470b..8ffb2343575 100644
--- a/lldb/source/API/SBTypeSummary.cpp
+++ b/lldb/source/API/SBTypeSummary.cpp
@@ -202,7 +202,7 @@ bool SBTypeSummary::IsValid() const {
SBTypeSummary::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeSummary, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
bool SBTypeSummary::IsFunctionCode() {
@@ -244,7 +244,7 @@ const char *SBTypeSummary::GetData() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeSummary, GetData);
if (!IsValid())
- return NULL;
+ return nullptr;
if (ScriptSummaryFormat *script_summary_ptr =
llvm::dyn_cast<ScriptSummaryFormat>(m_opaque_sp.get())) {
const char *fname = script_summary_ptr->GetFunctionName();
diff --git a/lldb/source/API/SBTypeSynthetic.cpp b/lldb/source/API/SBTypeSynthetic.cpp
index f1e15525a08..df6fce1269f 100644
--- a/lldb/source/API/SBTypeSynthetic.cpp
+++ b/lldb/source/API/SBTypeSynthetic.cpp
@@ -60,7 +60,7 @@ bool SBTypeSynthetic::IsValid() const {
SBTypeSynthetic::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBTypeSynthetic, operator bool);
- return m_opaque_sp.get() != NULL;
+ return m_opaque_sp.get() != nullptr;
}
bool SBTypeSynthetic::IsClassCode() {
@@ -84,7 +84,7 @@ const char *SBTypeSynthetic::GetData() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBTypeSynthetic, GetData);
if (!IsValid())
- return NULL;
+ return nullptr;
if (IsClassCode())
return m_opaque_sp->GetPythonCode();
else
diff --git a/lldb/source/API/SBValue.cpp b/lldb/source/API/SBValue.cpp
index 3db84fa2980..83830076352 100644
--- a/lldb/source/API/SBValue.cpp
+++ b/lldb/source/API/SBValue.cpp
@@ -57,7 +57,7 @@ public:
ValueImpl(lldb::ValueObjectSP in_valobj_sp,
lldb::DynamicValueType use_dynamic, bool use_synthetic,
- const char *name = NULL)
+ const char *name = nullptr)
: m_valobj_sp(), m_use_dynamic(use_dynamic),
m_use_synthetic(use_synthetic), m_name(name) {
if (in_valobj_sp) {
@@ -84,7 +84,7 @@ public:
}
bool IsValid() {
- if (m_valobj_sp.get() == NULL)
+ if (m_valobj_sp.get() == nullptr)
return false;
else {
// FIXME: This check is necessary but not sufficient. We for sure don't
@@ -251,8 +251,8 @@ SBValue::operator bool() const {
// If this function ever changes to anything that does more than just check
// if the opaque shared pointer is non NULL, then we need to update all "if
// (m_opaque_sp)" code in this file.
- return m_opaque_sp.get() != NULL && m_opaque_sp->IsValid() &&
- m_opaque_sp->GetRootSP().get() != NULL;
+ return m_opaque_sp.get() != nullptr && m_opaque_sp->IsValid() &&
+ m_opaque_sp->GetRootSP().get() != nullptr;
}
void SBValue::Clear() {
@@ -290,7 +290,7 @@ user_id_t SBValue::GetID() {
const char *SBValue::GetName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetName);
- const char *name = NULL;
+ const char *name = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
@@ -302,7 +302,7 @@ const char *SBValue::GetName() {
const char *SBValue::GetTypeName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeName);
- const char *name = NULL;
+ const char *name = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -315,7 +315,7 @@ const char *SBValue::GetTypeName() {
const char *SBValue::GetDisplayTypeName() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetDisplayTypeName);
- const char *name = NULL;
+ const char *name = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -356,7 +356,7 @@ bool SBValue::IsInScope() {
const char *SBValue::GetValue() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetValue);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -381,7 +381,7 @@ ValueType SBValue::GetValueType() {
const char *SBValue::GetObjectDescription() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetObjectDescription);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -394,7 +394,7 @@ const char *SBValue::GetObjectDescription() {
const char *SBValue::GetTypeValidatorResult() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetTypeValidatorResult);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -442,7 +442,7 @@ bool SBValue::GetValueDidChange() {
const char *SBValue::GetSummary() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetSummary);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -472,7 +472,7 @@ const char *SBValue::GetSummary(lldb::SBStream &stream,
const char *SBValue::GetLocation() {
LLDB_RECORD_METHOD_NO_ARGS(const char *, SBValue, GetLocation);
- const char *cstr = NULL;
+ const char *cstr = nullptr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp) {
@@ -1042,7 +1042,7 @@ void *SBValue::GetOpaqueType() {
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
return value_sp->GetCompilerType().GetOpaqueQualType();
- return NULL;
+ return nullptr;
}
lldb::SBTarget SBValue::GetTarget() {
diff --git a/lldb/source/API/SBValueList.cpp b/lldb/source/API/SBValueList.cpp
index 2f74c992252..7e909df260d 100644
--- a/lldb/source/API/SBValueList.cpp
+++ b/lldb/source/API/SBValueList.cpp
@@ -92,7 +92,7 @@ bool SBValueList::IsValid() const {
SBValueList::operator bool() const {
LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBValueList, operator bool);
- return (m_opaque_up != NULL);
+ return (m_opaque_up != nullptr);
}
void SBValueList::Clear() {
@@ -172,7 +172,7 @@ uint32_t SBValueList::GetSize() const {
}
void SBValueList::CreateIfNeeded() {
- if (m_opaque_up == NULL)
+ if (m_opaque_up == nullptr)
m_opaque_up.reset(new ValueListImpl());
}
diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp
index 0f35c3eda87..d0a36b71e5c 100644
--- a/lldb/source/API/SBWatchpoint.cpp
+++ b/lldb/source/API/SBWatchpoint.cpp
@@ -218,7 +218,7 @@ const char *SBWatchpoint::GetCondition() {
watchpoint_sp->GetTarget().GetAPIMutex());
return watchpoint_sp->GetConditionText();
}
- return NULL;
+ return nullptr;
}
void SBWatchpoint::SetCondition(const char *condition) {
@@ -277,7 +277,7 @@ bool SBWatchpoint::EventIsWatchpointEvent(const lldb::SBEvent &event) {
(const lldb::SBEvent &), event);
return Watchpoint::WatchpointEventData::GetEventDataFromEvent(event.get()) !=
- NULL;
+ nullptr;
}
WatchpointEventType
diff --git a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
index d3610982026..8a6fd6a2692 100644
--- a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
@@ -124,7 +124,7 @@ Searcher::CallbackReturn
BreakpointResolverAddress::SearchCallback(SearchFilter &filter,
SymbolContext &context, Address *addr,
bool containing) {
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
if (filter.AddressPasses(m_addr)) {
if (m_breakpoint->GetNumLocations() == 0) {
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
index 494b4c77d02..a6095be3164 100644
--- a/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -204,7 +204,7 @@ BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
Address *addr, bool containing) {
SymbolContextList sc_list;
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
// There is a tricky bit here. You can have two compilation units that
// #include the same file, and in one of them the function at m_line_number
diff --git a/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp b/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
index c17dcb8342c..0b2485245b7 100644
--- a/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverFileRegex.cpp
@@ -98,7 +98,7 @@ BreakpointResolverFileRegex::SearchCallback(SearchFilter &filter,
SymbolContext &context,
Address *addr, bool containing) {
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
if (!context.target_sp)
return eCallbackReturnContinue;
@@ -145,7 +145,7 @@ BreakpointResolverFileRegex::SearchCallback(SearchFilter &filter,
BreakpointResolver::SetSCMatchesByLine(filter, sc_list, skip_prologue,
m_regex.GetText());
}
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
return Searcher::eCallbackReturnContinue;
}
diff --git a/lldb/source/Breakpoint/BreakpointResolverScripted.cpp b/lldb/source/Breakpoint/BreakpointResolverScripted.cpp
index ae9775738f2..8363795a4d7 100644
--- a/lldb/source/Breakpoint/BreakpointResolverScripted.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverScripted.cpp
@@ -127,7 +127,7 @@ Searcher::CallbackReturn
BreakpointResolverScripted::SearchCallback(SearchFilter &filter,
SymbolContext &context, Address *addr,
bool containing) {
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
bool should_continue = true;
if (!m_implementation_sp)
return Searcher::eCallbackReturnStop;
@@ -144,7 +144,7 @@ BreakpointResolverScripted::SearchCallback(SearchFilter &filter,
lldb::SearchDepth
BreakpointResolverScripted::GetDepth() {
- assert(m_breakpoint != NULL);
+ assert(m_breakpoint != nullptr);
lldb::SearchDepth depth = lldb::eSearchDepthModule;
if (m_implementation_sp) {
ScriptInterpreter *interp = GetScriptInterpreter();
diff --git a/lldb/source/Commands/CommandObjectExpression.h b/lldb/source/Commands/CommandObjectExpression.h
index 5bd8384fb4e..89c8e1dbece 100644
--- a/lldb/source/Commands/CommandObjectExpression.h
+++ b/lldb/source/Commands/CommandObjectExpression.h
@@ -68,7 +68,7 @@ protected:
bool EvaluateExpression(llvm::StringRef expr, Stream *output_stream,
Stream *error_stream,
- CommandReturnObject *result = NULL);
+ CommandReturnObject *result = nullptr);
void GetMultilineExpression();
diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp
index ed5f5a559c5..f2919d807d5 100644
--- a/lldb/source/Core/Communication.cpp
+++ b/lldb/source/Core/Communication.cpp
@@ -359,7 +359,7 @@ lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) {
// Let clients know that this thread is exiting
comm->BroadcastEvent(eBroadcastBitNoMorePendingInput);
comm->BroadcastEvent(eBroadcastBitReadThreadDidExit);
- return NULL;
+ return nullptr;
}
void Communication::SetReadThreadBytesReceivedCallback(
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 7f180c1575a..79402813e84 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1616,7 +1616,7 @@ void Debugger::DefaultEventHandler() {
lldb::thread_result_t Debugger::EventHandlerThread(lldb::thread_arg_t arg) {
((Debugger *)arg)->DefaultEventHandler();
- return NULL;
+ return nullptr;
}
bool Debugger::StartEventHandlerThread() {
@@ -1661,7 +1661,7 @@ lldb::thread_result_t Debugger::IOHandlerThread(lldb::thread_arg_t arg) {
Debugger *debugger = (Debugger *)arg;
debugger->ExecuteIOHandlers();
debugger->StopEventHandlerThread();
- return NULL;
+ return nullptr;
}
bool Debugger::HasIOHandlerThread() { return m_io_handler_thread.IsJoinable(); }
diff --git a/lldb/source/Core/Mangled.cpp b/lldb/source/Core/Mangled.cpp
index 608ea8964e7..c6759cc944c 100644
--- a/lldb/source/Core/Mangled.cpp
+++ b/lldb/source/Core/Mangled.cpp
@@ -160,7 +160,7 @@ Mangled::~Mangled() {}
// if (mangled)
// { ...
Mangled::operator void *() const {
- return (m_mangled) ? const_cast<Mangled *>(this) : NULL;
+ return (m_mangled) ? const_cast<Mangled *>(this) : nullptr;
}
// Logical NOT operator. This allows code to check any Mangled objects to see
diff --git a/lldb/source/Core/Section.cpp b/lldb/source/Core/Section.cpp
index 05d1468314c..a0d4cee4739 100644
--- a/lldb/source/Core/Section.cpp
+++ b/lldb/source/Core/Section.cpp
@@ -342,7 +342,7 @@ void Section::DumpName(Stream *s) const {
s->PutChar('.');
} else {
// The top most section prints the module basename
- const char *name = NULL;
+ const char *name = nullptr;
ModuleSP module_sp(GetModule());
if (m_obj_file) {
@@ -509,7 +509,7 @@ SectionList::FindSectionByName(ConstString section_dstr) const {
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin();
- sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
+ sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
Section *child_section = sect_iter->get();
if (child_section) {
if (child_section->GetName() == section_dstr) {
@@ -530,7 +530,7 @@ SectionSP SectionList::FindSectionByID(user_id_t sect_id) const {
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin();
- sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
+ sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
if ((*sect_iter)->GetID() == sect_id) {
sect_sp = *sect_iter;
break;
@@ -567,7 +567,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin();
- sect_iter != end && sect_sp.get() == NULL; ++sect_iter) {
+ sect_iter != end && sect_sp.get() == nullptr; ++sect_iter) {
Section *sect = sect_iter->get();
if (sect->ContainsFileAddress(vm_addr)) {
// The file address is in this section. We need to make sure one of our
@@ -577,7 +577,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
sect_sp = sect->GetChildren().FindSectionContainingFileAddress(
vm_addr, depth - 1);
- if (sect_sp.get() == NULL && !sect->IsFake())
+ if (sect_sp.get() == nullptr && !sect->IsFake())
sect_sp = *sect_iter;
}
}
@@ -585,7 +585,7 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
}
bool SectionList::ContainsSection(user_id_t sect_id) const {
- return FindSectionByID(sect_id).get() != NULL;
+ return FindSectionByID(sect_id).get() != nullptr;
}
void SectionList::Dump(Stream *s, Target *target, bool show_header,
@@ -608,7 +608,7 @@ void SectionList::Dump(Stream *s, Target *target, bool show_header,
const_iterator sect_iter;
const_iterator end = m_sections.end();
for (sect_iter = m_sections.begin(); sect_iter != end; ++sect_iter) {
- (*sect_iter)->Dump(s, target_has_loaded_sections ? target : NULL, depth);
+ (*sect_iter)->Dump(s, target_has_loaded_sections ? target : nullptr, depth);
}
if (show_header && !m_sections.empty())
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index 9cd9ac163fb..87065ab6242 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -326,7 +326,7 @@ bool SourceManager::GetDefaultFileAndLine(FileSpec &file_spec, uint32_t &line) {
bool inlines_okay = true;
bool append = false;
size_t num_matches = executable_ptr->FindFunctions(
- main_name, NULL, lldb::eFunctionNameTypeBase, inlines_okay,
+ main_name, nullptr, lldb::eFunctionNameTypeBase, inlines_okay,
symbols_okay, append, sc_list);
for (size_t idx = 0; idx < num_matches; idx++) {
SymbolContext sc;
@@ -399,7 +399,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec,
if (num_matches != 0) {
if (num_matches > 1) {
SymbolContext sc;
- FileSpec *test_cu_spec = NULL;
+ FileSpec *test_cu_spec = nullptr;
for (unsigned i = 0; i < num_matches; i++) {
sc_list.GetContextAtIndex(i, sc);
@@ -461,12 +461,12 @@ uint32_t SourceManager::File::GetNumLines() {
const char *SourceManager::File::PeekLineData(uint32_t line) {
if (!LineIsValid(line))
- return NULL;
+ return nullptr;
size_t line_offset = GetLineOffset(line);
if (line_offset < m_data_sp->GetByteSize())
return (const char *)m_data_sp->GetBytes() + line_offset;
- return NULL;
+ return nullptr;
}
uint32_t SourceManager::File::GetLineLength(uint32_t line,
@@ -621,7 +621,7 @@ bool SourceManager::File::CalculateLineOffsets(uint32_t line) {
return true;
if (m_offsets.empty()) {
- if (m_data_sp.get() == NULL)
+ if (m_data_sp.get() == nullptr)
return false;
const char *start = (char *)m_data_sp->GetBytes();
diff --git a/lldb/source/Core/Value.cpp b/lldb/source/Core/Value.cpp
index 541e0933bca..fdb4adb5f43 100644
--- a/lldb/source/Core/Value.cpp
+++ b/lldb/source/Core/Value.cpp
@@ -39,17 +39,17 @@ using namespace lldb;
using namespace lldb_private;
Value::Value()
- : m_value(), m_vector(), m_compiler_type(), m_context(NULL),
+ : m_value(), m_vector(), m_compiler_type(), m_context(nullptr),
m_value_type(eValueTypeScalar), m_context_type(eContextTypeInvalid),
m_data_buffer() {}
Value::Value(const Scalar &scalar)
- : m_value(scalar), m_vector(), m_compiler_type(), m_context(NULL),
+ : m_value(scalar), m_vector(), m_compiler_type(), m_context(nullptr),
m_value_type(eValueTypeScalar), m_context_type(eContextTypeInvalid),
m_data_buffer() {}
Value::Value(const void *bytes, int len)
- : m_value(), m_vector(), m_compiler_type(), m_context(NULL),
+ : m_value(), m_vector(), m_compiler_type(), m_context(nullptr),
m_value_type(eValueTypeHostAddress), m_context_type(eContextTypeInvalid),
m_data_buffer() {
SetBytes(bytes, len);
@@ -131,13 +131,13 @@ AddressType Value::GetValueAddressType() const {
RegisterInfo *Value::GetRegisterInfo() const {
if (m_context_type == eContextTypeRegisterInfo)
return static_cast<RegisterInfo *>(m_context);
- return NULL;
+ return nullptr;
}
Type *Value::GetType() {
if (m_context_type == eContextTypeLLDBType)
return static_cast<Type *>(m_context);
- return NULL;
+ return nullptr;
}
size_t Value::AppendDataToHostBuffer(const Value &rhs) {
@@ -353,11 +353,11 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
break;
}
case eValueTypeLoadAddress:
- if (exe_ctx == NULL) {
+ if (exe_ctx == nullptr) {
error.SetErrorString("can't read load address (no execution context)");
} else {
Process *process = exe_ctx->GetProcessPtr();
- if (process == NULL || !process->IsAlive()) {
+ if (process == nullptr || !process->IsAlive()) {
Target *target = exe_ctx->GetTargetPtr();
if (target) {
// Allow expressions to run and evaluate things when the target has
@@ -390,16 +390,16 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
break;
case eValueTypeFileAddress:
- if (exe_ctx == NULL) {
+ if (exe_ctx == nullptr) {
error.SetErrorString("can't read file address (no execution context)");
- } else if (exe_ctx->GetTargetPtr() == NULL) {
+ } else if (exe_ctx->GetTargetPtr() == nullptr) {
error.SetErrorString("can't read file address (invalid target)");
} else {
address = m_value.ULongLong(LLDB_INVALID_ADDRESS);
if (address == LLDB_INVALID_ADDRESS) {
error.SetErrorString("invalid file address");
} else {
- if (module == NULL) {
+ if (module == nullptr) {
// The only thing we can currently lock down to a module so that we
// can resolve a file address, is a variable.
Variable *variable = GetVariable();
@@ -527,7 +527,7 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
}
uint8_t *dst = const_cast<uint8_t *>(data.PeekData(data_offset, byte_size));
- if (dst != NULL) {
+ if (dst != nullptr) {
if (address_type == eAddressTypeHost) {
// The address is an address in this process, so just copy it.
if (address == 0) {
@@ -597,7 +597,7 @@ Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
{
DataExtractor data;
lldb::addr_t addr = m_value.ULongLong(LLDB_INVALID_ADDRESS);
- Status error(GetValueAsData(exe_ctx, data, 0, NULL));
+ Status error(GetValueAsData(exe_ctx, data, 0, nullptr));
if (error.Success()) {
Scalar scalar;
if (compiler_type.GetValueAsScalar(data, 0, data.GetByteSize(),
@@ -625,7 +625,7 @@ Scalar &Value::ResolveValue(ExecutionContext *exe_ctx) {
Variable *Value::GetVariable() {
if (m_context_type == eContextTypeVariable)
return static_cast<Variable *>(m_context);
- return NULL;
+ return nullptr;
}
void Value::Clear() {
@@ -633,7 +633,7 @@ void Value::Clear() {
m_vector.Clear();
m_compiler_type.Clear();
m_value_type = eValueTypeScalar;
- m_context = NULL;
+ m_context = nullptr;
m_context_type = eContextTypeInvalid;
m_data_buffer.Clear();
}
@@ -702,7 +702,7 @@ Value *ValueList::GetValueAtIndex(size_t idx) {
if (idx < GetSize()) {
return &(m_values[idx]);
} else
- return NULL;
+ return nullptr;
}
void ValueList::Clear() { m_values.clear(); }
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index 8bb542263f9..e083b8dc086 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -81,12 +81,13 @@ static user_id_t g_value_obj_uid = 0;
// ValueObject constructor
ValueObject::ValueObject(ValueObject &parent)
: UserID(++g_value_obj_uid), // Unique identifier for every value object
- m_parent(&parent), m_root(NULL), m_update_point(parent.GetUpdatePoint()),
- m_name(), m_data(), m_value(), m_error(), m_value_str(),
- m_old_value_str(), m_location_str(), m_summary_str(), m_object_desc_str(),
- m_validation_result(), m_manager(parent.GetManager()), m_children(),
- m_synthetic_children(), m_dynamic_value(NULL), m_synthetic_value(NULL),
- m_deref_valobj(NULL), m_format(eFormatDefault),
+ m_parent(&parent), m_root(nullptr),
+ m_update_point(parent.GetUpdatePoint()), m_name(), m_data(), m_value(),
+ m_error(), m_value_str(), m_old_value_str(), m_location_str(),
+ m_summary_str(), m_object_desc_str(), m_validation_result(),
+ m_manager(parent.GetManager()), m_children(), m_synthetic_children(),
+ m_dynamic_value(nullptr), m_synthetic_value(nullptr),
+ m_deref_valobj(nullptr), m_format(eFormatDefault),
m_last_format(eFormatDefault), m_last_format_mgr_revision(0),
m_type_summary_sp(), m_type_format_sp(), m_synthetic_children_sp(),
m_type_validator_sp(), m_user_id_of_forced_summary(),
@@ -108,15 +109,15 @@ ValueObject::ValueObject(ValueObject &parent)
ValueObject::ValueObject(ExecutionContextScope *exe_scope,
AddressType child_ptr_or_ref_addr_type)
: UserID(++g_value_obj_uid), // Unique identifier for every value object
- m_parent(NULL), m_root(NULL), m_update_point(exe_scope), m_name(),
+ m_parent(nullptr), m_root(nullptr), m_update_point(exe_scope), m_name(),
m_data(), m_value(), m_error(), m_value_str(), m_old_value_str(),
m_location_str(), m_summary_str(), m_object_desc_str(),
m_validation_result(), m_manager(), m_children(), m_synthetic_children(),
- m_dynamic_value(NULL), m_synthetic_value(NULL), m_deref_valobj(NULL),
- m_format(eFormatDefault), m_last_format(eFormatDefault),
- m_last_format_mgr_revision(0), m_type_summary_sp(), m_type_format_sp(),
- m_synthetic_children_sp(), m_type_validator_sp(),
- m_user_id_of_forced_summary(),
+ m_dynamic_value(nullptr), m_synthetic_value(nullptr),
+ m_deref_valobj(nullptr), m_format(eFormatDefault),
+ m_last_format(eFormatDefault), m_last_format_mgr_revision(0),
+ m_type_summary_sp(), m_type_format_sp(), m_synthetic_children_sp(),
+ m_type_validator_sp(), m_user_id_of_forced_summary(),
m_address_type_of_ptr_or_ref_children(child_ptr_or_ref_addr_type),
m_value_checksum(),
m_preferred_display_language(lldb::eLanguageTypeUnknown),
@@ -465,7 +466,7 @@ ValueObjectSP ValueObject::GetChildAtIndex(size_t idx, bool can_create) {
}
ValueObject *child = m_children.GetChildAtIndex(idx);
- if (child != NULL)
+ if (child != nullptr)
return child->GetSP();
}
return child_sp;
@@ -617,7 +618,7 @@ void ValueObject::SetName(ConstString name) { m_name = name; }
ValueObject *ValueObject::CreateChildAtIndex(size_t idx,
bool synthetic_array_member,
int32_t synthetic_index) {
- ValueObject *valobj = NULL;
+ ValueObject *valobj = nullptr;
bool omit_empty_base_classes = true;
bool ignore_array_bounds = synthetic_array_member;
@@ -710,7 +711,7 @@ const char *ValueObject::GetSummaryAsCString(lldb::LanguageType lang) {
summary_options);
}
if (m_summary_str.empty())
- return NULL;
+ return nullptr;
return m_summary_str.c_str();
}
@@ -763,12 +764,12 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx,
if (is_pointer_type) {
Status error;
ValueObjectSP pointee_sp = Dereference(error);
- if (error.Fail() || pointee_sp.get() == NULL)
+ if (error.Fail() || pointee_sp.get() == nullptr)
return 0;
return pointee_sp->GetData(data, error);
} else {
ValueObjectSP child_sp = GetChildAtIndex(0, true);
- if (child_sp.get() == NULL)
+ if (child_sp.get() == nullptr)
return 0;
Status error;
return child_sp->GetData(data, error);
@@ -777,7 +778,7 @@ size_t ValueObject::GetPointeeData(DataExtractor &data, uint32_t item_idx,
} else /* (items > 1) */
{
Status error;
- lldb_private::DataBufferHeap *heap_buf_ptr = NULL;
+ lldb_private::DataBufferHeap *heap_buf_ptr = nullptr;
lldb::DataBufferSP data_sp(heap_buf_ptr =
new lldb_private::DataBufferHeap());
@@ -964,7 +965,7 @@ ValueObject::ReadPointedString(lldb::DataBufferSP &buffer_sp, Status &error,
if (is_array) {
// We have an array
uint64_t array_size = 0;
- if (compiler_type.IsArrayType(NULL, &array_size, NULL)) {
+ if (compiler_type.IsArrayType(nullptr, &array_size, nullptr)) {
cstr_len = array_size;
if (cstr_len > max_length) {
capped_data = true;
@@ -1170,7 +1171,7 @@ const char *ValueObject::GetValueAsCString() {
}
}
if (m_value_str.empty())
- return NULL;
+ return nullptr;
return m_value_str.c_str();
}
@@ -1281,7 +1282,7 @@ bool ValueObject::DumpPrintableRepresentation(
buffer_sp, lldb::eByteOrderInvalid,
8)); // none of this matters for a string - pass some defaults
options.SetStream(&s);
- options.SetPrefixToken(0);
+ options.SetPrefixToken(nullptr);
options.SetQuote('"');
options.SetSourceSize(buffer_sp->GetByteSize());
options.SetIsTruncated(read_string.second);
@@ -1670,7 +1671,7 @@ ValueObject::GetTypeInfo(CompilerType *pointee_or_element_compiler_type) {
bool ValueObject::IsPointerType() { return GetCompilerType().IsPointerType(); }
bool ValueObject::IsArrayType() {
- return GetCompilerType().IsArrayType(NULL, NULL, NULL);
+ return GetCompilerType().IsArrayType(nullptr, nullptr, nullptr);
}
bool ValueObject::IsScalarType() { return GetCompilerType().IsScalarType(); }
@@ -1689,7 +1690,7 @@ bool ValueObject::IsPossibleDynamicType() {
if (process)
return process->IsPossibleDynamicValue(*this);
else
- return GetCompilerType().IsPossibleDynamicType(NULL, true, true);
+ return GetCompilerType().IsPossibleDynamicType(nullptr, true, true);
}
bool ValueObject::IsRuntimeSupportValue() {
@@ -1900,7 +1901,7 @@ ValueObject::GetSyntheticExpressionPathChild(const char *expression,
// We haven't made a synthetic array member for expression yet, so lets
// make one and cache it for any future reference.
synthetic_child_sp = GetValueForExpressionPath(
- expression, NULL, NULL,
+ expression, nullptr, nullptr,
GetValueForExpressionPathOptions().SetSyntheticChildrenTraversal(
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::
None));
@@ -1923,7 +1924,7 @@ void ValueObject::CalculateSyntheticValue(bool use_synthetic) {
TargetSP target_sp(GetTargetSP());
if (target_sp && !target_sp->GetEnableSyntheticValue()) {
- m_synthetic_value = NULL;
+ m_synthetic_value = nullptr;
return;
}
@@ -1932,7 +1933,7 @@ void ValueObject::CalculateSyntheticValue(bool use_synthetic) {
if (!UpdateFormatsIfNeeded() && m_synthetic_value)
return;
- if (m_synthetic_children_sp.get() == NULL)
+ if (m_synthetic_children_sp.get() == nullptr)
return;
if (current_synth_sp == m_synthetic_children_sp && m_synthetic_value)
@@ -1959,7 +1960,7 @@ ValueObjectSP ValueObject::GetDynamicValue(DynamicValueType use_dynamic) {
if (use_dynamic == eNoDynamicValues)
return ValueObjectSP();
- if (!IsDynamic() && m_dynamic_value == NULL) {
+ if (!IsDynamic() && m_dynamic_value == nullptr) {
CalculateDynamicValue(use_dynamic);
}
if (m_dynamic_value)
@@ -1987,7 +1988,7 @@ ValueObjectSP ValueObject::GetSyntheticValue(bool use_synthetic) {
bool ValueObject::HasSyntheticValue() {
UpdateFormatsIfNeeded();
- if (m_synthetic_children_sp.get() == NULL)
+ if (m_synthetic_children_sp.get() == nullptr)
return false;
CalculateSyntheticValue(true);
@@ -2020,7 +2021,7 @@ ValueObject *ValueObject::GetNonBaseClassParent() {
else
return GetParent();
}
- return NULL;
+ return nullptr;
}
bool ValueObject::IsBaseClass(uint32_t &depth) {
@@ -3005,12 +3006,12 @@ bool ValueObject::EvaluationPoint::SyncWithProcessState(
ExecutionContext exe_ctx(
m_exe_ctx_ref.Lock(thread_and_frame_only_if_stopped));
- if (exe_ctx.GetTargetPtr() == NULL)
+ if (exe_ctx.GetTargetPtr() == nullptr)
return false;
// If we don't have a process nothing can change.
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return false;
// If our stop id is the current stop ID, nothing has changed:
@@ -3091,7 +3092,7 @@ void ValueObject::ClearUserVisibleData(uint32_t clear_mask) {
if ((clear_mask & eClearUserVisibleDataItemsSyntheticChildren) ==
eClearUserVisibleDataItemsSyntheticChildren) {
if (m_synthetic_value)
- m_synthetic_value = NULL;
+ m_synthetic_value = nullptr;
}
if ((clear_mask & eClearUserVisibleDataItemsValidator) ==
@@ -3104,7 +3105,7 @@ SymbolContextScope *ValueObject::GetSymbolContextScope() {
if (!m_parent->IsPointerOrReferenceType())
return m_parent->GetSymbolContextScope();
}
- return NULL;
+ return nullptr;
}
lldb::ValueObjectSP
diff --git a/lldb/source/Core/ValueObjectConstResultImpl.cpp b/lldb/source/Core/ValueObjectConstResultImpl.cpp
index aeea1743682..de51735736b 100644
--- a/lldb/source/Core/ValueObjectConstResultImpl.cpp
+++ b/lldb/source/Core/ValueObjectConstResultImpl.cpp
@@ -39,7 +39,7 @@ ValueObjectConstResultImpl::ValueObjectConstResultImpl(
m_address_of_backend() {}
lldb::ValueObjectSP ValueObjectConstResultImpl::Dereference(Status &error) {
- if (m_impl_backend == NULL)
+ if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
return m_impl_backend->ValueObject::Dereference(error);
@@ -47,12 +47,12 @@ lldb::ValueObjectSP ValueObjectConstResultImpl::Dereference(Status &error) {
ValueObject *ValueObjectConstResultImpl::CreateChildAtIndex(
size_t idx, bool synthetic_array_member, int32_t synthetic_index) {
- if (m_impl_backend == NULL)
- return NULL;
+ if (m_impl_backend == nullptr)
+ return nullptr;
m_impl_backend->UpdateValueIfNeeded(false);
- ValueObjectConstResultChild *valobj = NULL;
+ ValueObjectConstResultChild *valobj = nullptr;
bool omit_empty_base_classes = true;
bool ignore_array_bounds = synthetic_array_member;
@@ -106,7 +106,7 @@ ValueObject *ValueObjectConstResultImpl::CreateChildAtIndex(
lldb::ValueObjectSP ValueObjectConstResultImpl::GetSyntheticChildAtOffset(
uint32_t offset, const CompilerType &type, bool can_create,
ConstString name_const_str) {
- if (m_impl_backend == NULL)
+ if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
return m_impl_backend->ValueObject::GetSyntheticChildAtOffset(
@@ -114,10 +114,10 @@ lldb::ValueObjectSP ValueObjectConstResultImpl::GetSyntheticChildAtOffset(
}
lldb::ValueObjectSP ValueObjectConstResultImpl::AddressOf(Status &error) {
- if (m_address_of_backend.get() != NULL)
+ if (m_address_of_backend.get() != nullptr)
return m_address_of_backend;
- if (m_impl_backend == NULL)
+ if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
if (m_live_address != LLDB_INVALID_ADDRESS) {
CompilerType compiler_type(m_impl_backend->GetCompilerType());
@@ -143,7 +143,7 @@ lldb::ValueObjectSP ValueObjectConstResultImpl::AddressOf(Status &error) {
lldb::ValueObjectSP
ValueObjectConstResultImpl::Cast(const CompilerType &compiler_type) {
- if (m_impl_backend == NULL)
+ if (m_impl_backend == nullptr)
return lldb::ValueObjectSP();
ValueObjectConstResultCast *result_cast =
@@ -156,7 +156,7 @@ lldb::addr_t
ValueObjectConstResultImpl::GetAddressOf(bool scalar_is_load_address,
AddressType *address_type) {
- if (m_impl_backend == NULL)
+ if (m_impl_backend == nullptr)
return 0;
if (m_live_address == LLDB_INVALID_ADDRESS) {
@@ -173,7 +173,7 @@ ValueObjectConstResultImpl::GetAddressOf(bool scalar_is_load_address,
size_t ValueObjectConstResultImpl::GetPointeeData(DataExtractor &data,
uint32_t item_idx,
uint32_t item_count) {
- if (m_impl_backend == NULL)
+ if (m_impl_backend == nullptr)
return 0;
return m_impl_backend->ValueObject::GetPointeeData(data, item_idx,
item_count);
diff --git a/lldb/source/Core/ValueObjectMemory.cpp b/lldb/source/Core/ValueObjectMemory.cpp
index 42d1263b390..95d4330ee0c 100644
--- a/lldb/source/Core/ValueObjectMemory.cpp
+++ b/lldb/source/Core/ValueObjectMemory.cpp
@@ -49,7 +49,7 @@ ValueObjectMemory::ValueObjectMemory(ExecutionContextScope *exe_scope,
: ValueObject(exe_scope), m_address(address), m_type_sp(type_sp),
m_compiler_type() {
// Do not attempt to construct one of these objects with no variable!
- assert(m_type_sp.get() != NULL);
+ assert(m_type_sp.get() != nullptr);
SetName(ConstString(name));
m_value.SetContext(Value::eContextTypeLLDBType, m_type_sp.get());
TargetSP target_sp(GetTargetSP());
diff --git a/lldb/source/Core/ValueObjectRegister.cpp b/lldb/source/Core/ValueObjectRegister.cpp
index 1d12747649e..75a254fbbc2 100644
--- a/lldb/source/Core/ValueObjectRegister.cpp
+++ b/lldb/source/Core/ValueObjectRegister.cpp
@@ -76,7 +76,7 @@ bool ValueObjectRegisterContext::UpdateValue() {
else
m_reg_ctx_sp.reset();
- if (m_reg_ctx_sp.get() == NULL) {
+ if (m_reg_ctx_sp.get() == nullptr) {
SetValueIsValid(false);
m_error.SetErrorToGenericError();
} else
@@ -87,7 +87,7 @@ bool ValueObjectRegisterContext::UpdateValue() {
ValueObject *ValueObjectRegisterContext::CreateChildAtIndex(
size_t idx, bool synthetic_array_member, int32_t synthetic_index) {
- ValueObject *new_valobj = NULL;
+ ValueObject *new_valobj = nullptr;
const size_t num_children = GetNumChildren();
if (idx < num_children) {
@@ -112,7 +112,7 @@ ValueObjectRegisterSet::Create(ExecutionContextScope *exe_scope,
ValueObjectRegisterSet::ValueObjectRegisterSet(ExecutionContextScope *exe_scope,
lldb::RegisterContextSP &reg_ctx,
uint32_t reg_set_idx)
- : ValueObject(exe_scope), m_reg_ctx_sp(reg_ctx), m_reg_set(NULL),
+ : ValueObject(exe_scope), m_reg_ctx_sp(reg_ctx), m_reg_set(nullptr),
m_reg_set_idx(reg_set_idx) {
assert(reg_ctx);
m_reg_set = reg_ctx->GetRegisterSet(m_reg_set_idx);
@@ -149,13 +149,13 @@ bool ValueObjectRegisterSet::UpdateValue() {
SetValueDidChange(false);
ExecutionContext exe_ctx(GetExecutionContextRef());
StackFrame *frame = exe_ctx.GetFramePtr();
- if (frame == NULL)
+ if (frame == nullptr)
m_reg_ctx_sp.reset();
else {
m_reg_ctx_sp = frame->GetRegisterContext();
if (m_reg_ctx_sp) {
const RegisterSet *reg_set = m_reg_ctx_sp->GetRegisterSet(m_reg_set_idx);
- if (reg_set == NULL)
+ if (reg_set == nullptr)
m_reg_ctx_sp.reset();
else if (m_reg_set != reg_set) {
SetValueDidChange(true);
@@ -175,7 +175,7 @@ bool ValueObjectRegisterSet::UpdateValue() {
ValueObject *ValueObjectRegisterSet::CreateChildAtIndex(
size_t idx, bool synthetic_array_member, int32_t synthetic_index) {
- ValueObject *valobj = NULL;
+ ValueObject *valobj = nullptr;
if (m_reg_ctx_sp && m_reg_set) {
const size_t num_children = GetNumChildren();
if (idx < num_children)
@@ -188,11 +188,11 @@ ValueObject *ValueObjectRegisterSet::CreateChildAtIndex(
lldb::ValueObjectSP
ValueObjectRegisterSet::GetChildMemberWithName(ConstString name,
bool can_create) {
- ValueObject *valobj = NULL;
+ ValueObject *valobj = nullptr;
if (m_reg_ctx_sp && m_reg_set) {
const RegisterInfo *reg_info =
m_reg_ctx_sp->GetRegisterInfoByName(name.AsCString());
- if (reg_info != NULL)
+ if (reg_info != nullptr)
valobj = new ValueObjectRegister(*this, m_reg_ctx_sp,
reg_info->kinds[eRegisterKindLLDB]);
}
@@ -207,7 +207,7 @@ ValueObjectRegisterSet::GetIndexOfChildWithName(ConstString name) {
if (m_reg_ctx_sp && m_reg_set) {
const RegisterInfo *reg_info =
m_reg_ctx_sp->GetRegisterInfoByName(name.AsCString());
- if (reg_info != NULL)
+ if (reg_info != nullptr)
return reg_info->kinds[eRegisterKindLLDB];
}
return UINT32_MAX;
@@ -289,7 +289,7 @@ bool ValueObjectRegister::UpdateValue() {
m_error.Clear();
ExecutionContext exe_ctx(GetExecutionContextRef());
StackFrame *frame = exe_ctx.GetFramePtr();
- if (frame == NULL) {
+ if (frame == nullptr) {
m_reg_ctx_sp.reset();
m_reg_value.Clear();
}
diff --git a/lldb/source/Core/ValueObjectVariable.cpp b/lldb/source/Core/ValueObjectVariable.cpp
index dae9c709ecd..5aee82493b2 100644
--- a/lldb/source/Core/ValueObjectVariable.cpp
+++ b/lldb/source/Core/ValueObjectVariable.cpp
@@ -57,7 +57,7 @@ ValueObjectVariable::ValueObjectVariable(ExecutionContextScope *exe_scope,
const lldb::VariableSP &var_sp)
: ValueObject(exe_scope), m_variable_sp(var_sp) {
// Do not attempt to construct one of these objects with no variable!
- assert(m_variable_sp.get() != NULL);
+ assert(m_variable_sp.get() != nullptr);
m_name = var_sp->GetName();
}
@@ -135,7 +135,7 @@ bool ValueObjectVariable::UpdateValue() {
else
m_error.SetErrorString("empty constant data");
// constant bytes can't be edited - sorry
- m_resolved_value.SetContext(Value::eContextTypeInvalid, NULL);
+ m_resolved_value.SetContext(Value::eContextTypeInvalid, nullptr);
} else {
lldb::addr_t loclist_base_load_addr = LLDB_INVALID_ADDRESS;
ExecutionContext exe_ctx(GetExecutionContextRef());
@@ -261,7 +261,7 @@ bool ValueObjectVariable::UpdateValue() {
SetValueIsValid(m_error.Success());
} else {
// could not find location, won't allow editing
- m_resolved_value.SetContext(Value::eContextTypeInvalid, NULL);
+ m_resolved_value.SetContext(Value::eContextTypeInvalid, nullptr);
}
}
return m_error.Success();
@@ -298,7 +298,7 @@ lldb::ModuleSP ValueObjectVariable::GetModule() {
SymbolContextScope *ValueObjectVariable::GetSymbolContextScope() {
if (m_variable_sp)
return m_variable_sp->GetSymbolContextScope();
- return NULL;
+ return nullptr;
}
bool ValueObjectVariable::GetDeclaration(Declaration &decl) {
diff --git a/lldb/source/DataFormatters/DataVisualization.cpp b/lldb/source/DataFormatters/DataVisualization.cpp
index 948aa71b8ac..08b3b34447b 100644
--- a/lldb/source/DataFormatters/DataVisualization.cpp
+++ b/lldb/source/DataFormatters/DataVisualization.cpp
@@ -89,7 +89,7 @@ bool DataVisualization::Categories::GetCategory(ConstString category,
lldb::TypeCategoryImplSP &entry,
bool allow_create) {
entry = GetFormatManager().GetCategory(category, allow_create);
- return (entry.get() != NULL);
+ return (entry.get() != nullptr);
}
bool DataVisualization::Categories::GetCategory(
diff --git a/lldb/source/DataFormatters/FormatManager.cpp b/lldb/source/DataFormatters/FormatManager.cpp
index 40d6407eade..dd2808a7cf7 100644
--- a/lldb/source/DataFormatters/FormatManager.cpp
+++ b/lldb/source/DataFormatters/FormatManager.cpp
@@ -146,7 +146,7 @@ char FormatManager::GetFormatAsFormatChar(lldb::Format format) {
const char *FormatManager::GetFormatAsCString(Format format) {
if (format >= eFormatDefault && format < kNumFormats)
return g_format_infos[format].format_name;
- return NULL;
+ return nullptr;
}
void FormatManager::EnableAllCategories() {
@@ -297,7 +297,7 @@ FormatManager::GetFormatForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeFormatImplSP format_current_sp =
category_sp->GetFormatForType(type_sp);
if (format_current_sp &&
- (format_chosen_sp.get() == NULL ||
+ (format_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
format_chosen_sp = format_current_sp;
@@ -321,7 +321,7 @@ FormatManager::GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeSummaryImplSP summary_current_sp =
category_sp->GetSummaryForType(type_sp);
if (summary_current_sp &&
- (summary_chosen_sp.get() == NULL ||
+ (summary_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
summary_chosen_sp = summary_current_sp;
@@ -345,7 +345,7 @@ FormatManager::GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeFilterImplSP filter_current_sp(
(TypeFilterImpl *)category_sp->GetFilterForType(type_sp).get());
if (filter_current_sp &&
- (filter_chosen_sp.get() == NULL ||
+ (filter_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
filter_chosen_sp = filter_current_sp;
@@ -370,7 +370,7 @@ FormatManager::GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp) {
(ScriptedSyntheticChildren *)category_sp->GetSyntheticForType(type_sp)
.get());
if (synth_current_sp &&
- (synth_chosen_sp.get() == NULL ||
+ (synth_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
synth_chosen_sp = synth_current_sp;
@@ -394,7 +394,7 @@ FormatManager::GetValidatorForType(lldb::TypeNameSpecifierImplSP type_sp) {
lldb::TypeValidatorImplSP validator_current_sp(
category_sp->GetValidatorForType(type_sp).get());
if (validator_current_sp &&
- (validator_chosen_sp.get() == NULL ||
+ (validator_chosen_sp.get() == nullptr ||
(prio_category > category_sp->GetEnabledPosition()))) {
prio_category = category_sp->GetEnabledPosition();
validator_chosen_sp = validator_current_sp;
diff --git a/lldb/source/DataFormatters/FormattersHelpers.cpp b/lldb/source/DataFormatters/FormattersHelpers.cpp
index b2bd1ebdfed..8f007df03fa 100644
--- a/lldb/source/DataFormatters/FormattersHelpers.cpp
+++ b/lldb/source/DataFormatters/FormattersHelpers.cpp
@@ -123,7 +123,7 @@ size_t lldb_private::formatters::ExtractIndexFromString(const char *item_name) {
if (*item_name != '[')
return UINT32_MAX;
item_name++;
- char *endptr = NULL;
+ char *endptr = nullptr;
unsigned long int idx = ::strtoul(item_name, &endptr, 0);
if (idx == 0 && endptr == item_name)
return UINT32_MAX;
diff --git a/lldb/source/DataFormatters/StringPrinter.cpp b/lldb/source/DataFormatters/StringPrinter.cpp
index 4dfe0250c3b..27d649bfc37 100644
--- a/lldb/source/DataFormatters/StringPrinter.cpp
+++ b/lldb/source/DataFormatters/StringPrinter.cpp
@@ -271,7 +271,7 @@ static bool DumpUTFBufferToStream(
llvm::ConversionFlags),
const StringPrinter::ReadBufferAndDumpToStreamOptions &dump_options) {
Stream &stream(*dump_options.GetStream());
- if (dump_options.GetPrefixToken() != 0)
+ if (dump_options.GetPrefixToken() != nullptr)
stream.Printf("%s", dump_options.GetPrefixToken());
if (dump_options.GetQuote() != 0)
stream.Printf("%c", dump_options.GetQuote());
@@ -373,7 +373,7 @@ static bool DumpUTFBufferToStream(
}
if (dump_options.GetQuote() != 0)
stream.Printf("%c", dump_options.GetQuote());
- if (dump_options.GetSuffixToken() != 0)
+ if (dump_options.GetSuffixToken() != nullptr)
stream.Printf("%s", dump_options.GetSuffixToken());
if (dump_options.GetIsTruncated())
stream.Printf("...");
@@ -449,7 +449,7 @@ bool StringPrinter::ReadStringAndDumpToStream<
const char *prefix_token = options.GetPrefixToken();
char quote = options.GetQuote();
- if (prefix_token != 0)
+ if (prefix_token != nullptr)
options.GetStream()->Printf("%s%c", prefix_token, quote);
else if (quote != 0)
options.GetStream()->Printf("%c", quote);
@@ -497,7 +497,7 @@ bool StringPrinter::ReadStringAndDumpToStream<
const char *suffix_token = options.GetSuffixToken();
- if (suffix_token != 0)
+ if (suffix_token != nullptr)
options.GetStream()->Printf("%c%s", quote, suffix_token);
else if (quote != 0)
options.GetStream()->Printf("%c", quote);
diff --git a/lldb/source/DataFormatters/TypeFormat.cpp b/lldb/source/DataFormatters/TypeFormat.cpp
index 72008b24316..b526e9a744b 100644
--- a/lldb/source/DataFormatters/TypeFormat.cpp
+++ b/lldb/source/DataFormatters/TypeFormat.cpp
@@ -69,7 +69,7 @@ bool TypeFormatImpl_Format::FormatObject(ValueObject *valobj,
// default value logic
if (GetFormat() == eFormatCString) {
lldb_private::Flags type_flags(compiler_type.GetTypeInfo(
- NULL)); // disambiguate w.r.t. TypeFormatImpl::Flags
+ nullptr)); // disambiguate w.r.t. TypeFormatImpl::Flags
if (type_flags.Test(eTypeIsPointer) &&
!type_flags.Test(eTypeIsObjC)) {
// if we are dumping a pointer as a c-string, get the pointee data
diff --git a/lldb/source/DataFormatters/TypeSynthetic.cpp b/lldb/source/DataFormatters/TypeSynthetic.cpp
index c40aed1f792..23c80fc58d0 100644
--- a/lldb/source/DataFormatters/TypeSynthetic.cpp
+++ b/lldb/source/DataFormatters/TypeSynthetic.cpp
@@ -128,7 +128,7 @@ lldb::ValueObjectSP SyntheticChildrenFrontEnd::CreateValueObjectFromData(
ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass,
ValueObject &backend)
: SyntheticChildrenFrontEnd(backend), m_python_class(pclass),
- m_wrapper_sp(), m_interpreter(NULL) {
+ m_wrapper_sp(), m_interpreter(nullptr) {
if (backend == LLDB_INVALID_UID)
return;
@@ -139,7 +139,7 @@ ScriptedSyntheticChildren::FrontEnd::FrontEnd(std::string pclass,
m_interpreter = target_sp->GetDebugger().GetScriptInterpreter();
- if (m_interpreter != NULL)
+ if (m_interpreter != nullptr)
m_wrapper_sp = m_interpreter->CreateSyntheticScriptedProvider(
m_python_class.c_str(), backend.GetSP());
}
@@ -159,26 +159,26 @@ bool ScriptedSyntheticChildren::FrontEnd::IsValid() {
}
size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return 0;
return m_interpreter->CalculateNumChildren(m_wrapper_sp, UINT32_MAX);
}
size_t ScriptedSyntheticChildren::FrontEnd::CalculateNumChildren(uint32_t max) {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return 0;
return m_interpreter->CalculateNumChildren(m_wrapper_sp, max);
}
bool ScriptedSyntheticChildren::FrontEnd::Update() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return false;
return m_interpreter->UpdateSynthProviderInstance(m_wrapper_sp);
}
bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return false;
return m_interpreter->MightHaveChildrenSynthProviderInstance(m_wrapper_sp);
@@ -186,21 +186,21 @@ bool ScriptedSyntheticChildren::FrontEnd::MightHaveChildren() {
size_t ScriptedSyntheticChildren::FrontEnd::GetIndexOfChildWithName(
ConstString name) {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return UINT32_MAX;
return m_interpreter->GetIndexOfChildWithName(m_wrapper_sp,
name.GetCString());
}
lldb::ValueObjectSP ScriptedSyntheticChildren::FrontEnd::GetSyntheticValue() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return nullptr;
return m_interpreter->GetSyntheticValue(m_wrapper_sp);
}
ConstString ScriptedSyntheticChildren::FrontEnd::GetSyntheticTypeName() {
- if (!m_wrapper_sp || m_interpreter == NULL)
+ if (!m_wrapper_sp || m_interpreter == nullptr)
return ConstString();
return m_interpreter->GetSyntheticTypeName(m_wrapper_sp);
diff --git a/lldb/source/DataFormatters/ValueObjectPrinter.cpp b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
index 5fe7e20bac1..409cffed9b0 100644
--- a/lldb/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/lldb/source/DataFormatters/ValueObjectPrinter.cpp
@@ -331,7 +331,7 @@ TypeSummaryImpl *ValueObjectPrinter::GetSummaryFormatter(bool null_if_omitted) {
: m_valobj->GetSummaryFormat().get();
if (m_options.m_omit_summary_depth > 0)
- entry = NULL;
+ entry = nullptr;
m_summary_formatter.first = entry;
m_summary_formatter.second = true;
}
@@ -415,8 +415,9 @@ bool ValueObjectPrinter::PrintValueAndSummaryIfNeeded(bool &value_printed,
// explicitly)
TypeSummaryImpl *entry = GetSummaryFormatter();
if (!IsNil() && !IsUninitialized() && !m_value.empty() &&
- (entry == NULL || (entry->DoesPrintValue(m_valobj) ||
- m_options.m_format != eFormatDefault) ||
+ (entry == nullptr ||
+ (entry->DoesPrintValue(m_valobj) ||
+ m_options.m_format != eFormatDefault) ||
m_summary.empty()) &&
!m_options.m_hide_value) {
if (m_options.m_hide_pointer_value &&
diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp
index 45c42dfad81..c86def753d9 100644
--- a/lldb/source/Expression/DWARFExpression.cpp
+++ b/lldb/source/Expression/DWARFExpression.cpp
@@ -649,7 +649,7 @@ static bool ReadRegisterValueAsScalar(RegisterContext *reg_ctx,
lldb::RegisterKind reg_kind,
uint32_t reg_num, Status *error_ptr,
Value &value) {
- if (reg_ctx == NULL) {
+ if (reg_ctx == nullptr) {
if (error_ptr)
error_ptr->SetErrorStringWithFormat("No register context in frame.\n");
} else {
@@ -1249,7 +1249,7 @@ bool DWARFExpression::Evaluate(ExecutionContext *exe_ctx,
if (IsLocationList()) {
lldb::offset_t offset = 0;
addr_t pc;
- StackFrame *frame = NULL;
+ StackFrame *frame = nullptr;
if (reg_ctx)
pc = reg_ctx->GetPC();
else {
@@ -1323,14 +1323,14 @@ bool DWARFExpression::Evaluate(
}
std::vector<Value> stack;
- Process *process = NULL;
- StackFrame *frame = NULL;
+ Process *process = nullptr;
+ StackFrame *frame = nullptr;
if (exe_ctx) {
process = exe_ctx->GetProcessPtr();
frame = exe_ctx->GetFramePtr();
}
- if (reg_ctx == NULL && frame)
+ if (reg_ctx == nullptr && frame)
reg_ctx = frame->GetRegisterContext().get();
if (initial_value_ptr)
@@ -3166,7 +3166,7 @@ void DWARFExpression::PrintDWARFLocationList(
s.Indent();
if (cu)
s.AddressRange(start_addr + base_addr, end_addr + base_addr,
- cu->GetAddressByteSize(), NULL, ": ");
+ cu->GetAddressByteSize(), nullptr, ": ");
uint32_t loc_length = debug_loc_data.GetU16(&offset);
DataExtractor locationData(debug_loc_data, offset, loc_length);
diff --git a/lldb/source/Expression/ExpressionVariable.cpp b/lldb/source/Expression/ExpressionVariable.cpp
index faac977cde9..97305dcf5a0 100644
--- a/lldb/source/Expression/ExpressionVariable.cpp
+++ b/lldb/source/Expression/ExpressionVariable.cpp
@@ -25,7 +25,7 @@ uint8_t *ExpressionVariable::GetValueBytes() {
return const_cast<uint8_t *>(
m_frozen_sp->GetDataExtractor().GetDataStart());
}
- return NULL;
+ return nullptr;
}
PersistentExpressionState::~PersistentExpressionState() {}
diff --git a/lldb/source/Expression/FunctionCaller.cpp b/lldb/source/Expression/FunctionCaller.cpp
index 5f5e3b86ccd..618c1a13212 100644
--- a/lldb/source/Expression/FunctionCaller.cpp
+++ b/lldb/source/Expression/FunctionCaller.cpp
@@ -35,10 +35,9 @@ FunctionCaller::FunctionCaller(ExecutionContextScope &exe_scope,
const Address &functionAddress,
const ValueList &arg_value_list,
const char *name)
- : Expression(exe_scope, eKindFunctionCaller),
- m_execution_unit_sp(), m_parser(),
- m_jit_module_wp(), m_name(name ? name : "<unknown>"),
- m_function_ptr(NULL), m_function_addr(functionAddress),
+ : Expression(exe_scope, eKindFunctionCaller), m_execution_unit_sp(),
+ m_parser(), m_jit_module_wp(), m_name(name ? name : "<unknown>"),
+ m_function_ptr(nullptr), m_function_addr(functionAddress),
m_function_return_type(return_type),
m_wrapper_function_name("__lldb_caller_function"),
m_wrapper_struct_name("__lldb_caller_struct"), m_wrapper_args_addrs(),
@@ -138,7 +137,7 @@ bool FunctionCaller::WriteFunctionArguments(
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return return_value;
lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock());
@@ -239,11 +238,11 @@ lldb::ThreadPlanSP FunctionCaller::GetThreadPlanToCallFunction(
// FIXME: Use the errors Stream for better error reporting.
Thread *thread = exe_ctx.GetThreadPtr();
- if (thread == NULL) {
+ if (thread == nullptr) {
diagnostic_manager.PutString(
eDiagnosticSeverityError,
"Can't call a function without a valid thread.");
- return NULL;
+ return nullptr;
}
// Okay, now run the function:
@@ -279,7 +278,7 @@ bool FunctionCaller::FetchFunctionResults(ExecutionContext &exe_ctx,
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL)
+ if (process == nullptr)
return false;
lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock());
@@ -326,7 +325,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
lldb::addr_t args_addr;
- if (args_addr_ptr != NULL)
+ if (args_addr_ptr != nullptr)
args_addr = *args_addr_ptr;
else
args_addr = LLDB_INVALID_ADDRESS;
@@ -376,7 +375,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
if (exe_ctx.GetProcessPtr())
exe_ctx.GetProcessPtr()->SetRunningUserExpression(false);
- if (args_addr_ptr != NULL)
+ if (args_addr_ptr != nullptr)
*args_addr_ptr = args_addr;
if (return_value != lldb::eExpressionCompleted)
@@ -384,7 +383,7 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
FetchFunctionResults(exe_ctx, args_addr, results);
- if (args_addr_ptr == NULL)
+ if (args_addr_ptr == nullptr)
DeallocateFunctionResults(exe_ctx, args_addr);
return lldb::eExpressionCompleted;
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index 7c0379cdee8..34a3488578c 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -165,8 +165,8 @@ Status IRExecutionUnit::DisassembleFunction(Stream &stream,
ArchSpec arch(target->GetArchitecture());
- const char *plugin_name = NULL;
- const char *flavor_string = NULL;
+ const char *plugin_name = nullptr;
+ const char *flavor_string = nullptr;
lldb::DisassemblerSP disassembler_sp =
Disassembler::FindPlugin(arch, flavor_string, plugin_name);
@@ -251,7 +251,7 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
std::string s;
llvm::raw_string_ostream oss(s);
- m_module->print(oss, NULL);
+ m_module->print(oss, nullptr);
oss.flush();
@@ -839,7 +839,7 @@ lldb::addr_t IRExecutionUnit::FindInSymbols(
};
if (sc.module_sp) {
- sc.module_sp->FindFunctions(spec.name, NULL, spec.mask,
+ sc.module_sp->FindFunctions(spec.name, nullptr, spec.mask,
true, // include_symbols
false, // include_inlines
true, // append
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp
index 85eb78f539d..24a3cd24fdd 100644
--- a/lldb/source/Expression/IRInterpreter.cpp
+++ b/lldb/source/Expression/IRInterpreter.cpp
@@ -654,7 +654,7 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function,
std::string s;
raw_string_ostream oss(s);
- module.print(oss, NULL);
+ module.print(oss, nullptr);
oss.flush();
diff --git a/lldb/source/Expression/IRMemoryMap.cpp b/lldb/source/Expression/IRMemoryMap.cpp
index a8bf6733d8d..70e62ac12b0 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -263,7 +263,7 @@ ExecutionContextScope *IRMemoryMap::GetBestExecutionContextScope() const {
if (target_sp)
return target_sp.get();
- return NULL;
+ return nullptr;
}
IRMemoryMap::Allocation::Allocation(lldb::addr_t process_alloc,
diff --git a/lldb/source/Expression/LLVMUserExpression.cpp b/lldb/source/Expression/LLVMUserExpression.cpp
index 6f5972b32bb..5a1b750318c 100644
--- a/lldb/source/Expression/LLVMUserExpression.cpp
+++ b/lldb/source/Expression/LLVMUserExpression.cpp
@@ -50,7 +50,7 @@ LLVMUserExpression::LLVMUserExpression(ExecutionContextScope &exe_scope,
m_allow_objc(false), m_transformed_text(), m_execution_unit_sp(),
m_materializer_up(), m_jit_module_wp(), m_enforce_valid_object(true),
m_in_cplusplus_method(false), m_in_objectivec_method(false),
- m_in_static_method(false), m_needs_object_ptr(false), m_target(NULL),
+ m_in_static_method(false), m_needs_object_ptr(false), m_target(nullptr),
m_can_interpret(false), m_materialized_address(LLDB_INVALID_ADDRESS) {}
LLVMUserExpression::~LLVMUserExpression() {
@@ -181,7 +181,7 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
if (execution_result == lldb::eExpressionInterrupted ||
execution_result == lldb::eExpressionHitBreakpoint) {
- const char *error_desc = NULL;
+ const char *error_desc = nullptr;
if (call_plan_sp) {
lldb::StopInfoSP real_stop_info_sp = call_plan_sp->GetRealStopInfo();
diff --git a/lldb/source/Expression/UserExpression.cpp b/lldb/source/Expression/UserExpression.cpp
index 47aadba3578..a72e2a07599 100644
--- a/lldb/source/Expression/UserExpression.cpp
+++ b/lldb/source/Expression/UserExpression.cpp
@@ -174,7 +174,7 @@ lldb::ExpressionResults UserExpression::Evaluate(
Process *process = exe_ctx.GetProcessPtr();
- if (process == NULL || process->GetState() != lldb::eStateStopped) {
+ if (process == nullptr || process->GetState() != lldb::eStateStopped) {
if (execution_policy == eExecutionPolicyAlways) {
if (log)
log->Printf("== [UserExpression::Evaluate] Expression may not run, but "
@@ -186,7 +186,7 @@ lldb::ExpressionResults UserExpression::Evaluate(
}
}
- if (process == NULL || !process->CanJIT())
+ if (process == nullptr || !process->CanJIT())
execution_policy = eExecutionPolicyNever;
// We need to set the expression execution thread here, turns out parse can
@@ -375,7 +375,7 @@ lldb::ExpressionResults UserExpression::Evaluate(
return lldb::eExpressionInterrupted;
}
- if (result_valobj_sp.get() == NULL) {
+ if (result_valobj_sp.get() == nullptr) {
result_valobj_sp = ValueObjectConstResult::Create(
exe_ctx.GetBestExecutionContextScope(), error);
}
diff --git a/lldb/source/Host/common/Editline.cpp b/lldb/source/Host/common/Editline.cpp
index 2b647be572a..d3a70aeaa32 100644
--- a/lldb/source/Host/common/Editline.cpp
+++ b/lldb/source/Host/common/Editline.cpp
@@ -163,7 +163,7 @@ private:
// Use static GetHistory() function to get a EditlineHistorySP to one of
// these objects
EditlineHistory(const std::string &prefix, uint32_t size, bool unique_entries)
- : m_history(NULL), m_event(), m_prefix(prefix), m_path() {
+ : m_history(nullptr), m_event(), m_prefix(prefix), m_path() {
m_history = history_winit();
history_w(m_history, &m_event, H_SETSIZE, size);
if (unique_entries)
@@ -202,7 +202,7 @@ public:
if (m_history) {
history_wend(m_history);
- m_history = NULL;
+ m_history = nullptr;
}
}
@@ -224,7 +224,7 @@ public:
return history_sp;
}
- bool IsValid() const { return m_history != NULL; }
+ bool IsValid() const { return m_history != nullptr; }
HistoryW *GetHistoryPtr() { return m_history; }
@@ -514,11 +514,13 @@ int Editline::GetCharacter(EditLineGetCharType *c) {
// Read returns, immediately lock the mutex again and check if we were
// interrupted.
m_output_mutex.unlock();
- int read_count = m_input_connection.Read(&ch, 1, llvm::None, status, NULL);
+ int read_count =
+ m_input_connection.Read(&ch, 1, llvm::None, status, nullptr);
m_output_mutex.lock();
if (m_editor_status == EditorStatus::Interrupted) {
while (read_count > 0 && status == lldb::eConnectionStatusSuccess)
- read_count = m_input_connection.Read(&ch, 1, llvm::None, status, NULL);
+ read_count =
+ m_input_connection.Read(&ch, 1, llvm::None, status, nullptr);
lldbassert(status == lldb::eConnectionStatusInterrupted);
return 0;
}
@@ -1081,7 +1083,7 @@ void Editline::ConfigureEditor(bool multiline) {
// Allow user-specific customization prior to registering bindings we
// absolutely require
- el_source(m_editline, NULL);
+ el_source(m_editline, nullptr);
// Register an internal binding that external developers shouldn't use
el_wset(m_editline, EL_ADDFN, EditLineConstString("lldb-revert-line"),
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 85e625ca78f..c8c8d7a0d49 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -65,11 +65,11 @@ static const char *GetStreamOpenModeFromOptions(uint32_t options) {
} else if (options & File::eOpenOptionWrite) {
return "w";
}
- return NULL;
+ return nullptr;
}
int File::kInvalidDescriptor = -1;
-FILE *File::kInvalidStream = NULL;
+FILE *File::kInvalidStream = nullptr;
File::~File() { Close(); }
@@ -634,9 +634,9 @@ size_t File::Printf(const char *format, ...) {
size_t File::PrintfVarArg(const char *format, va_list args) {
size_t result = 0;
if (DescriptorIsValid()) {
- char *s = NULL;
+ char *s = nullptr;
result = vasprintf(&s, format, args);
- if (s != NULL) {
+ if (s != nullptr) {
if (result > 0) {
size_t s_len = result;
Write(s, s_len);
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index d3e41a2b044..be206406e93 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -112,7 +112,7 @@ HostThread Host::StartMonitoringChildProcess(
::snprintf(thread_name, sizeof(thread_name),
"<lldb.host.wait4(pid=%" PRIu64 ")>", pid);
return ThreadLauncher::LaunchThread(
- thread_name, MonitorChildProcessThreadFunction, info_ptr, NULL);
+ thread_name, MonitorChildProcessThreadFunction, info_ptr, nullptr);
}
#ifndef __linux__
@@ -219,7 +219,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
bool exited = false;
int signal = 0;
int exit_status = 0;
- const char *status_cstr = NULL;
+ const char *status_cstr = nullptr;
if (WIFSTOPPED(status)) {
signal = WSTOPSIG(status);
status_cstr = "STOPPED";
@@ -282,7 +282,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
if (log)
log->Printf("%s (arg = %p) thread exiting...", __FUNCTION__, arg);
- return NULL;
+ return nullptr;
}
#endif // #if !defined (__APPLE__) && !defined (_WIN32)
@@ -393,7 +393,7 @@ const char *Host::GetSignalAsCString(int signo) {
default:
break;
}
- return NULL;
+ return nullptr;
}
#endif
diff --git a/lldb/source/Host/common/HostNativeThreadBase.cpp b/lldb/source/Host/common/HostNativeThreadBase.cpp
index a5f876a7232..82f519e14f1 100644
--- a/lldb/source/Host/common/HostNativeThreadBase.cpp
+++ b/lldb/source/Host/common/HostNativeThreadBase.cpp
@@ -18,10 +18,10 @@ using namespace lldb;
using namespace lldb_private;
HostNativeThreadBase::HostNativeThreadBase()
- : m_thread(LLDB_INVALID_HOST_THREAD), m_result(0) {}
+ : m_thread(LLDB_INVALID_HOST_THREAD), m_result(nullptr) {}
HostNativeThreadBase::HostNativeThreadBase(thread_t thread)
- : m_thread(thread), m_result(0) {}
+ : m_thread(thread), m_result(nullptr) {}
lldb::thread_t HostNativeThreadBase::GetSystemHandle() const {
return m_thread;
@@ -37,7 +37,7 @@ bool HostNativeThreadBase::IsJoinable() const {
void HostNativeThreadBase::Reset() {
m_thread = LLDB_INVALID_HOST_THREAD;
- m_result = 0;
+ m_result = nullptr;
}
bool HostNativeThreadBase::EqualsThread(lldb::thread_t thread) const {
@@ -47,7 +47,7 @@ bool HostNativeThreadBase::EqualsThread(lldb::thread_t thread) const {
lldb::thread_t HostNativeThreadBase::Release() {
lldb::thread_t result = m_thread;
m_thread = LLDB_INVALID_HOST_THREAD;
- m_result = 0;
+ m_result = nullptr;
return result;
}
diff --git a/lldb/source/Host/common/OptionParser.cpp b/lldb/source/Host/common/OptionParser.cpp
index 97704988d36..92ff6f63d95 100644
--- a/lldb/source/Host/common/OptionParser.cpp
+++ b/lldb/source/Host/common/OptionParser.cpp
@@ -55,11 +55,11 @@ std::string OptionParser::GetShortOptionString(struct option *long_options) {
int i = 0;
bool done = false;
while (!done) {
- if (long_options[i].name == 0 && long_options[i].has_arg == 0 &&
- long_options[i].flag == 0 && long_options[i].val == 0) {
+ if (long_options[i].name == nullptr && long_options[i].has_arg == 0 &&
+ long_options[i].flag == nullptr && long_options[i].val == 0) {
done = true;
} else {
- if (long_options[i].flag == NULL && isalpha(long_options[i].val)) {
+ if (long_options[i].flag == nullptr && isalpha(long_options[i].val)) {
s.append(1, (char)long_options[i].val);
switch (long_options[i].has_arg) {
default:
diff --git a/lldb/source/Host/common/ProcessRunLock.cpp b/lldb/source/Host/common/ProcessRunLock.cpp
index 65a5dcca31f..a931da71876 100644
--- a/lldb/source/Host/common/ProcessRunLock.cpp
+++ b/lldb/source/Host/common/ProcessRunLock.cpp
@@ -12,7 +12,7 @@
namespace lldb_private {
ProcessRunLock::ProcessRunLock() : m_running(false) {
- int err = ::pthread_rwlock_init(&m_rwlock, NULL);
+ int err = ::pthread_rwlock_init(&m_rwlock, nullptr);
(void)err;
}
diff --git a/lldb/source/Host/common/SocketAddress.cpp b/lldb/source/Host/common/SocketAddress.cpp
index 06171d49bf6..882fd24558f 100644
--- a/lldb/source/Host/common/SocketAddress.cpp
+++ b/lldb/source/Host/common/SocketAddress.cpp
@@ -236,11 +236,11 @@ SocketAddress::GetAddressInfo(const char *hostname, const char *servname,
hints.ai_protocol = ai_protocol;
hints.ai_flags = ai_flags;
- struct addrinfo *service_info_list = NULL;
+ struct addrinfo *service_info_list = nullptr;
int err = ::getaddrinfo(hostname, servname, &hints, &service_info_list);
if (err == 0 && service_info_list) {
- for (struct addrinfo *service_ptr = service_info_list; service_ptr != NULL;
- service_ptr = service_ptr->ai_next) {
+ for (struct addrinfo *service_ptr = service_info_list;
+ service_ptr != nullptr; service_ptr = service_ptr->ai_next) {
addr_list.emplace_back(SocketAddress(service_ptr));
}
}
diff --git a/lldb/source/Host/common/TCPSocket.cpp b/lldb/source/Host/common/TCPSocket.cpp
index 3f11e4e3b49..f97ca9eb55b 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -143,7 +143,7 @@ Status TCPSocket::Connect(llvm::StringRef name) {
return error;
auto addresses = lldb_private::SocketAddress::GetAddressInfo(
- host_str.c_str(), NULL, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
+ host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
for (auto address : addresses) {
error = CreateSocket(address.GetFamily());
if (error.Fail())
@@ -182,7 +182,7 @@ Status TCPSocket::Listen(llvm::StringRef name, int backlog) {
if (host_str == "*")
host_str = "0.0.0.0";
auto addresses = lldb_private::SocketAddress::GetAddressInfo(
- host_str.c_str(), NULL, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
+ host_str.c_str(), nullptr, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
for (auto address : addresses) {
int fd = Socket::CreateSocket(address.GetFamily(), kType, IPPROTO_TCP,
m_child_processes_inherit, error);
diff --git a/lldb/source/Host/common/TaskPool.cpp b/lldb/source/Host/common/TaskPool.cpp
index 062fa4abd06..d63d9f35d1e 100644
--- a/lldb/source/Host/common/TaskPool.cpp
+++ b/lldb/source/Host/common/TaskPool.cpp
@@ -73,7 +73,7 @@ void TaskPoolImpl::AddTask(std::function<void()> &&task_fn) {
lldb::thread_result_t TaskPoolImpl::WorkerPtr(void *pool) {
Worker((TaskPoolImpl *)pool);
- return 0;
+ return nullptr;
}
void TaskPoolImpl::Worker(TaskPoolImpl *pool) {
diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp
index 9c60f0d1190..4b536b03d85 100644
--- a/lldb/source/Host/common/Terminal.cpp
+++ b/lldb/source/Host/common/Terminal.cpp
@@ -112,7 +112,7 @@ bool TerminalState::Save(int fd, bool save_process_group) {
m_tflags = ::fcntl(fd, F_GETFL, 0);
#endif
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
- if (m_termios_up == NULL)
+ if (m_termios_up == nullptr)
m_termios_up.reset(new struct termios);
int err = ::tcgetattr(fd, m_termios_up.get());
if (err != 0)
@@ -151,7 +151,7 @@ bool TerminalState::Restore() const {
if (ProcessGroupIsValid()) {
// Save the original signal handler.
- void (*saved_sigttou_callback)(int) = NULL;
+ void (*saved_sigttou_callback)(int) = nullptr;
saved_sigttou_callback = (void (*)(int))signal(SIGTTOU, SIG_IGN);
// Set the process group
tcsetpgrp(fd, m_process_group);
@@ -177,7 +177,7 @@ bool TerminalState::TFlagsIsValid() const { return m_tflags != -1; }
// Returns true if m_ttystate is valid
bool TerminalState::TTYStateIsValid() const {
#ifdef LLDB_CONFIG_TERMIOS_SUPPORTED
- return m_termios_up != 0;
+ return m_termios_up != nullptr;
#else
return false;
#endif
diff --git a/lldb/source/Host/common/ThreadLauncher.cpp b/lldb/source/Host/common/ThreadLauncher.cpp
index ede864db108..2eff981bfa8 100644
--- a/lldb/source/Host/common/ThreadLauncher.cpp
+++ b/lldb/source/Host/common/ThreadLauncher.cpp
@@ -49,7 +49,7 @@ HostThread ThreadLauncher::LaunchThread(llvm::StringRef name,
}
#endif
- pthread_attr_t *thread_attr_ptr = NULL;
+ pthread_attr_t *thread_attr_ptr = nullptr;
pthread_attr_t thread_attr;
bool destroy_attr = false;
if (min_stack_byte_size > 0) {
diff --git a/lldb/source/Host/common/XML.cpp b/lldb/source/Host/common/XML.cpp
index 006b49f4e10..cb23ac17ef5 100644
--- a/lldb/source/Host/common/XML.cpp
+++ b/lldb/source/Host/common/XML.cpp
@@ -134,7 +134,7 @@ XMLNode XMLNode::GetChild() const {
llvm::StringRef XMLNode::GetAttributeValue(const char *name,
const char *fail_value) const {
- const char *attr_value = NULL;
+ const char *attr_value = nullptr;
#if defined(LIBXML2_DEFINED)
if (IsValid())
diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp
index 03fa798f0f5..f6a8766a71c 100644
--- a/lldb/source/Host/linux/Host.cpp
+++ b/lldb/source/Host/linux/Host.cpp
@@ -216,12 +216,12 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info,
DIR *dirproc = opendir(procdir);
if (dirproc) {
- struct dirent *direntry = NULL;
+ struct dirent *direntry = nullptr;
const uid_t our_uid = getuid();
const lldb::pid_t our_pid = getpid();
bool all_users = match_info.GetMatchAllUsers();
- while ((direntry = readdir(dirproc)) != NULL) {
+ while ((direntry = readdir(dirproc)) != nullptr) {
if (direntry->d_type != DT_DIR || !IsDirNumeric(direntry->d_name))
continue;
@@ -269,8 +269,8 @@ bool Host::FindProcessThreads(const lldb::pid_t pid, TidMap &tids_to_attach) {
DIR *dirproc = opendir(process_task_dir.c_str());
if (dirproc) {
- struct dirent *direntry = NULL;
- while ((direntry = readdir(dirproc)) != NULL) {
+ struct dirent *direntry = nullptr;
+ while ((direntry = readdir(dirproc)) != nullptr) {
if (direntry->d_type != DT_DIR || !IsDirNumeric(direntry->d_name))
continue;
diff --git a/lldb/source/Host/linux/HostInfoLinux.cpp b/lldb/source/Host/linux/HostInfoLinux.cpp
index 2b2207e7afa..78dd77b61fa 100644
--- a/lldb/source/Host/linux/HostInfoLinux.cpp
+++ b/lldb/source/Host/linux/HostInfoLinux.cpp
@@ -121,7 +121,8 @@ llvm::StringRef HostInfoLinux::GetDistributionId() {
// retrieve the distribution id string.
char distribution_id[256] = {'\0'};
- if (fgets(distribution_id, sizeof(distribution_id) - 1, file) != NULL) {
+ if (fgets(distribution_id, sizeof(distribution_id) - 1, file) !=
+ nullptr) {
if (log)
log->Printf("distribution id command returned \"%s\"",
distribution_id);
diff --git a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
index 4bbebd627d4..167569dca69 100644
--- a/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
+++ b/lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
@@ -111,7 +111,7 @@ ConnectionFileDescriptor::~ConnectionFileDescriptor() {
if (log)
log->Printf("%p ConnectionFileDescriptor::~ConnectionFileDescriptor ()",
static_cast<void *>(this));
- Disconnect(NULL);
+ Disconnect(nullptr);
CloseCommandPipe();
}
diff --git a/lldb/source/Host/posix/HostThreadPosix.cpp b/lldb/source/Host/posix/HostThreadPosix.cpp
index caa137ae3d0..d78bba517f6 100644
--- a/lldb/source/Host/posix/HostThreadPosix.cpp
+++ b/lldb/source/Host/posix/HostThreadPosix.cpp
@@ -29,7 +29,7 @@ Status HostThreadPosix::Join(lldb::thread_result_t *result) {
error.SetError(err, lldb::eErrorTypePOSIX);
} else {
if (result)
- *result = NULL;
+ *result = nullptr;
error.SetError(EINVAL, eErrorTypePOSIX);
}
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index f6027636bd3..b951cce8c59 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1739,7 +1739,7 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
log->Printf("HandleCommand, (revised) command_string: '%s'",
command_string.c_str());
const bool wants_raw_input =
- (cmd_obj != NULL) ? cmd_obj->WantsRawCommandString() : false;
+ (cmd_obj != nullptr) ? cmd_obj->WantsRawCommandString() : false;
log->Printf("HandleCommand, wants_raw_input:'%s'",
wants_raw_input ? "True" : "False");
}
@@ -2214,7 +2214,7 @@ void CommandInterpreter::SourceInitFileHome(CommandReturnObject &result) {
const char *CommandInterpreter::GetCommandPrefix() {
const char *prefix = GetDebugger().GetIOHandlerCommandPrefix();
- return prefix == NULL ? "" : prefix;
+ return prefix == nullptr ? "" : prefix;
}
PlatformSP CommandInterpreter::GetPlatform(bool prefer_target_platform) {
@@ -3206,7 +3206,7 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line,
if (!scratch_command.empty())
revised_command_line.Printf(" %s", scratch_command.c_str());
- if (cmd_obj != NULL)
+ if (cmd_obj != nullptr)
command_line = revised_command_line.GetString();
return cmd_obj;
diff --git a/lldb/source/Interpreter/OptionValue.cpp b/lldb/source/Interpreter/OptionValue.cpp
index f45109f31fb..00c8642595b 100644
--- a/lldb/source/Interpreter/OptionValue.cpp
+++ b/lldb/source/Interpreter/OptionValue.cpp
@@ -165,13 +165,13 @@ const OptionValueFormat *OptionValue::GetAsFormat() const {
OptionValueLanguage *OptionValue::GetAsLanguage() {
if (GetType() == OptionValue::eTypeLanguage)
return static_cast<OptionValueLanguage *>(this);
- return NULL;
+ return nullptr;
}
const OptionValueLanguage *OptionValue::GetAsLanguage() const {
if (GetType() == OptionValue::eTypeLanguage)
return static_cast<const OptionValueLanguage *>(this);
- return NULL;
+ return nullptr;
}
OptionValueFormatEntity *OptionValue::GetAsFormatEntity() {
@@ -520,7 +520,7 @@ lldb::OptionValueSP OptionValue::CreateValueFromCStringForTypeMask(
value_sp.reset(new OptionValueFormat(eFormatInvalid));
break;
case 1u << eTypeFormatEntity:
- value_sp.reset(new OptionValueFormatEntity(NULL));
+ value_sp.reset(new OptionValueFormatEntity(nullptr));
break;
case 1u << eTypeLanguage:
value_sp.reset(new OptionValueLanguage(eLanguageTypeUnknown));
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
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 72a33739245..62321d13564 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -6894,7 +6894,7 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
} else {
child_is_deref_of_parent = true;
const char *parent_name =
- valobj ? valobj->GetName().GetCString() : NULL;
+ valobj ? valobj->GetName().GetCString() : nullptr;
if (parent_name) {
child_name.assign(1, '*');
child_name += parent_name;
@@ -6975,7 +6975,7 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
child_is_deref_of_parent = true;
const char *parent_name =
- valobj ? valobj->GetName().GetCString() : NULL;
+ valobj ? valobj->GetName().GetCString() : nullptr;
if (parent_name) {
child_name.assign(1, '*');
child_name += parent_name;
@@ -7012,7 +7012,7 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
language_flags);
} else {
const char *parent_name =
- valobj ? valobj->GetName().GetCString() : NULL;
+ valobj ? valobj->GetName().GetCString() : nullptr;
if (parent_name) {
child_name.assign(1, '&');
child_name += parent_name;
@@ -7842,7 +7842,7 @@ clang::EnumDecl *ClangASTContext::GetAsEnumDecl(const CompilerType &type) {
llvm::dyn_cast<clang::EnumType>(ClangUtil::GetCanonicalQualType(type));
if (enutype)
return enutype->getDecl();
- return NULL;
+ return nullptr;
}
clang::RecordDecl *ClangASTContext::GetAsRecordDecl(const CompilerType &type) {
@@ -8261,7 +8261,7 @@ clang::CXXMethodDecl *ClangASTContext::AddMethodToCXXRecordType(
if (is_attr_used)
cxx_method_decl->addAttr(clang::UsedAttr::CreateImplicit(*getASTContext()));
- if (mangled_name != NULL) {
+ if (mangled_name != nullptr) {
cxx_method_decl->addAttr(
clang::AsmLabelAttr::CreateImplicit(*getASTContext(), mangled_name));
}
@@ -9868,7 +9868,7 @@ clang::ClassTemplateDecl *ClangASTContext::ParseClassTemplateDecl(
template_basename.c_str(), tag_decl_kind,
template_param_infos);
}
- return NULL;
+ return nullptr;
}
void ClangASTContext::CompleteTagDecl(void *baton, clang::TagDecl *decl) {
diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp
index fa37ba316cf..3a9a8f3c4cd 100644
--- a/lldb/source/Symbol/ClangASTImporter.cpp
+++ b/lldb/source/Symbol/ClangASTImporter.cpp
@@ -346,7 +346,7 @@ bool ClangASTImporter::CanImport(const CompilerType &type) {
const clang::CXXRecordDecl *cxx_record_decl =
qual_type->getAsCXXRecordDecl();
if (cxx_record_decl) {
- if (ResolveDeclOrigin(cxx_record_decl, NULL, NULL))
+ if (ResolveDeclOrigin(cxx_record_decl, nullptr, nullptr))
return true;
}
} break;
@@ -355,7 +355,7 @@ bool ClangASTImporter::CanImport(const CompilerType &type) {
clang::EnumDecl *enum_decl =
llvm::cast<clang::EnumType>(qual_type)->getDecl();
if (enum_decl) {
- if (ResolveDeclOrigin(enum_decl, NULL, NULL))
+ if (ResolveDeclOrigin(enum_decl, nullptr, nullptr))
return true;
}
} break;
@@ -370,7 +370,7 @@ bool ClangASTImporter::CanImport(const CompilerType &type) {
// We currently can't complete objective C types through the newly added
// ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
- if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
+ if (ResolveDeclOrigin(class_interface_decl, nullptr, nullptr))
return true;
}
}
@@ -422,7 +422,7 @@ bool ClangASTImporter::Import(const CompilerType &type) {
const clang::CXXRecordDecl *cxx_record_decl =
qual_type->getAsCXXRecordDecl();
if (cxx_record_decl) {
- if (ResolveDeclOrigin(cxx_record_decl, NULL, NULL))
+ if (ResolveDeclOrigin(cxx_record_decl, nullptr, nullptr))
return CompleteAndFetchChildren(qual_type);
}
} break;
@@ -431,7 +431,7 @@ bool ClangASTImporter::Import(const CompilerType &type) {
clang::EnumDecl *enum_decl =
llvm::cast<clang::EnumType>(qual_type)->getDecl();
if (enum_decl) {
- if (ResolveDeclOrigin(enum_decl, NULL, NULL))
+ if (ResolveDeclOrigin(enum_decl, nullptr, nullptr))
return CompleteAndFetchChildren(qual_type);
}
} break;
@@ -446,7 +446,7 @@ bool ClangASTImporter::Import(const CompilerType &type) {
// We currently can't complete objective C types through the newly added
// ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
- if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
+ if (ResolveDeclOrigin(class_interface_decl, nullptr, nullptr))
return CompleteAndFetchChildren(qual_type);
}
}
diff --git a/lldb/source/Symbol/CompactUnwindInfo.cpp b/lldb/source/Symbol/CompactUnwindInfo.cpp
index d2e176b141f..3a2a4d3a09e 100644
--- a/lldb/source/Symbol/CompactUnwindInfo.cpp
+++ b/lldb/source/Symbol/CompactUnwindInfo.cpp
@@ -186,7 +186,7 @@ bool CompactUnwindInfo::GetUnwindPlan(Target &target, Address addr,
if (log && log->GetVerbose()) {
StreamString strm;
addr.Dump(
- &strm, NULL,
+ &strm, nullptr,
Address::DumpStyle::DumpStyleResolvedDescriptionNoFunctionArguments,
Address::DumpStyle::DumpStyleFileAddress,
arch.GetAddressByteSize());
diff --git a/lldb/source/Symbol/CompilerType.cpp b/lldb/source/Symbol/CompilerType.cpp
index a727568d75b..98061d2d334 100644
--- a/lldb/source/Symbol/CompilerType.cpp
+++ b/lldb/source/Symbol/CompilerType.cpp
@@ -995,7 +995,7 @@ bool CompilerType::ReadFromMemory(lldb_private::ExecutionContext *exe_ctx,
return false;
auto byte_size =
- GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
+ GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr);
if (!byte_size)
return false;
@@ -1040,7 +1040,7 @@ bool CompilerType::WriteToMemory(lldb_private::ExecutionContext *exe_ctx,
return false;
auto byte_size =
- GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : NULL);
+ GetByteSize(exe_ctx ? exe_ctx->GetBestExecutionContextScope() : nullptr);
if (!byte_size)
return false;
diff --git a/lldb/source/Symbol/LocateSymbolFile.cpp b/lldb/source/Symbol/LocateSymbolFile.cpp
index 033594bae35..bfdb6e705f4 100644
--- a/lldb/source/Symbol/LocateSymbolFile.cpp
+++ b/lldb/source/Symbol/LocateSymbolFile.cpp
@@ -55,9 +55,10 @@ static bool FileAtPathContainsArchAndUUID(const FileSpec &file_fspec,
bool got_spec = module_specs.GetModuleSpecAtIndex(i, spec);
UNUSED_IF_ASSERT_DISABLED(got_spec);
assert(got_spec);
- if ((uuid == NULL || (spec.GetUUIDPtr() && spec.GetUUID() == *uuid)) &&
- (arch == NULL || (spec.GetArchitecturePtr() &&
- spec.GetArchitecture().IsCompatibleMatch(*arch)))) {
+ if ((uuid == nullptr || (spec.GetUUIDPtr() && spec.GetUUID() == *uuid)) &&
+ (arch == nullptr ||
+ (spec.GetArchitecturePtr() &&
+ spec.GetArchitecture().IsCompatibleMatch(*arch)))) {
return true;
}
}
diff --git a/lldb/source/Symbol/SymbolContext.cpp b/lldb/source/Symbol/SymbolContext.cpp
index 187a7b17215..1b7b3ce5486 100644
--- a/lldb/source/Symbol/SymbolContext.cpp
+++ b/lldb/source/Symbol/SymbolContext.cpp
@@ -501,7 +501,7 @@ bool SymbolContext::GetParentOfInlinedScope(const Address &curr_frame_pc,
}
#ifdef LLDB_CONFIGURATION_DEBUG
else {
- ObjectFile *objfile = NULL;
+ ObjectFile *objfile = nullptr;
if (module_sp) {
SymbolVendor *symbol_vendor = module_sp->GetSymbolVendor();
if (symbol_vendor) {
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 4670d7738c3..f5861c291f2 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -1149,5 +1149,5 @@ const Symbol *Symtab::GetParent(Symbol *child_symbol) const {
return symbol;
}
}
- return NULL;
+ return nullptr;
}
diff --git a/lldb/source/Symbol/Type.cpp b/lldb/source/Symbol/Type.cpp
index 35c1a265f82..4ee8330ce28 100644
--- a/lldb/source/Symbol/Type.cpp
+++ b/lldb/source/Symbol/Type.cpp
@@ -978,7 +978,7 @@ TypeSystem *TypeImpl::GetTypeSystem(bool prefer_dynamic) {
}
return m_static_type.GetTypeSystem();
}
- return NULL;
+ return nullptr;
}
bool TypeImpl::GetDescription(lldb_private::Stream &strm,
diff --git a/lldb/source/Target/CPPLanguageRuntime.cpp b/lldb/source/Target/CPPLanguageRuntime.cpp
index ef120217005..70e5aee3e45 100644
--- a/lldb/source/Target/CPPLanguageRuntime.cpp
+++ b/lldb/source/Target/CPPLanguageRuntime.cpp
@@ -214,7 +214,7 @@ CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo(
return llvm::Regex::escape(first_template_parameter.str()) +
R"(::operator\(\)\(.*\))";
- if (symbol != NULL &&
+ if (symbol != nullptr &&
symbol->GetName().GetStringRef().contains("__invoke")) {
llvm::StringRef symbol_name = symbol->GetName().GetStringRef();
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 2be3774d076..b018a3115a0 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -1425,7 +1425,7 @@ Status Process::ResumeSynchronous(Stream *stream) {
Status error = PrivateResume();
if (error.Success()) {
StateType state =
- WaitForProcessToStop(llvm::None, NULL, true, listener_sp, stream);
+ WaitForProcessToStop(llvm::None, nullptr, true, listener_sp, stream);
const bool must_be_alive =
false; // eStateExited is ok, so this must be false
if (!StateIsStoppedState(state, must_be_alive))
@@ -3638,7 +3638,7 @@ void Process::ControlPrivateStateThread(uint32_t signal) {
}
if (signal == eBroadcastInternalStateControlStop) {
- thread_result_t result = NULL;
+ thread_result_t result = nullptr;
m_private_state_thread.Join(&result);
m_private_state_thread.Reset();
}
@@ -3913,7 +3913,7 @@ thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) {
// it was doing yet, so don't try to change it on the way out.
if (!is_secondary_thread)
m_public_run_lock.SetStopped();
- return NULL;
+ return nullptr;
}
// Process Event Data
diff --git a/lldb/source/Target/SectionLoadHistory.cpp b/lldb/source/Target/SectionLoadHistory.cpp
index 391a6c22f7f..ec16b58b445 100644
--- a/lldb/source/Target/SectionLoadHistory.cpp
+++ b/lldb/source/Target/SectionLoadHistory.cpp
@@ -97,7 +97,7 @@ SectionLoadList &SectionLoadHistory::GetCurrentSectionLoadList() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
SectionLoadList *section_load_list =
GetSectionLoadListForStopID(eStopIDNow, read_only);
- assert(section_load_list != NULL);
+ assert(section_load_list != nullptr);
return *section_load_list;
}
diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp
index 8f0ab34dbd1..6db0c2b037e 100644
--- a/lldb/source/Target/StopInfo.cpp
+++ b/lldb/source/Target/StopInfo.cpp
@@ -1196,7 +1196,7 @@ StopInfo::GetCrashingDereference(StopInfoSP &stop_info_sp,
address_loc += (sizeof(address_string) - 1);
- uint64_t address = strtoull(address_loc, 0, 0);
+ uint64_t address = strtoull(address_loc, nullptr, 0);
if (crashing_address) {
*crashing_address = address;
}
diff --git a/lldb/source/Target/ThreadPlanShouldStopHere.cpp b/lldb/source/Target/ThreadPlanShouldStopHere.cpp
index 111c5b4f611..a0b7072a107 100644
--- a/lldb/source/Target/ThreadPlanShouldStopHere.cpp
+++ b/lldb/source/Target/ThreadPlanShouldStopHere.cpp
@@ -130,7 +130,7 @@ ThreadPlanSP ThreadPlanShouldStopHere::DefaultStepFromHereCallback(
"Queueing StepInRange plan to step through line 0 code.");
return_plan_sp = current_plan->GetThread().QueueThreadPlanForStepInRange(
- false, range, sc, NULL, eOnlyDuringStepping, status,
+ false, range, sc, nullptr, eOnlyDuringStepping, status,
eLazyBoolCalculate, eLazyBoolNo);
}
}
diff --git a/lldb/tools/lldb-mi/MICmdCmdExec.cpp b/lldb/tools/lldb-mi/MICmdCmdExec.cpp
index fd13a919242..ffdf171aef0 100644
--- a/lldb/tools/lldb-mi/MICmdCmdExec.cpp
+++ b/lldb/tools/lldb-mi/MICmdCmdExec.cpp
@@ -983,13 +983,13 @@ bool CMICmdCmdExecArguments::Execute() {
}
lldb::SBLaunchInfo sbLaunchInfo = sbTarget.GetLaunchInfo();
- sbLaunchInfo.SetArguments(NULL, false);
+ sbLaunchInfo.SetArguments(nullptr, false);
CMIUtilString strArg;
size_t nArgIndex = 0;
while (pArgArguments->GetExpectedOption<CMICmdArgValString, CMIUtilString>(
strArg, nArgIndex)) {
- const char *argv[2] = {strArg.c_str(), NULL};
+ const char *argv[2] = {strArg.c_str(), nullptr};
sbLaunchInfo.SetArguments(argv, true);
++nArgIndex;
}
diff --git a/lldb/tools/lldb-mi/MICmdCmdTarget.cpp b/lldb/tools/lldb-mi/MICmdCmdTarget.cpp
index b3e0beac8d4..18ce038b168 100644
--- a/lldb/tools/lldb-mi/MICmdCmdTarget.cpp
+++ b/lldb/tools/lldb-mi/MICmdCmdTarget.cpp
@@ -265,7 +265,7 @@ bool CMICmdCmdTargetAttach::Execute() {
// If the current target is invalid, create one
lldb::SBTarget target = rSessionInfo.GetTarget();
if (!target.IsValid()) {
- target = rSessionInfo.GetDebugger().CreateTarget(NULL);
+ target = rSessionInfo.GetDebugger().CreateTarget(nullptr);
if (!target.IsValid()) {
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_CURRENT),
m_cmdData.strMiCmd.c_str()));
diff --git a/lldb/tools/lldb-mi/MICmnBase.cpp b/lldb/tools/lldb-mi/MICmnBase.cpp
index 72096d56feb..9d87064aa64 100644
--- a/lldb/tools/lldb-mi/MICmnBase.cpp
+++ b/lldb/tools/lldb-mi/MICmnBase.cpp
@@ -32,7 +32,7 @@ CMICmnBase::CMICmnBase()
// Return: None.
// Throws: None.
//--
-CMICmnBase::~CMICmnBase() { m_pLog = NULL; }
+CMICmnBase::~CMICmnBase() { m_pLog = nullptr; }
//++
// Details: Retrieve whether *this object has an error description set.
diff --git a/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp b/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
index 6cef2835128..59856a6f165 100644
--- a/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
+++ b/lldb/tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
@@ -53,7 +53,7 @@ MapOutOfBandToText(CMICmnMIOutOfBandRecord::OutOfBand_e veType) {
return "";
}
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
- return NULL;
+ return nullptr;
}
static const char *
@@ -95,7 +95,7 @@ MapOutOfBandToToken(CMICmnMIOutOfBandRecord::OutOfBand_e veType) {
return "&";
}
assert(false && "unknown CMICmnMIOutofBandRecord::OutOfBand_e");
- return NULL;
+ return nullptr;
}
//++
diff --git a/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp b/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp
index 00d1ce13d34..93bb5a60ec3 100644
--- a/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp
+++ b/lldb/tools/lldb-mi/MICmnMIResultRecord.cpp
@@ -34,7 +34,7 @@ MapResultClassToResultClassText(CMICmnMIResultRecord::ResultClass_e veType) {
return "exit";
}
assert(false && "unknown CMICmnMIResultRecord::ResultClass_e");
- return NULL;
+ return nullptr;
}
//++
diff --git a/lldb/tools/lldb-mi/MIDriver.cpp b/lldb/tools/lldb-mi/MIDriver.cpp
index 02361f4ccb9..3bf888e303d 100644
--- a/lldb/tools/lldb-mi/MIDriver.cpp
+++ b/lldb/tools/lldb-mi/MIDriver.cpp
@@ -51,7 +51,7 @@ const CMIUtilString CMIDriver::ms_constAppNameLong(MIRSRC(IDS_MI_APPNAME_LONG));
//--
CMIDriver::CMIDriver()
: m_bFallThruToOtherDriverEnabled(false), m_bDriverIsExiting(false),
- m_handleMainThread(0), m_rStdin(CMICmnStreamStdin::Instance()),
+ m_handleMainThread(nullptr), m_rStdin(CMICmnStreamStdin::Instance()),
m_rLldbDebugger(CMICmnLLDBDebugger::Instance()),
m_rStdOut(CMICmnStreamStdout::Instance()),
m_eCurrentDriverState(eDriverState_NotRunning),
@@ -737,7 +737,7 @@ FILE *CMIDriver::GetStdout() const {
// available before *this driver has been initialized! Flaw?
// Do not want to pass through driver to write to stdout
- return NULL;
+ return nullptr;
}
//++
diff --git a/lldb/tools/lldb-mi/MIDriverBase.cpp b/lldb/tools/lldb-mi/MIDriverBase.cpp
index 9958770ff42..b8844e28843 100644
--- a/lldb/tools/lldb-mi/MIDriverBase.cpp
+++ b/lldb/tools/lldb-mi/MIDriverBase.cpp
@@ -30,7 +30,7 @@ CMIDriverBase::CMIDriverBase()
// Return: None.
// Throws: None.
//--
-CMIDriverBase::~CMIDriverBase() { m_pDriverFallThru = NULL; }
+CMIDriverBase::~CMIDriverBase() { m_pDriverFallThru = nullptr; }
//++
// Details: This function allows *this driver to call on another driver to
diff --git a/lldb/tools/lldb-mi/MIDriverMgr.cpp b/lldb/tools/lldb-mi/MIDriverMgr.cpp
index 26c4add8e3f..26195cdb741 100644
--- a/lldb/tools/lldb-mi/MIDriverMgr.cpp
+++ b/lldb/tools/lldb-mi/MIDriverMgr.cpp
@@ -135,7 +135,7 @@ bool CMIDriverMgr::UnregisterDriverAll() {
}
m_mapDriverIdToDriver.clear();
- m_pDriverCurrent = NULL;
+ m_pDriverCurrent = nullptr;
return MIstatus::success;
}
diff --git a/lldb/tools/lldb-server/lldb-gdbserver.cpp b/lldb/tools/lldb-server/lldb-gdbserver.cpp
index a0bc5f2c68e..b479c2197bf 100644
--- a/lldb/tools/lldb-server/lldb-gdbserver.cpp
+++ b/lldb/tools/lldb-server/lldb-gdbserver.cpp
@@ -87,22 +87,22 @@ static int g_verbose = 0;
static struct option g_long_options[] = {
{"debug", no_argument, &g_debug, 1},
{"verbose", no_argument, &g_verbose, 1},
- {"log-file", required_argument, NULL, 'l'},
- {"log-channels", required_argument, NULL, 'c'},
- {"attach", required_argument, NULL, 'a'},
- {"named-pipe", required_argument, NULL, 'N'},
- {"pipe", required_argument, NULL, 'U'},
- {"native-regs", no_argument, NULL,
+ {"log-file", required_argument, nullptr, 'l'},
+ {"log-channels", required_argument, nullptr, 'c'},
+ {"attach", required_argument, nullptr, 'a'},
+ {"named-pipe", required_argument, nullptr, 'N'},
+ {"pipe", required_argument, nullptr, 'U'},
+ {"native-regs", no_argument, nullptr,
'r'}, // Specify to use the native registers instead of the gdb defaults
// for the architecture. NOTE: this is a do-nothing arg as it's
// behavior is default now. FIXME remove call from lldb-platform.
- {"reverse-connect", no_argument, NULL,
+ {"reverse-connect", no_argument, nullptr,
'R'}, // Specifies that llgs attaches to the client address:port rather
// than llgs listening for a connection from address on port.
- {"setsid", no_argument, NULL,
+ {"setsid", no_argument, nullptr,
'S'}, // Call setsid() to make llgs run in its own session.
- {"fd", required_argument, NULL, 'F'},
- {NULL, 0, NULL, 0}};
+ {"fd", required_argument, nullptr, 'F'},
+ {nullptr, 0, nullptr, 0}};
// Watch for signals
static int g_sighup_received_count = 0;
diff --git a/lldb/tools/lldb-server/lldb-platform.cpp b/lldb/tools/lldb-server/lldb-platform.cpp
index 595a0e82da2..af78f624073 100644
--- a/lldb/tools/lldb-server/lldb-platform.cpp
+++ b/lldb/tools/lldb-server/lldb-platform.cpp
@@ -48,16 +48,16 @@ static int g_server = 0;
static struct option g_long_options[] = {
{"debug", no_argument, &g_debug, 1},
{"verbose", no_argument, &g_verbose, 1},
- {"log-file", required_argument, NULL, 'l'},
- {"log-channels", required_argument, NULL, 'c'},
- {"listen", required_argument, NULL, 'L'},
- {"port-offset", required_argument, NULL, 'p'},
- {"gdbserver-port", required_argument, NULL, 'P'},
- {"min-gdbserver-port", required_argument, NULL, 'm'},
- {"max-gdbserver-port", required_argument, NULL, 'M'},
- {"socket-file", required_argument, NULL, 'f'},
+ {"log-file", required_argument, nullptr, 'l'},
+ {"log-channels", required_argument, nullptr, 'c'},
+ {"listen", required_argument, nullptr, 'L'},
+ {"port-offset", required_argument, nullptr, 'p'},
+ {"gdbserver-port", required_argument, nullptr, 'P'},
+ {"min-gdbserver-port", required_argument, nullptr, 'm'},
+ {"max-gdbserver-port", required_argument, nullptr, 'M'},
+ {"socket-file", required_argument, nullptr, 'f'},
{"server", no_argument, &g_server, 1},
- {NULL, 0, NULL, 0}};
+ {nullptr, 0, nullptr, 0}};
#if defined(__APPLE__)
#define LOW_PORT (IPPORT_RESERVED)
diff --git a/lldb/unittests/Utility/StringExtractorTest.cpp b/lldb/unittests/Utility/StringExtractorTest.cpp
index 6a67a8c3a15..b86e4660257 100644
--- a/lldb/unittests/Utility/StringExtractorTest.cpp
+++ b/lldb/unittests/Utility/StringExtractorTest.cpp
@@ -318,7 +318,7 @@ TEST_F(StringExtractorTest, GetHexBytes_Underflow) {
ASSERT_EQ(UINT64_MAX, ex.GetFilePos());
ASSERT_EQ(false, ex.Empty());
ASSERT_EQ(0u, ex.GetBytesLeft());
- ASSERT_EQ(0, ex.Peek());
+ ASSERT_EQ(nullptr, ex.Peek());
}
TEST_F(StringExtractorTest, GetHexBytes_Partial) {
diff --git a/lldb/unittests/tools/lldb-server/inferior/thread_inferior.cpp b/lldb/unittests/tools/lldb-server/inferior/thread_inferior.cpp
index 79d5f91f340..278b975dd91 100644
--- a/lldb/unittests/tools/lldb-server/inferior/thread_inferior.cpp
+++ b/lldb/unittests/tools/lldb-server/inferior/thread_inferior.cpp
@@ -28,7 +28,7 @@ int main(int argc, char* argv[]) {
}
// Cause a break.
- volatile char *p = NULL;
+ volatile char *p = nullptr;
*p = 'a';
delay.store(false);
diff --git a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
index 3cc0830dd3d..de4c46b32b4 100644
--- a/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
+++ b/lldb/unittests/tools/lldb-server/tests/MessageObjects.cpp
@@ -154,10 +154,10 @@ Expected<RegisterInfo> RegisterInfoParser::create(StringRef Response) {
LLDB_INVALID_REGNUM, // process plugin reg num
LLDB_INVALID_REGNUM // 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
};
Info.name = ConstString(Elements["name"]).GetCString();
if (!Info.name)
diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index e7cd370df6f..a05cf8130d3 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -63,7 +63,7 @@ struct DenseMapPair : public std::pair<KeyT, ValueT> {
template <typename AltPairT>
DenseMapPair(AltPairT &&AltPair,
typename std::enable_if<std::is_convertible<
- AltPairT, std::pair<KeyT, ValueT>>::value>::type * = 0)
+ AltPairT, std::pair<KeyT, ValueT>>::value>::type * = nullptr)
: std::pair<KeyT, ValueT>(std::forward<AltPairT>(AltPair)) {}
KeyT &getFirst() { return std::pair<KeyT, ValueT>::first; }
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
index 6638cb8e721..dde9ae7bca6 100644
--- a/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h
@@ -513,7 +513,7 @@ struct NodeArrayNode : public Node {
void output(OutputStream &OS, OutputFlags Flags, StringView Separator) const;
- Node **Nodes = 0;
+ Node **Nodes = nullptr;
size_t Count = 0;
};
OpenPOWER on IntegriCloud